Results 1 to 3 of 3

Thread: List style for QTableWidget

  1. #1
    Join Date
    Aug 2013
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default List style for QTableWidget

    Hello everybody. In my program I need a list with multiple columns. Since QListView and QListWidget doesn't support multiple columns (I've searched about that), I'm using a QTableWidget to display two columns and probably three or four in the future. I want this widget to look like a common list. What can I do? I'm currently hiding the grid with setShowGrid, but that doesn't resolve the problem. It stills looks and behave like a table. If click somewhere, I want the hole row to be selected, not only a cell. Even if I use setSpan, that will "erase" / disable / hide the rest of the cells. Is there any way to unify all the cells so it looks like a list?

    Thanks and sorry for my English? :-)

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: List style for QTableWidget

    Use QTreeWidget, hide the header and disable root decoration.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    cdonts (24th August 2013)

  4. #3
    Join Date
    Aug 2013
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: List style for QTableWidget

    Nice. It works. Thanks!

Similar Threads

  1. A list box with an specific style checkbox
    By wxShayan in forum Newbie
    Replies: 1
    Last Post: 30th December 2012, 12:53
  2. QCombobox style - list permanently open
    By braindead in forum Qt Programming
    Replies: 2
    Last Post: 20th March 2012, 15:05
  3. style a list item
    By savar in forum Newbie
    Replies: 3
    Last Post: 18th March 2010, 18:21
  4. Do Qt Style Sheets support List-style-image?
    By daiheitan in forum Qt Programming
    Replies: 6
    Last Post: 12th March 2010, 01:41
  5. Skype style list.
    By bunjee in forum Qt Programming
    Replies: 4
    Last Post: 29th January 2007, 15:49

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.