PDA

View Full Version : style sheets



TheKedge
29th March 2007, 15:41
hello all,
what's wrong here .. ?


btnOnOff = new QPushButton("start/stop");
btnOnOff->setCheckable(true);
qApp->setStyleSheet("#btnOnOff{color:green}");//this has no effect
qApp->setStyleSheet("QPushButton{color:green}");//this colours all QPushButtons (as excpected


I may have missed something silly. Why is the first setStyleSheet() ignored? Do I have to tell sombody about the name 'btnOnOff?

thanks
K

wysota
29th March 2007, 16:14
Sure you do.

btnOnOff->setObjectName("btnOnOff");