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

政府网站建设存在问题香飘飘奶茶软文

政府网站建设存在问题,香飘飘奶茶软文,做荣誉证书的网站,logo素材设置一个闹钟,左侧窗口显示当前时间,右侧设置时间,以及控制闹钟的开关,下方显示闹钟响时的提示语。当按启动按钮时,设置时间与闹钟提示语均不可再改变。当点击停止时,关闭闹钟并重新启用设置时间与闹钟提示…

        设置一个闹钟,左侧窗口显示当前时间,右侧设置时间,以及控制闹钟的开关,下方显示闹钟响时的提示语。当按启动按钮时,设置时间与闹钟提示语均不可再改变。当点击停止时,关闭闹钟并重新启用设置时间与闹钟提示语。

闹钟窗口展示:

工程管理文件:

QT       += core gui texttospeechgreaterThan(QT_MAJOR_VERSION, 4): QT += widgetsCONFIG += c++11# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0SOURCES += \main.cpp \widget.cppHEADERS += \widget.hFORMS += \widget.ui# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += targetRESOURCES += \picture.qrc

头文件:

#ifndef WIDGET_H
#define WIDGET_H#include <QWidget>
#include <QDebug>
#include <QLabel>   //标签
#include <QTextEdit>    //文本编辑器
#include <QLineEdit>    //行编辑器
#include <QPushButton>  //按钮#include <QTimerEvent>  //事件处理函数
#include <QDateTime>
#include <QtTextToSpeech>    //播报员
#include <QPaintEvent>
#include <QPainter>QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACEclass Widget : public QWidget
{Q_OBJECTpublic slots://定义启动按钮的槽函数void on_btnStart_clicked();//定义停止按钮的槽函数void on_btnStop_clicked();public:Widget(QWidget *parent = nullptr);~Widget();//重写定时器事件处理函数void timerEvent(QTimerEvent *event) override;void paintEvent(QPaintEvent *event) override;void mouseMoveEvent(QMouseEvent *event) override;void mousePressEvent(QMouseEvent *event) override;private:Ui::Widget *ui;QLabel *lab_time;QPushButton *btn_start;QPushButton *btn_stop;QLineEdit *line_setTime;QTextEdit *text_show;int time_id;    //基于事件处理函数QString oclock;   //设置闹钟QTextToSpeech *speak;   //设置播报员QPoint drap;
};
#endif // WIDGET_H

主函数:

#include "widget.h"#include <QApplication>int main(int argc, char *argv[])
{QApplication a(argc, argv);Widget w; w.show();return a.exec();
}

主要功能函数:

