-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestform.cpp
More file actions
33 lines (27 loc) · 811 Bytes
/
testform.cpp
File metadata and controls
33 lines (27 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "testform.hpp"
#include "header.hpp"
#include <QMessageBox>
TestForm::TestForm(QWidget *parent) : QWidget(parent)
{
setupUi(this);
object.child->childString.ReadBind(lineEdit, "text");
object.child->childString.ReadBind(label, "text");
object.child->childString.WriteBind(lineEdit, "text", &QLineEdit::textChanged);
}
void TestForm::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type())
{
case QEvent::LanguageChange: retranslateUi(this); break;
default: break;
}
}
void TestForm::on_pushButton_clicked()
{
QMessageBox::information(this, "Values should be the same", "UI: " + lineEdit->text() + "\n" + "Object: " + object.child->childString);
}
void TestForm::on_pushButton_2_clicked()
{
object.child->childString = "val";
}