Your code, my comments:
int i;
i = `MyNewValue` ; // << Will not compile. i is an int this is not. Backtick quotes are not valid in C++.
ui
->A_DP
->setText
(QString::number(i
)) // << Needs ; to compile. Sets A_DP's text
qDebug()<<"lable value : "<<ui->A_P->text(); // << Outputs the text of a different control
int i;
i = `MyNewValue` ; // << Will not compile. i is an int this is not. Backtick quotes are not valid in C++.
ui->A_DP->setText(QString::number(i)) // << Needs ; to compile. Sets A_DP's text
qDebug()<<"lable value : "<<ui->A_P->text(); // << Outputs the text of a different control
To copy to clipboard, switch view to plain text mode
As amleto says, if you are going to post code snippets make sure they are at least valid code... and the easiest way to do that is copy and paste from a compiling program.
note : SetText Call from QtConcurrent function
Accessing elements of the (typically private) GUI from a thread other than the main one, and doing so without synchronisation is a Bad Thing.
From the Threads and QObjects docs:
Although QObject is reentrant, the GUI classes, notably QWidget and all its subclasses, are not reentrant. They can only be used from the main thread.
Use signal/slot connection or rethink why you want to do this.
Bookmarks