I have a push button that I want to always look red even when I have done setChecked(true) to keep it depressed.
I have this:
m_fourButton
->setStyleSheet
(QString("QPushButton {background-color: red;} QPushButton:checked{background-color: red;} QPushButton:pressed {background-color: red;}"));
m_fourButton->setStyleSheet(QString("QPushButton {background-color: red;} QPushButton:checked{background-color: red;} QPushButton:pressed {background-color: red;}"));
To copy to clipboard, switch view to plain text mode
I also tried background:red.
I started with QPalellete which gives me the same results.
m_redPalette.
setColor(QPalette::Button, Qt
::red);
brush.setColor(Qt::red);
m_redPalette.
setBrush(QPalette::Window, brush
);
m_redPalette.setColor(QPalette::Button, Qt::red);
QBrush brush;
brush.setColor(Qt::red);
m_redPalette.setBrush(QPalette::Window, brush);
To copy to clipboard, switch view to plain text mode
and tried everything that Palette would let me for Color Roles.
The result is that it is red when it is not checked but only the border is red when it is checked (depressed). Is there anything else I can do to make the pressed button red?
I've attached a zip file with an image of the buttons (it wouldn't let me upload my .bmp file).
Thanks
Bookmarks