Results 1 to 2 of 2

Thread: Auto applying preferences

  1. #1
    Join Date
    Aug 2009
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Auto applying preferences

    Is there any solution for mac os style preferences dialog, when setting are applied in time user edits properties in widgets (without an "apply" button)?
    Functionality seems similar to QDataWidgetMapper, however i don't see advantages of using mapper (i will need "SettingsModel" in that case; also it is not very comfortable to assign mapping to they model as long as mapper works with single column/row, while i need to map whole settings tree)

    I saw KAutoConfig class, however it has all standard widgets hardcoded in it and it sets settings while user changes properies, which is not always appropriate, i think much better to use behavior of QItemDelegate - accept on pressing "return" or loosing focus and reject on pressing "esc". However monitoring properties should also be possible - sliders should not be confirmed, for example.

    Any ideas how to implement that feature properly?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Auto applying preferences

    I saw KAutoConfig class, however it has all standard widgets hardcoded in it and it sets settings while user changes properies, which is not always appropriate, i think much better to use behavior of QItemDelegate - accept on pressing "return" or loosing focus and reject on pressing "esc".
    So don't code your dialog like that.
    For line edits only update the underlying setting after each key press if a validator says the value is acceptable (not intermediate or unacceptable). If you want to update the underlying setting when focus is lost or enter is pressed look for the editingFinished() signal.
    For sliders simply update the underlying settings every time you get the valueChanged() signal (assuming the range is all acceptable).
    For check boxes and radio boxes you can update on every toggled() or clicked() signal.

    In short, there is no QMacStyleOptionsDialog.

Similar Threads

  1. Qt Application Preferences Best Practice
    By stefanadelbert in forum Qt Programming
    Replies: 5
    Last Post: 1st November 2011, 05:47
  2. Applying tr() function
    By prashant.patel in forum Newbie
    Replies: 4
    Last Post: 7th September 2011, 22:48
  3. Replies: 0
    Last Post: 29th July 2009, 19:27
  4. Qt/MacOSX preferences menu item
    By mcenatie in forum Qt Programming
    Replies: 4
    Last Post: 14th March 2006, 04:24

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.