-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathchooseupgradedialog.cpp
63 lines (53 loc) · 1.91 KB
/
chooseupgradedialog.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
54
55
56
57
58
59
60
61
62
#include "chooseupgradedialog.h"
#include "ui_chooseupgradedialog.h"
#include "goopal.h"
#ifdef WIN32
#include "Windows.h"
#endif //zxlwin
ChooseUpgradeDialog::ChooseUpgradeDialog(QString name, QWidget *parent) :
QDialog(parent),
accountName(name),
ui(new Ui::ChooseUpgradeDialog)
{
ui->setupUi(this);
setWindowFlags(Qt::Popup);
ui->upgradeBtn->setStyleSheet("QPushButton{background-color:#ffffff;color:#7dd9df;border:1px solid rgb(239,239,239);border-radius:0px;}"
"QPushButton:hover{background-color:#7dd9df;color:#ffffff;border:0px solid rgb(64,153,255);border-radius:0px;}"
);
ui->applyDelegateBtn->setStyleSheet("QPushButton{background-color:#ffffff;color:#7dd9df;border:1px solid rgb(239,239,239);border-radius:0px;}"
"QPushButton:hover{background-color:#7dd9df;color:#ffffff;border:0px solid rgb(64,153,255);border-radius:0px;}"
);
}
ChooseUpgradeDialog::~ChooseUpgradeDialog()
{
delete ui;
}
bool ChooseUpgradeDialog::event(QEvent *event)
{
// class_ameneded 不能是custommenu的成员, 因为winidchange事件触发时, 类成员尚未初始化
static bool class_amended = false;
if (event->type() == QEvent::WinIdChange)
{
#ifdef WIN32
HWND hwnd = reinterpret_cast<HWND>(winId()); //zxlwin
if (class_amended == false)
{
class_amended = true;
DWORD class_style = ::GetClassLong(hwnd, GCL_STYLE);
class_style &= ~CS_DROPSHADOW;
::SetClassLong(hwnd, GCL_STYLE, class_style); // windows系统函数
}
#endif // WIN32
}
return QWidget::event(event);
}
void ChooseUpgradeDialog::on_upgradeBtn_clicked()
{
close();
emit upgrade(accountName);
}
void ChooseUpgradeDialog::on_applyDelegateBtn_clicked()
{
close();
emit applyDelegate(accountName);
}