Lost My Qt Widgets StyleSheets
-
@Ketan__Patel__0011 said in Lost My Qt Widgets StyleSheets:
is it possible to run one or more function parallel in GUI thread ?
Of course not. But why do you want to do this? Simply do your heavy stuff in parallel threads and emit signals there if UI needs to do something. And in the UI thread you connect to these signal and do what needs to be done. This is how this is done properly...
-
@Ketan__Patel__0011 Can you explain exact problem you have now? The thread is a bit old already.
-
@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...