1 #include "dialog.h"
2 #include "ui_dialog.h"
3 #include <QDebug>
4
5 Dialog::Dialog(QWidget *parent) :
6 QDialog(parent),
7 ui(new Ui::Dialog)
8 {
9 ui->setupUi(this);
10 }
11
12 Dialog::~Dialog()
13 {
14 delete ui;
15 }
16
17 void Dialog::moveEvent(QMoveEvent *event)
18 {
19 qDebug() << "1234"<<endl;
20 show1();
21 }
22
23 void Dialog::resizeEvent(QResizeEvent *event)
24 {
25 qDebug() << "1234"<<endl;
26 show1();
27 }
28
29 void Dialog::show1()
30 {
31 QString infoall;
32 QString x;
33 x.sprintf("x()=%d",this->x());
34 infoall = infoall +x + "
";
35
36 QString y;
37 y.sprintf("y()=%d",this->y());
38 infoall = infoall +y + "
";
39
40 QString width;
41 width.sprintf("width=%d",this->width());
42 infoall = infoall +width + "
";
43
44 QString height;
45 height.sprintf("height=%d",this->height());
46 infoall = infoall +height + "
";
47 ui->textEdit->setText(infoall);
48 }