PDA

View Full Version : Set visible for QProgressBar



maratk1n
1st November 2017, 17:43
Hello.
On the main window there is a progress bar that I want to change from another class A that works in a different thread.
I can change the value using the signals and slots that are configured inside class A (there is a public slot setValue(int)), but how do I change the visibility of the bar progress from another thread?

connect(this, SIGNAL(progressBarValue(int)), ui_progressBar, SLOT(setValue(int))); //work
connect(this, SIGNAL(setWidgetColor(QString)), ui_infoWidget, SLOT(setStyleSheet(QString))); //work
connect(this, SIGNAL(progressBarVisible(bool)), ui_progressBar, SLOT(setVisible(bool))); //don't work

Ginsengelf
2nd November 2017, 09:28
Hi, this should work. Are you sure that progressBarVisible() is emitted?

Ginsengelf

maratk1n
2nd November 2017, 18:46
Hi, this should work. Are you sure that progressBarVisible() is emitted?

Ginsengelf

I'm stupid, I'm sorry ... The code works. Thanks!