Results 1 to 6 of 6

Thread: Qt Application Preferences Best Practice

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    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: Qt Application Preferences Best Practice

    I believe the global change of colors is achieved using QPalette like approach, I am afraid you may have to consider using either QPalette as is or write a similar class with custom color roles as per you needs. But again this is same as your initial idea of having a ColorManager Widget. You can have two classes, one as custom color palette, and other as a widget which can edit this custom color palette (like using a color picker). You can set this custom color palette on the model directly, and model can be implemented to used the custom color palette color roles. As you already considered QSettings, it is simple and nice ways make these settings persistent.

    FYI, I ran into similar task some time back, I ended up writing a small class. It was not just color though, it had other application wide configurations like fonts, font size, buffer sizes, timing etc.

    If it is just color you are looking for, and if is just the Qt::BackgroundRole you are supplying to View, then I would still go with QPalette. Writing a custom color palette may not be of much use as the View does not understand these custom color roles, unless you implement a custom view which I guess you are not doing.

    anyways see if someone has any ideas.

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

    stefanadelbert (1st November 2011)

Similar Threads

  1. Touchscreen Best Practice ?
    By vendra in forum Newbie
    Replies: 1
    Last Post: 11th January 2011, 12:43
  2. Replies: 0
    Last Post: 29th July 2009, 19:27
  3. what's the better practice?
    By xyzt in forum Qt Programming
    Replies: 1
    Last Post: 22nd March 2008, 18:42
  4. Best Practice on single source Qt Desktop/Qtopia Core/QPE application
    By izico in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 31st March 2007, 07:08
  5. 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
  •  
Qt is a trademark of The Qt Company.