-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmainwidget.cpp
41 lines (37 loc) · 990 Bytes
/
mainwidget.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
/**
* 自定义按钮弹出窗口控件
*
* mainwidget.cpp
* 测试主窗体。
*
* FlyWM_
* GitHub: https://github.com/FlyWM
* CSDN: https://blog.csdn.net/a844651990
*
*/
#include "mainwidget.h"
#include "ui_mainwidget.h"
#include "popupwidgetbutton.h"
#include "testpopupwidget.h"
#include <QMoveEvent>
#include <QDebug>
MainWidget::MainWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::MainWidget)
{
ui->setupUi(this);
PopupWidgetButton *pBtn = new PopupWidgetButton(PWB::Vertical, this, this);
pBtn->move(100, 250);
TestPopupWidget *pWidget = new TestPopupWidget(this);
pBtn->setMainWidget(pWidget);
pBtn->button()->setText("Vertical");
PopupWidgetButton *pBtn1 = new PopupWidgetButton(PWB::Horizontal, this, this);
pBtn1->move(180, 250);
TestPopupWidget *pWidget1 = new TestPopupWidget(this);
pBtn1->setMainWidget(pWidget1);
pBtn1->button()->setText("Horizontal");
}
MainWidget::~MainWidget()
{
delete ui;
}