Color and Icon
-
Have you really read the doc for the "QPalette":http://doc.qt.nokia.com/4.7/qpalette.html ?
@
QPushButton* p = ...QPalette pal = p->palette(); QColor myTextColor = Qt::red; QColor myButtonBackground = Qt::green; pal.setColor(QPalette::ButtonText, myTextColor); // set the text color of a button pal.setColor(QPalette::Button, myButtonBackground); // set the text color of a button p->setPalette(pal);
@
The roles are also described in the "documentation":http://doc.qt.nokia.com/4.7/qpalette.html#ColorRole-enum
For changing the button border 3-d effects, use
- QPalette::Light
- QPalette::Midlight
- QPalette::Dark
- QPalette::Mid
- QPalette::Shadow