QPalette palette
= pushButton
->palette
();
QPushButton * pushButton = new QPushButton(....);
QPalette palette = pushButton->palette();
To copy to clipboard, switch view to plain text mode
For general background color use QPalette::Window or QPalette::Text
color.setAlpha(130);
palette.
setColor(QPalette::Text, color
);
pushButton->setPalette(palette);
QColor color = palette.color(QPalette::Window);
color.setAlpha(130);
palette.setColor(QPalette::Text, color);
pushButton->setPalette(palette);
To copy to clipboard, switch view to plain text mode
There is another way to setup using style sheet
QPushButton { color: rgba(0, 0, 0, 50%) }
To copy to clipboard, switch view to plain text mode
Bookmarks