-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
55 lines (41 loc) · 1.42 KB
/
main.cpp
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "mainwindow.h"
#include <QApplication>
#include <QSpinBox>
#include <QSlider>
#include <QHBoxLayout>
void msgBoxInit();
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
// test for new git 03.19;
//test again
//change;
// QWidget window;
// window.setWindowTitle("Enter your age");
// QSpinBox *spinBox = new QSpinBox(&window);
// QSlider *slider = new QSlider(Qt::Horizontal, &window);
// spinBox->setRange(0, 130);
// slider->setRange(0, 130);
// QObject::connect(slider, &QSlider::valueChanged, spinBox, &QSpinBox::setValue);
// void (QSpinBox:: *spinBoxSignal)(int) = &QSpinBox::valueChanged; //QSpinBox::valueChanged 有两种函数int,string,需要强制制定为int。
// QObject::connect(spinBox, spinBoxSignal, slider, &QSlider::setValue);
// spinBox->setValue(35);
// QHBoxLayout *layout = new QHBoxLayout;
// layout->addWidget(spinBox);
// layout->addWidget(slider);
// window.setLayout(layout);
// window.show();
w.show();
Newspaper newspaper("Newspaper A");
Reader reader;
QObject::connect(&newspaper, &Newspaper::newPaper,
&reader, &Reader::receiveNewspaper);
newspaper.send();
EventLabel *label = new EventLabel;
label->setWindowTitle("MouseEvent Demo");
label->resize(300, 200);
label->setMouseTracking(true);
label->show();
return a.exec();
}