Results 1 to 2 of 2

Thread: Design help please

  1. #1
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Design help please

    Hi,

    I have an application which has lots of input boxes whose font size and font family can be changed by the user in the preferences window.

    I have a class called Preferences where I store this information by reading it from the ini file using QSettings.

    The path to the input boxes is

    MainWindow->Splitter->ScrollArea->Widget->Input Box

    How can I pass the font information from preferences to the input boxes?

    Currently, I have a singleton class called Preferences and I call Preferences::Instance() whereever I need in my program.

    I doubt if this is a nice way.

    Can someone tell me if there is a better way ?

    Thanks a lot

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Design help please

    Just returned from DevDays (was GREAT!! - I'll post inpressions later) and they showed how to use tyle sheets.
    With just few lines of code, you can influence the whole look and feel of our widget, on various scopes (specific object, class, hirarchy etc...) .
    http://doc.trolltech.com/4.2/qt4-2-i...t-style-sheets
    This is very powerfull, but not yet fully mature.
    Not all widgets are supported, and there are still some things to improrve, but man, it really rocks!
    Its exactly what you want to do here, but all done for you by Qt - you only need to supply the values for the various style properties.
    Another way is to implement a proxy style.

Similar Threads

  1. Three Tier Database Programming - Design Pattern
    By sunil.thaha in forum Qt Programming
    Replies: 3
    Last Post: 8th July 2011, 04:00
  2. Design Patterns in Qt
    By bits in forum General Discussion
    Replies: 11
    Last Post: 11th May 2007, 09:13
  3. Design problem/question
    By Valheru in forum Qt Programming
    Replies: 2
    Last Post: 27th September 2006, 21:45
  4. Dialog and code design issue
    By Gopala Krishna in forum Qt Programming
    Replies: 1
    Last Post: 24th September 2006, 17:54
  5. A Design Issue...
    By nupul in forum Qt Programming
    Replies: 6
    Last Post: 4th May 2006, 17:41

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.