Results 1 to 2 of 2

Thread: When windows focused and QListWidget had focus, first item selected, bug?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2015
    Posts
    2
    Thanks
    2
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: When windows focused and QListWidget had focus, first item selected, bug?

    I have same issue, I think this is a bug.
    Workaround for this is to use selectionChanged(QItemSelection,QItemSelection) instead of currentRowChanged(QModelIndex,QModelIndex) and use next code:

    Qt Code:
    1. void YourClass::selectionChangedSlot(const QItemSelection& selection, const QItemSelection&)
    2. {
    3. QModelIndexList selected = selection.indexes();
    4. int row = selected.size() ? selected.first().row() : -1;
    5. ...
    6. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by borzh62; 11th November 2015 at 13:45.

Similar Threads

  1. QListWidget selected item Row id.
    By nagabathula in forum Qt Programming
    Replies: 8
    Last Post: 20th December 2010, 17:08
  2. Replies: 2
    Last Post: 2nd December 2010, 11:27
  3. How to set selected item of a QListWidget?
    By Lawand in forum Qt Programming
    Replies: 9
    Last Post: 5th April 2009, 11:23
  4. Replies: 3
    Last Post: 7th November 2006, 08:35
  5. QListWidget/QTreeWidget, etc selected item color
    By Arthur in forum Qt Programming
    Replies: 4
    Last Post: 15th May 2006, 16:50

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.