Results 1 to 6 of 6

Thread: Delegate is not validated automatically with my own widget

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2008
    Posts
    70
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default Re: Delegate is not validated automatically with my own widget

    Nobody knows !

  2. #2
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    131
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    11
    Thanked 16 Times in 16 Posts

    Default Re: Delegate is not validated automatically with my own widget

    I'm not sure if I have understand your scenario.

    The "external" button is not part of the editor widget? Why not make the button part of the editor? Clicking on "add" would do a validation and close the widget if the data is valid? Afair "setModelData()" is called if the editor loses his focus.

    or ask a method like "isValid()" in "setModelData()" and only add the data to the model if it returns true.

  3. #3
    Join Date
    Aug 2008
    Posts
    70
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default Re: Delegate is not validated automatically with my own widget

    To be clearer:

    I have a QTreeWidget with a delegate for edition of cells.

    Case 1- If the component used for edition is a QComboBox, then the edition mode is closed and the value of the QComboBox is kept when the focus is lost.
    This is a standard behaviour with code needed.

    Case 2- If the component used for edition is a my widget (A frame containing 3 QComboBox), then the edition mode is closed and the value of the QComboBox is NOT kept (cell is empty) when the focus is lost.
    So, end user needs to validate the cell by clicking "Return".

    How to get same behaviour in Case 2 than in Case 1 ?

Similar Threads

  1. QDockWidget inside another widget in the center?
    By Antebios in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2010, 07:06
  2. How to Open & Close a Widget ?!!
    By Fatla in forum Qt Programming
    Replies: 6
    Last Post: 13th June 2008, 20:39
  3. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35
  4. Replies: 1
    Last Post: 22nd October 2007, 02:04
  5. Creating advanced widget in a delegate.
    By bunjee in forum Qt Programming
    Replies: 8
    Last Post: 5th February 2007, 08:09

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.