Results 1 to 2 of 2

Thread: how to fix selected item to centre of QListWidget

  1. #1
    Join Date
    Mar 2014
    Posts
    18
    Thanks
    3
    Qt products
    Qt3 Qt4 Qt/Embedded

    Default how to fix selected item to centre of QListWidget

    Hi all,

    I tried to find a way to fix the selected item of a QListWidget vertically in the centre of the list. So that, when i choose an item, it moves to the centre of the view and all the others around go with it.


    ******
    item1
    item2
    item3 (now selected)
    item4
    item5
    ******

    when is select item1, it shall look like this:

    ******


    item1 (now selected)
    item2
    item3
    ******

    Any clues?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,716
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to fix selected item to centre of QListWidget

    I'd say this a job for QSortFilterProxyModel.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Replies: 1
    Last Post: 11th November 2015, 14:14
  2. Replies: 8
    Last Post: 28th May 2013, 14:03
  3. QListWidget selected item Row id.
    By nagabathula in forum Qt Programming
    Replies: 8
    Last Post: 20th December 2010, 18:08
  4. How to set selected item of a QListWidget?
    By Lawand in forum Qt Programming
    Replies: 9
    Last Post: 5th April 2009, 12:23
  5. QListWidget/QTreeWidget, etc selected item color
    By Arthur in forum Qt Programming
    Replies: 4
    Last Post: 15th May 2006, 17: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.