资源简介
DropDataControl.rar
代码片段和文件信息
#include “stdafx.h“
#include “DrawDateTime.h“
#include “CalendarWidget.h“
namespace
{
QString dataDescribe(unsigned short year unsigned short month)
{
QString result;
result.append(QString::number(year));
result.append(QStringLiteral(“year“));
if (month < 10)
{
result.append(QStringLiteral(“0“));
result.append(QString::number(month));
}
else
{
result.append(QString::number(month));
}
result.append(QStringLiteral(“month“));
return result;
}
}
struct CalendarWidgetPrivate
{
unsigned short m_wYear = 2016;
unsigned short m_wMonth = 11;
unsigned short m_wDay = 14;
QPushButton * m_pPrevisou = nullptr;
QLabel * m_pMonth = nullptr;
QPushButton * m_pNext = nullptr;
DrawDateTime * m_pDataView = nullptr;
};
CalendarWidget::CalendarWidget(QWidget * parent)
: QWidget(parent)
d_ptr(new CalendarWidgetPrivate)
{
InitializeUI();
}
CalendarWidget::~CalendarWidget()
{
}
void CalendarWidget::InitializeUI()
{
QVBoxLayout * mainLayout = new QVBoxLayout;
mainLayout->setSpacing(0);
mainLayout->setMargin(0);
QHBoxLayout * titleLayout = new QHBoxLayout;
d_ptr->m_pPrevisou = new QPushButton;
d_ptr->m_pMonth = new QLabel;
d_ptr->m_pNext = new QPushButton;
titleLayout->setSpacing(0);
titleLayout->setMargin(0);
d_ptr->m_pPrevisou->setText(QStringLiteral(“previous“));
d_ptr->m_pMonth->setText(dataDescribe(d_ptr->m_wYear d_ptr->m_wMonth));
d_ptr->m_pNext->setText(QStringLiteral(“next“));
titleLayout->addWidget(d_ptr->m_pPrevisou);
titleLayout->addWidget(d_ptr->m_pMonth);
titleLayout->addWidget(d_ptr->m_pNext);
mainLayout->addLayout(titleLayout);
d_ptr->m_pDataView = new DrawDateTime;
connect(d_ptr->m_pDataView &DrawDateTime::DataClicked this [this](unsigned short year unsigned short month unsigned short day){
emit DataClicked(year month day);
d_ptr->m_pMonth->setText(dataDescribe(year month));
// setHidden(true);
});
connect(d_ptr->m_pPrevisou &QPushButton::clicked this [this]{
d_ptr->m_pDataView->PreviousMonth();
d_ptr->m_pDataView->GetDate(d_ptr->m_wYear d_ptr->m_wMonth d_ptr->m_wDay);
d_ptr->m_pMonth->setText(dataDescribe(d_ptr->m_wYear d_ptr->m_wMonth));
});
connect(d_ptr->m_pNext &QPushButton::clicked this [this]{
d_ptr->m_pDataView->NextMonth();
d_ptr->m_pDataView->GetDate(d_ptr->m_wYear d_ptr->m_wMonth d_ptr->m_wDay);
d_ptr->m_pMonth->setText(dataDescribe(d_ptr->m_wYear d_ptr->m_wMonth));
});
d_ptr->m_pDataView->SetDate(d_ptr->m_wYear d_ptr->m_wMonth d_ptr->m_wDay);
mainLayout->addWidget(d_ptr->m_pDataView);
setLayout(mainLayout);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2699 2017-12-04 17:11 DropDataControl\CalendarWidget.cpp
文件 464 2016-11-14 17:49 DropDataControl\CalendarWidget.h
文件 10652 2016-11-14 20:12 DropDataControl\DrawDateTime.cpp
文件 1013 2016-11-14 18:20 DropDataControl\DrawDateTime.h
文件 2258 2016-11-14 18:41 DropDataControl\DropDataControl.cpp
文件 425 2016-11-14 17:38 DropDataControl\DropDataControl.h
文件 592 2017-12-04 17:10 DropDataControl\DropDataControl.pro
文件 23531 2017-12-04 17:10 DropDataControl\DropDataControl.pro.user
文件 218 2016-11-14 17:25 DropDataControl\main.cpp
目录 0 2017-12-04 17:13 DropDataControl
----------- --------- ---------- ----- ----
41852 10
- 上一篇:20.rar
- 下一篇:samp2_3.rar
相关资源
- samp2_3.rar
- 20.rar
- monihid.c
- sound.properties
- iso.txt
- MaskWindow.zip
- VS2010中文旗舰版(破解版).txt
- probability-sheldon-ross-solution-manual.pdf
- sc.zip
- cn4020026_2422865.zip
- cklover1_10516440.zip
- CorelProductsKeyGen20180618全家桶注册机.
- 编译原理.rar
- 题库脚本.xls
- waidps-master.zip
- QQ消息轰炸机Delphi版,听说效果很好
- elk百度云地址.txt
- GetAlibaba_Setup.rar
- Editor-1.5.4.rar
- y8l7mn.xls
- AdobeAcrobat破解方法.txt
- 最完整的图书管理系统的设计与实现
- whoawho.DDZ.tools.rar
- chensixiao_1952246.zip
- pwd.txt
- 32854数据库系统概论前七章习题解析
- SolutionManualforIntroductiontoLinearAlgebra5t
- Devexpress18.2.7Crack.zip
- 在ROS中与其他器件使用十六进制串口
- Ftp.zip
评论
共有 条评论