37 lines
772 B
C++
37 lines
772 B
C++
![]() |
#include "date.h"
|
||
|
#include "ui_date.h"
|
||
|
|
||
|
date::date(QWidget *parent)
|
||
|
: QDialog(parent)
|
||
|
, ui(new Ui::date)
|
||
|
{
|
||
|
ui->setupUi(this);
|
||
|
this->setWindowFlags(Qt::FramelessWindowHint); // 隐藏标题栏
|
||
|
this->setFixedSize(400,300);
|
||
|
}
|
||
|
|
||
|
date::~date()
|
||
|
{
|
||
|
delete ui;
|
||
|
}
|
||
|
|
||
|
void date::on_calendarWidget_selectionChanged()
|
||
|
{
|
||
|
// QDate dt=ui->calendarWidget->selectedDate(); //读取选择的日期时间
|
||
|
// QString str=dt.toString("yyyy-MM-dd");//转换为字符串
|
||
|
|
||
|
// emit kaishi(str);
|
||
|
// this->close();
|
||
|
}
|
||
|
|
||
|
|
||
|
void date::on_calendarWidget_clicked(const QDate &date)
|
||
|
{
|
||
|
QDate dt=ui->calendarWidget->selectedDate(); //读取选择的日期时间
|
||
|
QString str=dt.toString("yyyy-MM-dd");//转换为字符串
|
||
|
|
||
|
emit kaishi(str);
|
||
|
this->close();
|
||
|
}
|
||
|
|