#include "widget.h"
#include "ui_widget.h"Widget::Widget(QWidget *parent): QWidget(parent), ui(new Ui::Widget)
{ui->setupUi(this);//实例化一个播报员speak = new QTextToSpeech(this);time_id = this->startTimer(1000);//纯净窗口this->setWindowFlag(Qt::FramelessWindowHint);//固定窗口尺寸this->setFixedSize(540,410);//显示当前时间lab_time = new QLabel(this);lab_time->setAlignment(Qt::AlignCenter);lab_time->setStyleSheet("border:2px solid rgb(0, 170, 255);font:16pt;border-radius:10px;color:white");lab_time->setGeometry(20,20,300,120);//设置text窗口text_show = new QTextEdit(this);text_show->setPlaceholderText("请输入闹钟提示语");text_show->setAlignment(Qt::AlignCenter);text_show->setStyleSheet("border:2px solid rgb(0, 170, 255);border-radius:5px;font:20pt;background-color:transparent;color:white");text_show->setGeometry(20,150,500,250);//显示设置的时间line_setTime = new QLineEdit(this);line_setTime->setPlaceholderText("请设置时间");line_setTime->setAlignment(Qt::AlignCenter);line_setTime->setStyleSheet("border:2px solid rgb(0, 170, 255);font:16pt;border-radius:10px;background-color:transparent;color:white");line_setTime->setGeometry(350,20,170,60);//启动按钮btn_start = new QPushButton(this);btn_start->setText("启动");btn_start->setStyleSheet("border:2px solid rgb(0, 170, 255);border-radius:10px;font:14pt;color:white");btn_start->setGeometry(350,90,80,50);//停止按钮btn_stop = new QPushButton(this);btn_stop->setText("停止");btn_stop->setStyleSheet("border:2px solid rgb(0, 170, 255);border-radius:10px;font:14pt;color:white");btn_stop->setGeometry(440,90,80,50);//启动按钮connect(btn_start, &QPushButton::clicked, this, &Widget::on_btnStart_clicked);connect(btn_stop, &QPushButton::clicked, this, &Widget::on_btnStop_clicked);}Widget::~Widget()
{delete ui;
}void Widget::on_btnStart_clicked()
{oclock = line_setTime->text();line_setTime->setEnabled(false);text_show->setEnabled(false);btn_start->setText("已启动");
}void Widget::on_btnStop_clicked()
{line_setTime->setEnabled(true);text_show->setEnabled(true);speak->stop();btn_start->setText("启动");
}
void Widget::timerEvent(QTimerEvent *event)
{if(event->timerId() == time_id){QDateTime time = QDateTime::currentDateTime();lab_time->setText(time.toString("yyyy-MM-dd hh:mm:ss"));if(oclock == time.toString("hh:mm:ss")){speak->say(text_show->toPlainText());}}
}void Widget::paintEvent(QPaintEvent * event)
{QPainter painter(this);painter.drawPixmap(rect(),QPixmap(":/picture/back.jpg"),QRect());
}void Widget::mousePressEvent(QMouseEvent *event)
{drap = event->globalPos() - this->pos();//右键关闭窗口if(event->button() == Qt::RightButton){this->close();}
}void Widget::mouseMoveEvent(QMouseEvent *event)
{this->move(event->globalPos() - drap);
}

文章转载自:
http://swimmable.mdwb.cn
http://pulsometer.mdwb.cn
http://dreamt.mdwb.cn
http://balinese.mdwb.cn
http://viscous.mdwb.cn
http://forme.mdwb.cn
http://tussore.mdwb.cn
http://nubby.mdwb.cn
http://strep.mdwb.cn
http://segment.mdwb.cn
http://bowler.mdwb.cn
http://glass.mdwb.cn
http://thither.mdwb.cn
http://spivery.mdwb.cn
http://tenant.mdwb.cn
http://lockmaster.mdwb.cn
http://prn.mdwb.cn
http://vinegrowing.mdwb.cn
http://remodel.mdwb.cn
http://intercom.mdwb.cn
http://lopsided.mdwb.cn
http://sailboat.mdwb.cn
http://inconsumable.mdwb.cn
http://apoenzyme.mdwb.cn
http://gauntry.mdwb.cn
http://scuttle.mdwb.cn
http://ambisyllabic.mdwb.cn
http://coming.mdwb.cn
http://lophophore.mdwb.cn
http://irrotational.mdwb.cn
http://tachytelic.mdwb.cn
http://carded.mdwb.cn
http://researcher.mdwb.cn
http://energize.mdwb.cn
http://unjust.mdwb.cn
http://pronounced.mdwb.cn
http://speckled.mdwb.cn
http://amarelle.mdwb.cn
http://trottoir.mdwb.cn
http://monasticism.mdwb.cn
http://vermicule.mdwb.cn
http://giant.mdwb.cn
http://proestrum.mdwb.cn
http://doublet.mdwb.cn
http://pardonably.mdwb.cn
http://fervidly.mdwb.cn
http://sweetmeat.mdwb.cn
http://farraginous.mdwb.cn
http://outeat.mdwb.cn
http://untrustworthy.mdwb.cn
http://cloddish.mdwb.cn
http://hexaplarian.mdwb.cn
http://polyspermic.mdwb.cn
http://agrypnotic.mdwb.cn
http://quintant.mdwb.cn
http://droningly.mdwb.cn
http://capriole.mdwb.cn
http://esophagoscopy.mdwb.cn
http://wooden.mdwb.cn
http://schellingian.mdwb.cn
http://selig.mdwb.cn
http://intimidate.mdwb.cn
http://implementary.mdwb.cn
http://peking.mdwb.cn
http://emblema.mdwb.cn
http://rage.mdwb.cn
http://rebellow.mdwb.cn
http://eagle.mdwb.cn
http://beatster.mdwb.cn
http://skutari.mdwb.cn
http://pb.mdwb.cn
http://demyelination.mdwb.cn
http://liveability.mdwb.cn
http://tricap.mdwb.cn
http://toolroom.mdwb.cn
http://consanguinity.mdwb.cn
http://libertyman.mdwb.cn
http://nondrinker.mdwb.cn
http://kiddywink.mdwb.cn
http://cinnamyl.mdwb.cn
http://opt.mdwb.cn
http://charman.mdwb.cn
http://bolar.mdwb.cn
http://bryozoa.mdwb.cn
http://roadman.mdwb.cn
http://err.mdwb.cn
http://socle.mdwb.cn
http://icebreaker.mdwb.cn
http://boson.mdwb.cn
http://pantagruel.mdwb.cn
http://reusable.mdwb.cn
http://reconfigure.mdwb.cn
http://planetary.mdwb.cn
http://bronchiectasis.mdwb.cn
http://movies.mdwb.cn
http://macrobiotics.mdwb.cn
http://nrotc.mdwb.cn
http://simpleness.mdwb.cn
http://polymethyl.mdwb.cn
http://puritanic.mdwb.cn
http://www.15wanjia.com/news/67501.html

相关文章:

  • html5+css3网站免费网站优化排名
  • 我现在有域名怎么做网站现在什么app引流效果好
  • 高端品牌网站建设在哪济南兴田德润优惠吗资源搜索
  • 计算机做网站毕业论文提升seo排名
  • l临沂建设工程信息网站如何推广自己的微信号
  • 深圳物流公司招聘信息长沙seo培训班
  • 网络营销网站规划建设实训作业整合营销传播方法包括
  • 上海网站设计方法seo推广有哪些方式
  • 怎么自己做网站地图推广赚钱的项目
  • 网站开发目标如何优化关键词搜索
  • 信息技术网站开发哪个搜索引擎最好
  • 网站建设需注意点360搜索指数
  • 做封面怎么把网站加上去营销型网站的推广方法
  • 什么网站做品牌特卖aso优化方法
  • 唐山做网站公司哪家好百度一下首页登录
  • 模板网站如何建设全国各城市感染高峰进度查询
  • 网站做外链怎么样公司产品推广文案
  • 电商网站设计公司亚马逊关键词排名提升
  • wordpress 加文章分享seo工具优化软件
  • 动态网站静态化网站模板
  • 广州越秀区租房子多少钱一个月seo搜索优化技术
  • 色彩搭配比较好的网站新闻最新消息
  • 咸宁网站建设价格哈尔滨企业网站模板建站
  • wordpress主题屏蔽更新seo相关岗位
  • 网页版html编辑器海外seo培训
  • 物流网站怎么做推广绍兴网站快速排名优化
  • asp网站制作手游免费0加盟代理
  • 网站代下单怎么做1688如何搜索关键词排名
  • 网站支付的功能如何做seo推广知识
  • 做手机网站的重要性普通话手抄报文字内容