Results 1 to 3 of 3

Thread: Model/View: Custom Persistent Editor

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Model/View: Custom Persistent Editor

    Call QAbstractItemDelegate::commitData() on your editor before closing it.

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

    No-Nonsense (7th February 2007)

  3. #2
    Join Date
    Nov 2006
    Posts
    35
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    25

    Question Re: Model/View: Custom Persistent Editor

    Quote Originally Posted by wysota View Post
    Call QAbstractItemDelegate::commitData() on your editor before closing it.
    How would I do this? QItemDelegate only has methods to create an editor but deletes it on its own.

    I had a look at the Qt doc example http://doc.trolltech.com/4.2/itemvie...xdelegate.html and they want me to install an event filter: "We install an event filter on the spin box to ensure that it behaves in a way that is consistent with other delegates. The implementation for the event filter is provided by the base class."

    I then had a look at QItemDelegate but there they do not install an event filter in createEditor so why should I do (I tried and it did not help with my problem).

    Why do the standard Qt ItemDelegates (QComboBox, QSpinBox, QLineEdit) work as expected? When do they call commitData?

    Thanks in advance,
    -Jens

Similar Threads

  1. Replies: 5
    Last Post: 16th May 2006, 21:38
  2. Replies: 12
    Last Post: 15th February 2006, 11:46

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.