Results 1 to 5 of 5

Thread: QListWidget non-selected to start

  1. #1
    Join Date
    Oct 2009
    Posts
    38
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Question QListWidget non-selected to start

    I've looked on the net and in this forum and haven't yet found someone talking about this issue. I'm trying to display a list of possible items to select in a dialog, and I'm using a QListWidget to do it. The problem is that I don't want any of the items to be selected when the list is first displayed. The widget selects the first item by default. I'd like to know how to turn that display off, so that all items are equally unselected, and the user doesn't get "pointed" toward a "preferred" choice. Does anyone have a suggestion?

  2. #2
    Join Date
    Feb 2010
    Posts
    18
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QListWidget non-selected to start

    Did you already try QAbstractItemView::clearSelection ()?

  3. #3
    Join Date
    Oct 2009
    Posts
    38
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Thumbs down Re: QListWidget non-selected to start

    Yes, I did that, but strangely enough, the first item in the list is still showing with a different aspect than the rest. From reading the description for that method, it would seem that it should have "Deselect[ed] all selected items". Maybe it did that logically, but not visually. It does say that the current index will not be changed. Is there a tie to the fact that the index is still set? I tried setCurrentItem(0,QItemSelectionModel:eselect), but that didn't work neither. I'm not sure why this doesn't work.

  4. #4
    Join Date
    Feb 2010
    Posts
    18
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QListWidget non-selected to start

    Now I know, what you mean. You want the dotted rectangle disappear. That's the mark of the current row. The item is not actually selected(inverted line). I see the problem, that people could be manipulated to select the dotted Item, but I have no clue to solve that problem.

  5. #5
    Join Date
    Oct 2009
    Posts
    38
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: QListWidget non-selected to start

    Anyone? I'm really kind of stumped here.

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: 11th January 2010, 23:15
  3. qlistwidget count of selected items
    By tpf80 in forum Newbie
    Replies: 4
    Last Post: 10th December 2009, 13:31
  4. How to set selected item of a QListWidget?
    By Lawand in forum Qt Programming
    Replies: 9
    Last Post: 5th April 2009, 11:23
  5. Replies: 1
    Last Post: 5th June 2008, 14:02

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.