Results 1 to 5 of 5

Thread: Looking for a Widget Similar to QListWidget

  1. #1
    Join Date
    Jun 2007
    Posts
    10
    Thanks
    3

    Default Looking for a Widget Similar to QListWidget

    Hi,

    Is there a widget that's similar to a QListWidget, except that each item in the list has a checkbox as well? There doesn't seem to be one in the main set of widget's provided, but is there something like this online I could copy? (Or is there a really quick way to create one from scratch?)

    I've included a picture to better describe what I'm looking for. The list on the left is what I would like to create in my program.
    Attached Images Attached Images

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Looking for a Widget Similar to QListWidget

    No there isn't yet, but you could take a look at QxtCheckComboBox from the QxtGui package.

    It does exactly what you want, except it is a combo box.
    Maybe you can port it in a list widget?

    Regards

  3. #3
    Join Date
    Jun 2007
    Posts
    10
    Thanks
    3

    Default Re: Looking for a Widget Similar to QListWidget

    Quote Originally Posted by marcel View Post
    No there isn't yet, but you could take a look at QxtCheckComboBox from the QxtGui package.

    It does exactly what you want, except it is a combo box.
    Maybe you can port it in a list widget?

    Regards
    Hmm, that is very close to what I'm looking for. It seems like from reading other threads that you can insert QListWidgetItems that are checkable into QListWidgets. I'll have to investigate this further.

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Looking for a Widget Similar to QListWidget

    Oh, yes, damn it!
    Add this to the item flags: Qt::ItemIsUserCheckable.
    This will make the items checkable.
    Then you have QListWidgetItem::setCheckState and checkState.

    Regards

  5. #5
    Join Date
    Dec 2006
    Location
    San Antonio, TX
    Posts
    9
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Looking for a Widget Similar to QListWidget

    stealth86,

    Here is an example using model -> treeview.
    Hope this helps.

    Junior
    Attached Files Attached Files

  6. The following user says thank you to Junior for this useful post:

    stealth86 (7th August 2007)

Similar Threads

  1. Replies: 27
    Last Post: 14th May 2008, 11:39
  2. transparent background of the main widget
    By nagpalma in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2007, 18:52
  3. Replies: 13
    Last Post: 15th December 2006, 12:52
  4. Replies: 2
    Last Post: 19th April 2006, 20:11
  5. [Qt 4.1.0] Split a widget on demand
    By Townk in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2006, 15:16

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.