Hallo,
ich möchte eine gui mit qt und C++ erstellen. Allerdings habe ich ein
Problem mit dem textBrowser.
1 | #include "firstqt.h"
|
2 |
|
3 | FirstQt::FirstQt(QWidget *parent)
|
4 | : QMainWindow(parent)
|
5 | {
|
6 | ui.setupUi(this);
|
7 | connect(ui.ExitBtn, &QPushButton::clicked, [this] { exitWindow(); } );
|
8 | connect(ui.UpdateBtn, &QPushButton::clicked, [this] { updateTime(); } );
|
9 | state = 0;
|
10 |
|
11 | }
|
12 |
|
13 | FirstQt::~FirstQt()
|
14 | {
|
15 |
|
16 | }
|
17 |
|
18 | void FirstQt::exitWindow()
|
19 | {
|
20 | close();
|
21 | }
|
22 |
|
23 | void FirstQt::updateTime()
|
24 | {
|
25 | ui.textBrowser.setText("Hallo");
|
26 | }
|
Beim Compilieren bekomme ich den Error:
error c2228 left of '.setText' must have class/struct/union
also Ist das ein Problem von textBrowser. Aber wie bekomme ich das
richtig hin?
Frank