Results 1 to 2 of 2

Thread: QStyledItemDelegate update index

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

    Default QStyledItemDelegate update index

    Hi, I subclassed QStyledItemDelegate for QTreeView. I would like to update some info using paint() by emitting a signal from other object.

    Could some how provide an example how can I update QStandardItem in delegate ?

    Thanks

  2. #2
    Join Date
    Jul 2010
    Posts
    41
    Thanks
    6
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QStyledItemDelegate update index

    Hi,
    'index' variable passed to 'QStyledItemDelegate::paint()' is a 'const' variable and you can't modify it there.
    If I understand correctly, you can connect that signal to a slot and update passed QStandardItem on that slot, and then call repaint(), now 'QStyledItemDelegate::paint()' paints item with new info.

Similar Threads

  1. Replies: 6
    Last Post: 25th June 2011, 11:35
  2. Custom QStyledItemDelegate
    By Berryblue031 in forum Qt Programming
    Replies: 0
    Last Post: 2nd March 2011, 10:32
  3. Replies: 2
    Last Post: 29th September 2010, 17:44
  4. QStandardItem, QStyledItemDelegate, and QWebView
    By enlightened_j in forum Newbie
    Replies: 1
    Last Post: 16th August 2010, 08:44
  5. update custom QStyledItemDelegate after drag
    By dano in forum Qt Programming
    Replies: 1
    Last Post: 17th November 2008, 18:29

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.