Results 1 to 10 of 10

Thread: Model/View framework, delegate: don't close editor while it contains invalid value

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 453 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Model/View framework, delegate: don't close editor while it contains invalid valu

    The documentation says

    void QAbstractItemDelegate::closeEditor ( QWidget * editor, QAbstractItemDelegate::EndEditHint hint = NoHint ) [signal]
    This signal is emitted when the user has finished editing an item using the specified editor.
    The hint provides a way for the delegate to influence how the model and view behave after editing is completed. It indicates to these components what action should be performed next to provide a comfortable editing experience for the user. For example, if EditNextItem is specified, the view should use a delegate to open an editor on the next item in the model.
    which means that signal to close to editor is emitted by the QAbstractItemDelegate (base class), we don't have any control over this, basically we cannot stop editor being closed from delegate, unless we block all signals from the delegate which is not practical

    another way (other than event filtering) would be to send a signal to the QAbstractItemView::edit () slot of the view to restart the editor (after validating the data)

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Model/View framework, delegate: don't close editor while it contains invalid valu

    Quote Originally Posted by Santosh Reddy View Post
    another way (other than event filtering) would be to send a signal to the QAbstractItemView::edit () slot of the view to restart the editor (after validating the data)
    That's exactly what I meant.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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

    oberlus (21st September 2011)

Similar Threads

  1. Replies: 9
    Last Post: 8th March 2011, 08:35
  2. Model-View-Delegate
    By hotdox in forum Qt Programming
    Replies: 3
    Last Post: 11th May 2010, 13:20
  3. Data structure reference in Model/View Framework
    By jimc1200 in forum Qt Programming
    Replies: 4
    Last Post: 14th September 2009, 20:23
  4. Model/View framework: streaming data in a QTableView
    By yannickt in forum Qt Programming
    Replies: 6
    Last Post: 24th October 2008, 00:06
  5. Model View - Delegate - setIndexWidget
    By starcontrol in forum Qt Programming
    Replies: 16
    Last Post: 2nd April 2008, 14:30

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.