Results 1 to 20 of 24

Thread: Retrieve the colours used by Qt to render a frame of StyledPanel shape

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Retrieve the colours used by Qt to render a frame of StyledPanel shape

    So basically you have a one pixel wide line and not a part of a frame which is usually at least two pixel wide (see QStyle::pixelMetric for PM_DefaultFrameWidth) Why don't you just use one of QPalette's Light, Midlight, Dark, Mid or Shadow values?
    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.


  2. #2
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Retrieve the colours used by Qt to render a frame of StyledPanel shape

    Quote Originally Posted by wysota View Post
    So basically you have a one pixel wide line and not a part of a frame which is usually at least two pixel wide (see QStyle::pixelMetric for PM_DefaultFrameWidth) Why don't you just use one of QPalette's Light, Midlight, Dark, Mid or Shadow values?
    Yes, a one-pixel wide line. I honestly can't remember of wide the frame was when I tried QStylePainter::drawPrimitive(). I just know that it worked for the full frame. Anyway, I did succesfully use QPalette's Light, Midlight, etc. values before, but none of them corresponds to the actual colour used by the theme to render a frame, hence my original message.

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

    Default Re: Retrieve the colours used by Qt to render a frame of StyledPanel shape

    My main point is that you can't get an OS agnostic consistent look (I don't think the theme draws such one pixel lines anywhere), so there is a question if it is worth trying at all.
    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.


  4. #4
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Retrieve the colours used by Qt to render a frame of StyledPanel shape

    Quote Originally Posted by wysota View Post
    My main point is that you can't get an OS agnostic consistent look (I don't think the theme draws such one pixel lines anywhere), so there is a question if it is worth trying at all.
    I agree with your statement in general, but it happens that what I did looks good on Windows, Linux and Mac OS X, so...

    Otherwise, the theme does draw one pixel lines (or frames rather). This is, in fact, the reason I decided to do the same for my derived widget.

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

    Default Re: Retrieve the colours used by Qt to render a frame of StyledPanel shape

    Quote Originally Posted by agarny View Post
    I agree with your statement in general, but it happens that what I did looks good on Windows, Linux and Mac OS X, so...
    On your Windows, your Linux, your MacOS X configurations.

    If that's fine with you then ok just bear in mind people have different configurations of their systems and something that looks good on your system doesn't have to look good on mine.
    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.


  6. #6
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Retrieve the colours used by Qt to render a frame of StyledPanel shape

    Quote Originally Posted by wysota View Post
    On your Windows, your Linux, your MacOS X configurations.

    If that's fine with you then ok just bear in mind people have different configurations of their systems and something that looks good on your system doesn't have to look good on mine.
    Very true and this is why I am ready to revert things, if ever needed.

Similar Threads

  1. QGLWidget render or QGraphicsView with GL viewport render
    By QTInfinity in forum Qt Programming
    Replies: 2
    Last Post: 28th November 2011, 11:34
  2. Replies: 1
    Last Post: 13th March 2008, 07:19
  3. Change the shape of a frame.
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 13th November 2007, 06:40
  4. QLabel colours
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 14th May 2007, 16:46

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.