Results 1 to 14 of 14

Thread: QTableView with a column of images

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2011
    Location
    Finland
    Posts
    164
    Thanks
    1
    Thanked 26 Times in 26 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: QTableView with a column of images

    Okay, I am not a specialist on python, couldn't even call myself a beginner. However I think you don't need this:
    Qt Code:
    1. style = QtGui.QApplication.style()
    2. opt.rect = option.rect
    To copy to clipboard, switch view to plain text mode 

    Just use option.rect directly.

    Appart from that there is nothing I could say is wrong or unnecessary. Have you tried to fill option.rect with some color?

  2. #2
    Join Date
    May 2011
    Location
    Paris
    Posts
    9
    Qt products
    Platforms
    Windows

    Default Re: QTableView with a column of images

    Filling the cells with a color works fine :

    Qt Code:
    1. painter.fillRect(option.rect, QtGui.QColor(191,222,185))
    To copy to clipboard, switch view to plain text mode 

    But still no changes with the pixmap

  3. #3
    Join Date
    Jun 2011
    Location
    Finland
    Posts
    164
    Thanks
    1
    Thanked 26 Times in 26 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: QTableView with a column of images

    The there are only 2 things can go wrong:

    1. Your pixmap is not loaded(wrong path)
    2. Your pixmap is not scalled to the size of the area you are drawing into.

Similar Threads

  1. how to disbale a column in a QTableView
    By rdjenner in forum Qt Programming
    Replies: 8
    Last Post: 14th August 2019, 15:44
  2. QTableView set column Decimals
    By ottoshmidt in forum Qt Programming
    Replies: 1
    Last Post: 20th December 2010, 05:00
  3. Currently sorted column in QTableView
    By borges in forum Newbie
    Replies: 1
    Last Post: 21st September 2007, 16:52
  4. Fixating column from QTableView ?
    By pinktroll in forum Qt Programming
    Replies: 2
    Last Post: 4th September 2007, 10:53
  5. QTableView without the first counter column?
    By pmaktieh.sirhc in forum Qt Programming
    Replies: 2
    Last Post: 4th January 2007, 22:03

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.