value not updated on gui
i am updating a value on GUI in QT in single thread using below code
first time value updated on gui but later it is not updating on gui.
value is set on label correctly, checked using code Label[Index]->text().
but it is not updating on gui.
why it is not updating on GUI, please suggest me what i have to do.
Have you set parent to the label as this widget?
here you are updating widget if label has not set parent, update wont reflect to label.
yes i have set label as
Label[i] = new QLabel(this); but its not working
why it is not updating on GUI, please suggest me what i have to do
I would suggest to provide more information as with what you provided it is actually impossible to say why it behaves like this.
Where and when is this code executed? Are you sure it is executed second time at all?
Did you put another QLabel in Label[Index] after first call?
Show your code.
std::thread commandExecutor(TimeThread);// created thread for updating playback commandExecutor.detach();
Label is created in constructor only before this thread
//time is calculated here in qstring
@shashi-prasad As I wrote in another thread: do not update UI in other thread than main thread! This is not going to work! UI must be updated in the main thread.