Background Color from Stylesheet?



  • Is it possible to get the background color of a widget that was set using a stylesheet; aside from storing a variable or parsing the stylesheet? I'm trying to get the color from the palette of the widget but it looks like it's returning the default background color (grey).


  • Qt Champions 2017

    Hi
    As far as i know, you cannot.
    I assumed that i could get via the QStyleOption struct or
    the palette() but none of my test gave the correct value.
    I could have missed something though :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.