-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathfrmselect.cpp
More file actions
60 lines (50 loc) · 1.66 KB
/
frmselect.cpp
File metadata and controls
60 lines (50 loc) · 1.66 KB
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
#if _MSC_VER >= 1600
#pragma execution_character_set("utf-8")
#endif
#include "frmselect.h"
#include "ui_frmselect.h"
#include "api/myhelper.h"
frmSelect::frmSelect(QWidget *parent) :
QDialog(parent),
ui(new Ui::frmSelect)
{
ui->setupUi(this);
this->InitStyle();
myHelper::FormInCenter(this);
}
frmSelect::~frmSelect()
{
delete ui;
}
void frmSelect::InitStyle()
{
this->setWindowTitle(ui->lab_Title->text());
this->setProperty("Form", true);
this->setProperty("CanMove", true);
this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint);
IconHelper::Instance()->SetIcoMain(ui->lab_Ico, App::FontSize + 2);
IconHelper::Instance()->SetIcoClose(ui->btnMenu_Close);
connect(ui->btnMenu_Close, SIGNAL(clicked()), this, SLOT(close()));
connect(ui->btnClose, SIGNAL(clicked()), this, SLOT(close()));
int width = 20;
#ifdef __arm__
width = 25;
#endif
QString qss = QString("QComboBox::drop-down,QDateEdit::drop-down,QTimeEdit::drop-down,QDateTimeEdit::drop-down{width:%1px;}").arg(width);
this->setStyleSheet(qss);
ui->dateStart->setDate(QDate::currentDate());
ui->dateEnd->setDate(QDate::currentDate().addDays(1));
ui->dateStart->calendarWidget()->setLocale(QLocale::Chinese);
ui->dateEnd->calendarWidget()->setLocale(QLocale::Chinese);
}
void frmSelect::on_btnOk_clicked()
{
if (ui->dateStart->dateTime() > ui->dateEnd->dateTime()) {
myHelper::ShowMessageBoxErrorX("开始时间不能大于结束时间!");
return;
}
this->selectStartDateTime = ui->dateStart->dateTime().toString("yyyy-MM-dd HH:mm:ss");
this->selectEndDateTime = ui->dateEnd->dateTime().toString("yyyy-MM-dd HH:mm:ss");
done(1);
this->close();
}