Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
I have a simple question.
streetsoul last edited by
I have a simple question about qt programming.
I want to using the ui file for add component.
For example, add QLabel component by modify ui file.
But text of label is need change.
So I try code llike above...
QLabel *label1 = ui->label;
The result is crush.
Crush message is above...
"The program has unexpectedly finished.
The process was ended forcefully."
Can't I using this coding style??
hskoglund last edited by hskoglund
ui->setupUi(this)creates all the stuff in your window, like the
ui->labelyou're copying, so try to change the order of the statements to:
ui->setupUi(this); QLabel *label1 = ui->label; label1->setText("change text");