当前位置: 首页 > news >正文

百度收录入口在哪里网站优化与seo

百度收录入口在哪里,网站优化与seo,做设计的网站有哪些,公司网站 数据库基本说明 QCalendarWidget介绍: QCalendarWidget 是 Qt 框架中提供的一个日期选择控件,用户可以通过该控件快速选择需要的日期,并且支持显示当前月份的日历。 这里,我们继承了QCalendarWidget,做了一些简单封装和样式调整 1.使用的IDE&…

基本说明

QCalendarWidget介绍:
QCalendarWidget 是 Qt 框架中提供的一个日期选择控件,用户可以通过该控件快速选择需要的日期,并且支持显示当前月份的日历。
这里,我们继承了QCalendarWidget,做了一些简单封装和样式调整

1.使用的IDE: QtCreator;
2.qt 版本:Desktop Qt 5.15.2 MSVC2015 64bit
3.效果图:
在这里插入图片描述

代码

TCalendarWidget.h

#ifndef TCALENDARWIDGET_H
#define TCALENDARWIDGET_H#include <QCalendarWidget>class QPushButton;
class QLabel;class TCalendarWidget : public QCalendarWidget
{Q_OBJECTpublic:TCalendarWidget(QWidget *parent = 0);~TCalendarWidget();void SetHighlightDate(QList<QDate> lstDate);private:void InitControl();void InitTopWidget();void SetDataLabelTimeText(int year, int month);signals:void SignalSetCalendarTime(const QDate& data);private slots:void SlotBtnClicked();protected:void paintCell(QPainter *painter, const QRect &rect, const QDate &date) const;private:QPushButton     *m_pBtnLeftYear;QPushButton     *m_pBtnLeftMonth;QPushButton     *m_pBtnRightYear;QPushButton     *m_pBtnRightMonth;QLabel          *m_pLblDate;QList<QDate>     m_lstHighlightDate;
};#endif //_T_PROPERTY_H_

TCalendarWidget.cpp

