Lost My Qt Widgets StyleSheets
Solved
General and Desktop
-
@Ketan__Patel__0011 Then you will need to show what you are doing with stylesheets
-
I am just changing my buttons or other controls stylesheet based of some condition..
likeif(IS_ Button_1_Clicked == true) { ui->pushbutton_1->setStyleSheet(MY_FIRST_STYLE); } else { ui->pushbutton_1->setStyleSheet(MY_SECOND_STYLE); }
-
Hi
Are you trying to update the stylesheets?Normally for dynamic properties in stylesheet one can do
widget->style()->unpolish(widget); widget->style()->polish(widget); QEvent event(QEvent::StyleChange); QApplication::sendEvent(widget, &event); widget->update(); widget->updateGeometry();
Im not sure its what's wrong in your case.
Is the stylesheet inline strings or do you load them from file? -
K Ketan__Patel__0011 has marked this topic as solved on
-
@Ketan__Patel__0011 : how you find out where is the issue? any debug strategy you used, that would be helpful.
-
@Hardy91 Simply don't modify ui elements from outside the main (ui) thread...