Hi all,
I change the background color of my QPushButtons dynamically using Style Sheets:
#ifdef Q_OS_WIN
button
->setStyleSheet
( QString("background-color: %1;" "border: 2px solid #8f8f91; "
"border-radius: 6px;"
"min-width: 80px;" ).arg( color.name() ) );
#endif
button->setPalette(QPalette(color));
#ifdef Q_OS_WIN
button->setStyleSheet( QString("background-color: %1;"
"border: 2px solid #8f8f91; "
"border-radius: 6px;"
"min-width: 80px;" ).arg( color.name() ) );
#endif
To copy to clipboard, switch view to plain text mode
If I want to use the same approach to get another color for the pressed-state of a button, what is the right syntax to achieve it (and without having an extra text file mybutton.css)?
Greets,
Weilor
Bookmarks