Results 1 to 3 of 3

Thread: How to add a item to the top in QListWidget???

  1. #1
    Join Date
    Sep 2011
    Posts
    24
    Qt products
    Qt4
    Platforms
    Windows

    Default How to add a item to the top in QListWidget???

    Hi,

    I'm using QLineEdit widget to add item to a QListWidget. However when I add the item, it goes beneath previous item. I don't want sort the item list and need to put the new item to top of the list.

    Is there any way to do this?

    Indika...

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: How to add a item to the top in QListWidget???

    You can use insertItem to insert an item on the position you want.

  3. #3
    Join Date
    Sep 2011
    Posts
    24
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to add a item to the top in QListWidget???

    Thanks ...

Similar Threads

  1. QListWidget selected item Row id.
    By nagabathula in forum Qt Programming
    Replies: 8
    Last Post: 20th December 2010, 17:08
  2. Selecting an item from QListWidget
    By chandru@080 in forum Qt Programming
    Replies: 1
    Last Post: 18th November 2010, 06:30
  3. QListWidget item layot
    By viciv919 in forum Qt Programming
    Replies: 0
    Last Post: 22nd March 2010, 19:37
  4. QListWidget Item
    By csvivek in forum Qt Programming
    Replies: 1
    Last Post: 15th June 2008, 09:02
  5. Reg - add item in QListWidget
    By suresh in forum Newbie
    Replies: 1
    Last Post: 1st September 2006, 17:52

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.