How I Can change text on the button
-
wrote on 10 Jul 2014, 17:03 last edited by
I have function
@void RepeatQuestion@
and when i want to change the text on the button, that don't work. I tried
@Ui_MainWindow.pushButton->SetText("")@ @Ui_MainWindow->pushButton->SetText("")@ @Ui::MainWindow.pushButton->SetText("")@
and
@Ui::MAinWindow->pushButton->SetText("")@ -
wrote on 10 Jul 2014, 17:23 last edited by
Could you post MainWindow declaration.
If you use MainWindow that was created by QtCreator wizard then
@
ui->pushButton->setText("Hello");
@ -
wrote on 10 Jul 2014, 17:25 last edited by
When i write @ ui->@ i see "ui is not declarate"
-
wrote on 10 Jul 2014, 17:59 last edited by
Could you post MainWindow declaration.
-
wrote on 10 Jul 2014, 18:04 last edited by
-
wrote on 10 Jul 2014, 18:13 last edited by
There is no MainWindoww include in the source file.
@
#include "MainWindoww.h"
@ -
wrote on 10 Jul 2014, 18:17 last edited by
-
wrote on 10 Jul 2014, 18:48 last edited by
void ReWriteQuestion(string files) is not a part of MainWindoww.
That is why you are getting "ui is not declared".Add it to the MainWindoww declaration and change the definition accordingly.
-
wrote on 10 Jul 2014, 19:09 last edited by
How :( ?
-
wrote on 10 Jul 2014, 19:54 last edited by
@
class MainWindoww : public ......
{
.....
void ReWriteQuestion(string files)
.....
};
@@
void MainWindoww::ReWriteQuestion(string files)
{
......
ui->pushButton->setText("C++ rocks");
......
}
@ -
wrote on 11 Jul 2014, 09:33 last edited by
Thank You, mean :)
2/11