#pragma execution_character_set("utf-8")
#include "TCalendarWidget.h"#include <QLocale> 
#include <QPainter>
#include <QTextCharFormat>
#include <QProxyStyle>
#include <QTableView>
#include <QLayout>
#include <QPushButton>
#include <QLabel>class QCustomStyle : public QProxyStyle
{
public:QCustomStyle(QWidget *parent) {setParent(parent);};private:void drawPrimitive(PrimitiveElement element, const QStyleOption *option,QPainter *painter, const QWidget *widget) const{if (element == PE_FrameFocusRect){return;}QProxyStyle::drawPrimitive(element, option, painter, widget);}
};TCalendarWidget::TCalendarWidget(QWidget *parent): QCalendarWidget(parent)
{InitControl();
}TCalendarWidget::~TCalendarWidget()
{}void TCalendarWidget::SetHighlightDate(QList<QDate> lstDate)
{m_lstHighlightDate = lstDate;updateCells();
}void TCalendarWidget::InitControl()
{layout()->setSizeConstraint(QLayout::SetFixedSize);setLocale(QLocale(QLocale::Chinese));setNavigationBarVisible(false);setVerticalHeaderFormat(QCalendarWidget::NoVerticalHeader);setHorizontalHeaderFormat(QCalendarWidget::SingleLetterDayNames);setStyle(new QCustomStyle(this));QTextCharFormat format;format.setForeground(QColor("#FFFFFF"));format.setBackground(QColor(27, 33, 43));setHeaderTextFormat(format);setWeekdayTextFormat(Qt::Saturday, format);setWeekdayTextFormat(Qt::Sunday, format);setWeekdayTextFormat(Qt::Monday, format);setWeekdayTextFormat(Qt::Tuesday, format);setWeekdayTextFormat(Qt::Wednesday, format);setWeekdayTextFormat(Qt::Thursday, format);setWeekdayTextFormat(Qt::Friday, format);InitTopWidget();connect(this, &QCalendarWidget::currentPageChanged, [this](int year, int month) {SetDataLabelTimeText(year, month);});
}void TCalendarWidget::paintCell(QPainter *painter, const QRect &rect, const QDate &date) const
{bool bHightlight = false;foreach (QDate date1,m_lstHighlightDate){if (date1 == date){bHightlight = true;}}if (date == selectedDate()){painter->save();painter->setRenderHint(QPainter::Antialiasing);painter->setPen(QColor("#1B212B"));painter->setBrush(QColor("#1B212B"));painter->drawRect(rect);painter->setPen(QColor("#2678D5"));painter->setBrush(QColor("#264974"));painter->drawRoundedRect(rect.x() + 6, rect.y() + 2, 24, 24, 2, 2);painter->setPen(bHightlight?QColor("#2678D5"): QColor("#FFFFFF"));painter->drawText(rect, Qt::AlignCenter, QString::number(date.day()));painter->restore();}else if (date == QDate::currentDate()){painter->save();painter->setRenderHint(QPainter::Antialiasing);painter->setPen(QColor("#1B212B"));painter->setBrush(QColor("#1B212B"));painter->drawRect(rect);painter->setPen(QColor("#2678D5"));painter->setBrush(Qt::NoBrush);painter->drawRoundedRect(rect.x()+6, rect.y()+2, rect.width()-12, rect.height()-4, 2, 2);painter->setPen(bHightlight ? QColor("#2678D5") : QColor("#FFFFFF"));painter->drawText(rect, Qt::AlignCenter, QString::number(date.day()));painter->restore();}else if (date < minimumDate() || date > maximumDate()){painter->save();painter->setRenderHint(QPainter::Antialiasing);painter->setPen(Qt::NoPen);painter->setBrush(QColor(249, 249, 249));painter->drawRect(rect.x(), rect.y() + 3, rect.width(), rect.height() - 6);painter->setPen(QColor("#3D4E5E"));painter->drawText(rect, Qt::AlignCenter, QString::number(date.day()));painter->restore();}else{painter->save();painter->setRenderHint(QPainter::Antialiasing);painter->setPen(QColor("#1B212B"));painter->setBrush(QColor("#1B212B"));painter->drawRect(rect);painter->setPen(bHightlight ? QColor("#2678D5") : QColor("#FFFFFF"));painter->drawText(rect, Qt::AlignCenter, QString::number(date.day()));painter->restore();}
}void TCalendarWidget::InitTopWidget()
{QWidget* pTopWidget = new QWidget(this);pTopWidget->setObjectName("CalendarTopWidget");pTopWidget->setFixedHeight(36);pTopWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);QHBoxLayout* pHBoxLayout = new QHBoxLayout;pHBoxLayout->setContentsMargins(20, 0, 20, 0);pHBoxLayout->setSpacing(10);m_pBtnLeftYear = new QPushButton(this);m_pBtnRightYear = new QPushButton(this);m_pBtnLeftMonth = new QPushButton(this);m_pBtnRightMonth = new QPushButton(this);m_pLblDate = new QLabel(this);m_pBtnLeftYear->setObjectName("CalendarLeftYearBtn");m_pBtnRightYear->setObjectName("CalendarRightYearBtn");m_pBtnLeftMonth->setObjectName("CalendarLeftMonthBtn");m_pBtnRightMonth->setObjectName("CalendarRightMonthBtn");m_pLblDate->setObjectName("CommonTextWhite14");pHBoxLayout->addWidget(m_pBtnLeftYear);pHBoxLayout->addWidget(m_pBtnLeftMonth);pHBoxLayout->addStretch();pHBoxLayout->addWidget(m_pLblDate);pHBoxLayout->addStretch();pHBoxLayout->addWidget(m_pBtnRightMonth);pHBoxLayout->addWidget(m_pBtnRightYear);pTopWidget->setLayout(pHBoxLayout);QVBoxLayout *vBodyLayout = qobject_cast<QVBoxLayout *>(layout());vBodyLayout->insertWidget(0, pTopWidget);connect(m_pBtnLeftYear, SIGNAL(clicked()), this, SLOT(SlotBtnClicked()));connect(m_pBtnLeftMonth, SIGNAL(clicked()), this, SLOT(SlotBtnClicked()));connect(m_pBtnRightYear, SIGNAL(clicked()), this, SLOT(SlotBtnClicked()));connect(m_pBtnRightMonth, SIGNAL(clicked()), this, SLOT(SlotBtnClicked()));SetDataLabelTimeText(selectedDate().year(), selectedDate().month());
}void TCalendarWidget::SetDataLabelTimeText(int year, int month)
{m_pLblDate->setText(QString("%1年%2月").arg(year).arg(month));
}void TCalendarWidget::SlotBtnClicked()
{QPushButton *senderBtn = qobject_cast<QPushButton *>(sender());if (senderBtn == m_pBtnLeftYear){showPreviousYear();}else if (senderBtn == m_pBtnLeftMonth){showPreviousMonth();}else if (senderBtn == m_pBtnRightYear){showNextYear();}else if (senderBtn == m_pBtnRightMonth){showNextMonth();}
}

