Results 1 to 10 of 10

Thread: Qt Property Browser library - notice on edit conclusion

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    Join Date
    Nov 2010
    Posts
    97
    Thanks
    6
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt Property Browser library - notice on edit conclusion

    Decided to go ahead and paste directions for a fix here too:

    So, here's the half-ass fix I came up with:

    I added a "commitItem(QModelIndex)" function to the private thing in the TreePropertyBrowser. Then I call that from the delegate when the setModelData() function is called.

    This then finds the property, calls a new function I added to the AbstractBrowser to fetch the factory for a property and then tells the factory to "commitProperty(QtProperty*)".

    This function is an empty virtual at the base and in the LineEditFactory I override it to apply the property change, which generates the valueChanged() signal.

    With these changes in place the user is able to back out of the edit by hitting the ESC key and I get notified iff they commit the property change by hitting RETURN, focus changing, etc...

    Only works for the tree version at the moment. Probably won't bother trying to make the rest work. In fact I'm probably going to throw this library away and just use the QTreeView myself. IT behaves the way I want, this thing had to be uber-hacked to get the behavior BACK.

    Oh, and the LineEditor's createEditor function has to be edited to remove the connection to textChanged(). To get the correct behavior the property has to remain unchanged until the commitProprty() request is made.
    Last edited by nroberts; 18th December 2010 at 00:49.

Similar Threads

  1. Help with property browser
    By Jsvc in forum Qt Programming
    Replies: 2
    Last Post: 3rd October 2010, 01:49
  2. Compilation of QT Property Browser
    By yccheok in forum Qt Programming
    Replies: 7
    Last Post: 28th July 2010, 23:39
  3. How to hide subproperties in Qt Property Browser?
    By yyalli in forum Qt Programming
    Replies: 0
    Last Post: 15th April 2010, 17:29
  4. Qt Creator Adding a Help File (for the Property Browser)
    By BobTheProg in forum Qt Tools
    Replies: 5
    Last Post: 29th January 2010, 23:44
  5. Qt Property Browser Framework - Redo/Undo
    By monadic_kid in forum Qt Programming
    Replies: 2
    Last Post: 3rd December 2009, 10: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.