Results 1 to 5 of 5

Thread: Degree of color

  1. #1
    Join Date
    Jul 2010
    Posts
    71
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Degree of color

    Hello
    How do I know the degree the color of the window?
    - The normal color of qt creator.


  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Degree of color

    Please try to ask that question again. I can't make anything out of it. What do you want to know? What colors are used by Qt Creator?

  3. #3
    Join Date
    Jul 2010
    Posts
    71
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Degree of color

    Quote Originally Posted by tbscope View Post
    Please try to ask that question again. I can't make anything out of it. What do you want to know? What colors are used by Qt Creator?
    I want to paint the graphicsView with the same background color.
    by Using
    Qt Code:
    1. ui->graphicsView->setBackgroundBrush(QBrush( Qt::lightGray, Qt::SolidPattern));
    To copy to clipboard, switch view to plain text mode 
    Experimented more than one color without interest.

    In short, what is the background color of the MainWindow?

  4. #4
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Degree of color

    try this:

    Qt Code:
    1. QPalette palette = yourWidget->palette();
    2. QColor color = palette.color(QPalette::Base);
    To copy to clipboard, switch view to plain text mode 

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Degree of color

    It's more likely QPalette::Window and not QPalette::Base.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 3
    Last Post: 22nd January 2010, 16:46
  2. Display Label Color by selecting Color Picker
    By sosanjay in forum Qt Programming
    Replies: 1
    Last Post: 25th September 2009, 06:11
  3. Button grid with label rotate 90 degree
    By whitefurrows in forum Qt Programming
    Replies: 14
    Last Post: 24th June 2009, 17:17
  4. how to change backgroup color, button color and shape?
    By lzha022 in forum Qt Programming
    Replies: 10
    Last Post: 16th June 2008, 22:25
  5. How to specify RGB color in Qt?
    By krishbhala in forum Qt Programming
    Replies: 1
    Last Post: 4th December 2007, 12:09

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.