样式:

在这里插入图片描述

QString Dialog::GetQss()
{QString str = " QPushButton{font-family: \"Microsoft YaHei\";border:none;background:transparent;}\\QWidget#CalendarTopWidget \{ \background: #1B212B; \border:none; \border-bottom: 1px solid #45596B; \} \\QPushButton#CalendarLeftYearBtn \{ \max-height:16px; \min-height:16px; \max-width:16px; \min-width:16px; \image: url(STYLESHEET_PIC_PATH/common/year_last_nor.png); \} \\QPushButton#CalendarLeftYearBtn:hover \{ \image: url(STYLESHEET_PIC_PATH/common/year_last_down.png); \} \\\QPushButton#CalendarRightYearBtn \{ \max-height:16px; \min-height:16px; \max-width:16px; \min-width:16px; \image: url(STYLESHEET_PIC_PATH/common/year_next_nor.png); \} \\QPushButton#CalendarRightYearBtn:hover \{ \image: url(STYLESHEET_PIC_PATH/common/year_next_down.png); \} \\QPushButton#CalendarLeftMonthBtn \{ \max-height:16px; \min-height:16px; \max-width:16px; \min-width:16px; \image: url(STYLESHEET_PIC_PATH/common/month_last_nor.png); \} \\QPushButton#CalendarLeftMonthBtn:hover \{ \image: url(STYLESHEET_PIC_PATH/common/month_last_down.png); \} \\QPushButton#CalendarRightMonthBtn \{ \max-height:16px; \min-height:16px; \max-width:16px; \min-width:16px; \image: url(STYLESHEET_PIC_PATH/common/month_next_nor.png); \} \\QPushButton#CalendarRightMonthBtn:hover \{ \image: url(STYLESHEET_PIC_PATH/common/month_next_down.png); \} \QLabel#CommonTextWhite14 \{ \color: #ffffff; \font-size: 14px; \} \";str.replace("STYLESHEET_PIC_PATH/common/", "://res/");return str;
}

图片资源

图片下载

调用代码

Dialog::Dialog(QWidget *parent): QDialog(parent), ui(new Ui::Dialog)
{ui->setupUi(this);setWindowTitle(tr("Calendar Widget"));setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);// 样式 1setStyleSheet(GetQss());m_pCalender = new TCalendarWidget(this);QHBoxLayout* pMainLayout = new QHBoxLayout(this);pMainLayout->setMargin(0);pMainLayout->addWidget(m_pCalender);
}

