Results 1 to 2 of 2

Thread: Changing application palette [solved]

  1. #1
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Changing application palette [solved]

    Hi guys,

    I have a simple question about changing application main window and children windows' background color and text color. Before write some code I would like to ask you which is the shortest and the best route to application palette.

    The user can choose, from a menu from the main window, to change main window and child windows' window color _>Black and windowText color to blue.

    I have 2 ideas for getting what I need:
    1) appropriate setPalette(....) for the mainwindow and when a child window is constructed/displayed it should get palette from its' parent
    2) setting qApp stylesheet to set window and window text colors

    Which option would you suggest? Or maybe different?

    Thank for any comment.

    Kacper
    Last edited by maverick_pol; 2nd April 2008 at 18:38.
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  2. #2
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Changing application palette

    Ok,

    I think this solution is the fastest:
    Qt Code:
    1. void QApplication::setPalette ( const QPalette & palette, const char * className = 0 ) [static]
    To copy to clipboard, switch view to plain text mode 

    Kacper
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

Similar Threads

  1. QSkinWindows Classes
    By kernel_panic in forum Qt-based Software
    Replies: 45
    Last Post: 20th April 2010, 13:35
  2. Loading library from application
    By mourad in forum Installation and Deployment
    Replies: 0
    Last Post: 2nd April 2008, 16:10
  3. dll + application
    By fpujol in forum Qt Programming
    Replies: 11
    Last Post: 15th April 2007, 19:37
  4. Replies: 3
    Last Post: 8th December 2006, 19:51

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.