Now try changing your application to a different style... Especially try the WindowsXP style.
give me a hint, please!![]()
Qt Code:
To copy to clipboard, switch view to plain text mode
Walsi, which OS were you using ??
I was using the same code to change the color of the button...
setPalette(QPalette(QColor(m_color)));
but i was using the button as Flat, and hence the color showed properly. I removed the flat property and it doesnt draw color on the button... i tried various roles like QPalette::Button , etc to change the color, but still no help
Is it bec as Jpn suggested that native themes cause some effects not to have the desired effect ??
Did u try it on windows ??
What do you mean???
Compiling this SourceCode on Windows?
No I didn't try that.
Best Regards
If your code is meant to run on Windows too then I suggest you do that now and run it under WinXP.
My code isn't suggested to run under WXP .... net yet??
Will there be much problems with colored buttons on WXP?
Just try it and you're see for yourself. If you ever plan to run the application on Windows or MacOSX, I suggest you check out the "red button issue" on all platforms![]()
Okay,...
I will!
Now, if the push button is previously set as flat, marcel's way is not working. How to change a background color of flat push button?
Qt 5.3 Opensource & Creator 3.1.2
I won't read the whole thread again, but I'm sure the proper answer is "use stylesheets".
Bookmarks