Open hezhongfeng opened 8 years ago
I tested the code above (for how far it's possible). I miss a lot of information.. When I create normal pushbutton/toolbutton and I apply your settings it simply works.
You tell me 'has no role'. Do you mean has no color?
Please supply with a complete example and more information about the environment. (Single main function just like sample supplied in QtAwesome)
@gamecreature thank your answer I don't how to show a screenshot so I will send you the project demo
'has no role' mean no color,just white
The issue does not occur on Mac OS X. It seems to be Windows specific
This is the screenshot that hezhongfeng has sent me...
This is how it looks on Mac OS X
Well after some debugging I found the following 'problem'.
On Windows the default QIcon::State of a QPushButton seems to be 'active' So the button gets the color of the option 'color-active'. (which defaults to be black)
So in your case, you can use:
vmapBlue.insert("color",QColor(Qt::blue));
vmapBlue.insert("color-active",QColor(Qt::blue));
Don't know why this is the case, it's a Qt issue or feature..
Read some more about this active state. The QPushButton is active if it has focus. Probably your button is the only button on the screen and has got the keyboard focus.
I set 3 colors for 3 widgets,but the pushbutton has no role I don't know why..........