Results 1 to 1 of 1

Thread: qlistwidget custome sorting

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Posts
    132
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default qlistwidget custome sorting

    How to sort an items from custom item role ?

    Like QTableView has!

    Qt Code:
    1. model = new QStandardItemModel(this);
    2. _model->setSortRole(ListView::sortRole);
    To copy to clipboard, switch view to plain text mode 

    I know I can do
    item->setData(Qt:isplayRole, number); but I add a widget to the item and don't want a display role here
    Last edited by migel; 1st September 2011 at 12:15.

Similar Threads

  1. abstract custome QWidget class
    By migel in forum Newbie
    Replies: 1
    Last Post: 12th July 2011, 09:41
  2. Replies: 2
    Last Post: 1st April 2011, 09:32
  3. Replies: 0
    Last Post: 16th February 2011, 09:23
  4. Sorting
    By bismitapadhy in forum Qt Programming
    Replies: 26
    Last Post: 30th January 2010, 16:59
  5. Sorting a qtablewidget......
    By reshma in forum Qt Programming
    Replies: 8
    Last Post: 23rd March 2009, 14:34

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.