Results 1 to 4 of 4

Thread: How to reset the Palette for form

  1. #1
    Join Date
    May 2006
    Posts
    19
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to reset the Palette for form

    Hello all,
    How do I reset the palette for a form, or get it to use the current Windows/KDE colours?
    Cheers,
    Donal

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to reset the Palette for form

    Click on the small red arrow besides "Change Palette" button to reset it.

  3. The following user says thank you to jacek for this useful post:

    donmorr (10th August 2006)

  4. #3
    Join Date
    Aug 2006
    Location
    Zürich, Switzerland
    Posts
    23
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Angry Re: How to reset the Palette for form

    If you do it in code try this:

    1. create a temporary control
    2. get its palette
    3. set the palette of the temp. control as the palette of your control

    This should also work for forms.

    Here's a small code excerpt which shows how to set the default palette for a QTreeView:

    Qt Code:
    1. QTreeView t; // a temp. control
    2. myTreeView->setPalette(t.palette());
    To copy to clipboard, switch view to plain text mode 

    Ernst

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to reset the Palette for form

    Quote Originally Posted by 3dch
    1. create a temporary control
    2. get its palette
    3. set the palette of the temp. control as the palette of your control
    Or simply (for standard Qt widgets):
    Qt Code:
    1. widget->setPalette( QApplication::palette( widget ) );
    To copy to clipboard, switch view to plain text mode 
    Last edited by jacek; 12th August 2006 at 12:19.

Similar Threads

  1. Palette definition
    By Roberto Sciascia in forum Qt Tools
    Replies: 3
    Last Post: 21st March 2006, 15:29

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.