Results 1 to 2 of 2

Thread: Check to see if a listwidget has a selected item

  1. #1
    Join Date
    Apr 2010
    Posts
    37
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Check to see if a listwidget has a selected item

    I'm not sure how to do this. I need to know how to check to see if a listwidget has an item selected or not.

  2. #2
    Join Date
    Apr 2010
    Posts
    37
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Check to see if a listwidget has a selected item

    Nevermind. I figured it out. For future reference:

    if(this->ui->listWidgetRadiology->selectedItems().size() != 0)
    QString selectedFile = this->ui->listWidgetRadiology->currentItem()->text();

Similar Threads

  1. popupmenu for QTreeWidget's item when a particular item selected.
    By vinod sharma in forum Best Practices in Qt Programming
    Replies: 1
    Last Post: 22nd January 2010, 10:45
  2. Replies: 1
    Last Post: 20th January 2010, 08:38
  3. Check Selected Content
    By bismitapadhy in forum Qt Programming
    Replies: 12
    Last Post: 15th July 2009, 13:48
  4. ListWidget positions item
    By talex in forum Qt Programming
    Replies: 3
    Last Post: 21st October 2008, 15:16
  5. Replies: 5
    Last Post: 1st March 2007, 08:19

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