Results 1 to 4 of 4

Thread: Problem in creating more than one Qt::UserRole QListWidgetItem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Problem in creating more than one Qt::UserRole QListWidgetItem

    Qt Code:
    1. it.setData(Qt::UserRole, 1);
    2. it.setData(Qt::UserRole+1, 2);
    3. qWarning() << it.data(Qt::UserRole);
    4. qWarning() << it.data(Qt::UserRole + 1);
    To copy to clipboard, switch view to plain text mode 
    works fine, so please go ahead and try to debug your code yourself.
    And a minimal example would be better. Also the use of [CODE] could make your code more readable.

  2. The following user says thank you to Lykurg for this useful post:

    sivambigai (7th October 2010)

Similar Threads

  1. Replies: 2
    Last Post: 14th June 2010, 09:40
  2. problem in presentation of text-icon QListWidgetItem
    By utopia500 in forum Qt Programming
    Replies: 4
    Last Post: 16th April 2010, 10:12
  3. Model/View one index.column as hidden UserRole
    By doitux in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2008, 12:08
  4. setting UserRole data in QSqlTableModel
    By orgads in forum Qt Programming
    Replies: 1
    Last Post: 2nd June 2008, 09:40

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.