Results 1 to 3 of 3

Thread: QListWidget with check box's

  1. #1
    Join Date
    May 2007
    Posts
    301
    Thanks
    46
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QListWidget with check box's

    Hi,

    Is it possible to have check box's in a QListWidget?

    Thanks,
    Steve

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QListWidget with check box's

    Yes:
    Qt Code:
    1. QListWidgetItem* item = new QListWidgetItem("item", listWidget);
    2. item->setFlags(item->flags() | Qt::ItemIsUserCheckable); // set checkable flag
    3. item->setCheckState(Qt::Unchecked); // AND initialize check state
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  3. The following 3 users say thank you to jpn for this useful post:

    Dims (20th December 2013), steg90 (14th May 2007), tpf80 (13th November 2009)

  4. #3
    Join Date
    May 2007
    Posts
    301
    Thanks
    46
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QListWidget with check box's

    Many thanks JPN

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.