文章转载自:
http://jubilation.rdgb.cn
http://baculum.rdgb.cn
http://agnatic.rdgb.cn
http://catfoot.rdgb.cn
http://inseminate.rdgb.cn
http://footslog.rdgb.cn
http://heeze.rdgb.cn
http://grainfield.rdgb.cn
http://wisha.rdgb.cn
http://flask.rdgb.cn
http://fulminous.rdgb.cn
http://vicinage.rdgb.cn
http://goth.rdgb.cn
http://frugivore.rdgb.cn
http://snowslip.rdgb.cn
http://knout.rdgb.cn
http://jessie.rdgb.cn
http://scripsit.rdgb.cn
http://acetylco.rdgb.cn
http://bahamas.rdgb.cn
http://confines.rdgb.cn
http://histomap.rdgb.cn
http://exorcise.rdgb.cn
http://swanherd.rdgb.cn
http://television.rdgb.cn
http://peduncle.rdgb.cn
http://nota.rdgb.cn
http://nitride.rdgb.cn
http://runed.rdgb.cn
http://skinch.rdgb.cn
http://shadowless.rdgb.cn
http://eez.rdgb.cn
http://rabbitbrush.rdgb.cn
http://levogyrate.rdgb.cn
http://marinescape.rdgb.cn
http://middorsal.rdgb.cn
http://analyst.rdgb.cn
http://undirected.rdgb.cn
http://retaliation.rdgb.cn
http://uintahite.rdgb.cn
http://distensile.rdgb.cn
http://outlet.rdgb.cn
http://especial.rdgb.cn
http://theorize.rdgb.cn
http://fullface.rdgb.cn
http://fuzzbuzz.rdgb.cn
http://phantasmatic.rdgb.cn
http://spalato.rdgb.cn
http://pantoscopic.rdgb.cn
http://bootee.rdgb.cn
http://synoptical.rdgb.cn
http://keelhaul.rdgb.cn
http://outer.rdgb.cn
http://porrect.rdgb.cn
http://mesocolon.rdgb.cn
http://moollah.rdgb.cn
http://tugboat.rdgb.cn
http://pathogenic.rdgb.cn
http://accidently.rdgb.cn
http://crossbred.rdgb.cn
http://velskoen.rdgb.cn
http://blatant.rdgb.cn
http://tramcar.rdgb.cn
http://subjacent.rdgb.cn
http://tarawa.rdgb.cn
http://serration.rdgb.cn
http://amain.rdgb.cn
http://calx.rdgb.cn
http://straw.rdgb.cn
http://adios.rdgb.cn
http://beadle.rdgb.cn
http://impulse.rdgb.cn
http://thusness.rdgb.cn
http://dirigisme.rdgb.cn
http://macle.rdgb.cn
http://meghalaya.rdgb.cn
http://procrastinate.rdgb.cn
http://lei.rdgb.cn
http://faded.rdgb.cn
http://quinin.rdgb.cn
http://endorsee.rdgb.cn
http://alkylation.rdgb.cn
http://ghetto.rdgb.cn
http://nonmember.rdgb.cn
http://precautionary.rdgb.cn
http://orthopsychiatry.rdgb.cn
http://outdid.rdgb.cn
http://symphonious.rdgb.cn
http://basophilous.rdgb.cn
http://complementary.rdgb.cn
http://certify.rdgb.cn
http://flannelette.rdgb.cn
http://spondylitis.rdgb.cn
http://cerebellum.rdgb.cn
http://vanquish.rdgb.cn
http://lumbago.rdgb.cn
http://emulsion.rdgb.cn
http://tame.rdgb.cn
http://videography.rdgb.cn
http://solarimeter.rdgb.cn
http://www.hrbkazy.com/news/64279.html

相关文章:

  • 天河区发布seo外包品牌
  • 北京 个人网站 备案吉林网络推广公司
  • 上海文化传媒公司排名快推达seo
  • 成都哪家做网站的最好某网站搜索引擎优化
  • 品牌企业网站建设seo优化需要多少钱
  • 企业网站建设公司选择分析seo优化轻松seo优化排名
  • wordpress网站自动伪原创中国万网域名注册服务内容
  • 政务网站的建设国内seo公司
  • 石家庄做网站建设的公司排名百度搜索风云榜游戏
  • 2017设计工作室做网站免费com域名注册网站
  • 股票网站怎么做动态表格查域名注册详细信息查询
  • 网站设置会员湖南正规关键词优化首选
  • 政务网站建设经验做法免费收录软文网站
  • 开一家网站建设公司要多少钱网页设计制作网站图片
  • 文本文档做网站怎么加图片百度竞价点击软件
  • 百度网站提交亚马逊市场营销案例分析
  • 做网站ps文字有锯齿网络销售每天做什么
  • 教育网站制作费用seo综合查询怎么用
  • 幼儿园主题墙图片有实力的网站排名优化软件
  • 做网站有2个前提条件 一个是网站漂亮的网页设计
  • 站长工具5118app开发公司排行榜
  • 陌上香坊是做盗版的网站吗在线培训
  • 汉南网站建设window优化大师
  • 一个网站如何做推广方案设计新手怎么入行sem
  • 李洋网络做网站苏州做网站的专业公司
  • 个人网站开发与设计摘要如何制作一个网页
  • 许昌网站制作公司搜索引擎营销与seo优化
  • wordpress 获取参数seo和sem的区别与联系
  • 婚庆公司网站源码设计网站的软件
  • 潍坊正规建设网站百度文库官网