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

公司门户网站开发最专业网站建设哪家好

公司门户网站开发,最专业网站建设哪家好,仙桃市住房建设局网站,成都设计公司招聘文章目录 完成效果图ui界面ui样图 main函数窗口文件头文件cpp文件 引言 一般定时关机采用命令行模式#xff0c;还需要我们计算在多久后关机#xff0c;我们可以做一个小程序来定时关机 完成效果图 ui界面 ?xml version1.0 encodingUTF-8?还需要我们计算在多久后关机我们可以做一个小程序来定时关机 完成效果图 ui界面 ?xml version1.0 encodingUTF-8? ui version4.0classMainWindow/classwidget classQMainWindow nameMainWindowproperty namegeometryrectx0/xy0/ywidth330/widthheight240/height/rect/propertyproperty nameminimumSizesizewidth330/widthheight240/height/size/propertyproperty namemaximumSizesizewidth330/widthheight240/height/size/propertyproperty namefontfontpointsize10/pointsize/font/propertywidget classQWidget namecentralwidgetlayout classQGridLayout namegridLayout_2item row3 column1widget classQWidget namewidget nativetruelayout classQGridLayout namegridLayoutitem row2 column0layout classQHBoxLayout namehorizontalLayout_2itemwidget classQPushButton nameshutdownButtonproperty nametextstring关机/string/property/widget/itemitemwidget classQPushButton namecancelShutdownButtonproperty nametextstring取消/string/property/widget/item/layout/itemitem row0 column0layout classQHBoxLayout namehorizontalLayoutitemwidget classQComboBox namehourComboBoxproperty nameminimumSizesizewidth62/widthheight22/height/size/propertyproperty namemaximumSizesizewidth62/widthheight22/height/size/propertyproperty nameeditableboolfalse/bool/property/widget/itemitemwidget classQLabel namehourLabelproperty nameminimumSizesizewidth0/widthheight0/height/size/propertyproperty nametextstring时/string/property/widget/itemitemspacer namehorizontalSpacer_3property nameorientationenumQt::Horizontal/enum/propertyproperty namesizeHint stdset0sizewidth40/widthheight20/height/size/property/spacer/itemitemwidget classQComboBox nameminuteComboBoxproperty nameminimumSizesizewidth62/widthheight22/height/size/propertyproperty namemaximumSizesizewidth62/widthheight22/height/size/propertyproperty nameeditableboolfalse/bool/property/widget/itemitemwidget classQLabel nameminuteLabelproperty nametextstring分/string/property/widget/item/layout/itemitem row1 column0spacer nameverticalSpacer_4property nameorientationenumQt::Vertical/enum/propertyproperty namesizeHint stdset0sizewidth20/widthheight30/height/size/property/spacer/item/layout/widget/itemitem row3 column0spacer namehorizontalSpacerproperty nameorientationenumQt::Horizontal/enum/propertyproperty namesizeHint stdset0sizewidth40/widthheight20/height/size/property/spacer/itemitem row0 column1spacer nameverticalSpacer_2property nameorientationenumQt::Vertical/enum/propertyproperty namesizeHint stdset0sizewidth20/widthheight40/height/size/property/spacer/itemitem row4 column1spacer nameverticalSpacerproperty nameorientationenumQt::Vertical/enum/propertyproperty namesizeHint stdset0sizewidth20/widthheight40/height/size/property/spacer/itemitem row3 column2spacer namehorizontalSpacer_2property nameorientationenumQt::Horizontal/enum/propertyproperty namesizeHint stdset0sizewidth40/widthheight20/height/size/property/spacer/itemitem row1 column1widget classQLabel namelabelproperty nameminimumSizesizewidth186/widthheight30/height/size/propertyproperty namemaximumSizesizewidth186/widthheight30/height/size/propertyproperty nametextstring 设置关机时间/string/property/widget/itemitem row2 column1spacer nameverticalSpacer_3property nameorientationenumQt::Vertical/enum/propertyproperty namesizeHint stdset0sizewidth20/widthheight30/height/size/property/spacer/item/layout/widget/widgetresources/connections/ /ui ui样图 main函数 #include mainwindow.h#include QApplicationint main(int argc, char *argv[]) {QApplication a(argc, argv);MainWindow w;w.show();return a.exec(); } 窗口文件 核心逻辑 采用信号和槽完成事件链接 QProcess::startDetached(shutdown, QStringList() /s /t QString::number(timeSeconds));QProcess::execute(shutdown, QStringList() /a);头文件 // mainwindow.h #ifndef MAINWINDOW_H #define MAINWINDOW_H#include QMainWindow #include QTimer #include QDateTime #include QProcess #include QMessageBox #include QString #include QDebugnamespace Ui { class MainWindow; }class MainWindow : public QMainWindow {Q_OBJECTpublic:explicit MainWindow(QWidget *parent nullptr);~MainWindow(); private slots:void onShutdownButtonClicked();void onCancelShutdownButtonClicked();private:Ui::MainWindow *ui;QTimer *shutdownTimer;};#endif // MAINWINDOW_H cpp文件 // mainwindow.cpp#include mainwindow.h #include ui_mainwindow.hMainWindow::MainWindow(QWidget *parent) :QMainWindow(parent),ui(new Ui::MainWindow) {ui-setupUi(this);// 获取当前时间QTime currentTime QTime::currentTime();// 设置小时下拉框ui-hourComboBox-setEditable(false);for (int i 0; i 24; i) {// 比较当前时间与选项时间if (currentTime.hour() i) {ui-hourComboBox-addItem(QString::number(i));}}// 选择当前小时作为已选中项ui-hourComboBox-setCurrentIndex(ui-hourComboBox-findText(QString::number(currentTime.hour())));// 设置分钟下拉框ui-minuteComboBox-setEditable(false);for (int i 0; i 60; i) {// 比较当前时间与选项时间if (currentTime.minute() i) {ui-minuteComboBox-addItem(QString::number(i));}}// 选择当前分钟作为已选中项ui-minuteComboBox-setCurrentIndex(ui-minuteComboBox-findText(QString::number(currentTime.minute())));// 连接按钮点击事件到槽函数connect(ui-shutdownButton, QPushButton::clicked, this, MainWindow::onShutdownButtonClicked);connect(ui-cancelShutdownButton, QPushButton::clicked, this, MainWindow::onCancelShutdownButtonClicked); }MainWindow::~MainWindow() {delete ui; }void MainWindow::onShutdownButtonClicked() {// 获取用户选择的小时和分钟int selectedHour ui-hourComboBox-currentText().toInt();int selectedMinute ui-minuteComboBox-currentText().toInt();// 获取当前时间QDateTime currentTime QDateTime::currentDateTime();// 获取用户选择的时间QDateTime shutdownTime QDateTime(currentTime.date(), QTime(selectedHour, selectedMinute));// 计算时间差qint64 timeDifference currentTime.msecsTo(shutdownTime);int timeSecondsint(timeDifference/1000);// 设置定时器的超时时间//shutdownTimer-start(timeDifference);QProcess::startDetached(shutdown, QStringList() /s /t QString::number(timeSeconds));// 提示用户关机已设置QMessageBox::information(this, 关机设置, 关机已设置将在选择的时间执行); }void MainWindow::onCancelShutdownButtonClicked() {// 取消关机QProcess::execute(shutdown, QStringList() /a);QMessageBox::information(this, 取消关机, 已取消关机操作); }
http://www.pierceye.com/news/586706/

相关文章:

  • 佛山做公司网站全球域名
  • 网站建设陆金手指谷哥7邢台企业做网站找谁
  • h5手机端网站开发优秀高端网站建设
  • 东莞桥头网站建设廊坊开发网站公司
  • sem优化托管公司湖南做网站seo
  • 网站流量下跌免费空间asp网站
  • 有没有可以做app的网站wordpress代码转义
  • 电子商务网站开发的任务书wordpress图片间距
  • 石家庄集团网站建设哪些网站可以做微信
  • 网站文件夹名平台期什么意思
  • 怎么用vps做网站论坛网站建设视频
  • 广州网站制作实力乐云seowordpress 评论模块
  • 永久免费制作网站木门行业做网站有什么好处
  • 怎么区分模板网站wordpress菜单怎么建
  • 网站开发最新效果企业手机网站建
  • 网站群管理系统哪个好wordpress制作会员功能
  • 做套现网站网站的访问量
  • 做网站网页需要学些什么做网站学的什么专业
  • 建设银行的官方网站纪念币公司宣传页设计印刷
  • 网站左侧图片悬浮代码常州工厂网站建设
  • 智慧团建网站怎么转团关系app制作开发小程序制作开发
  • 誉字号网站wordpress 展示模板下载
  • 网站不接入备案成都市建设工程质量协会网站
  • 企业网站html网站开发济南招聘
  • 网站html优化方法音乐网站开发参考文献
  • 网站建设及推广方案ppt模板微信小程序开发工具下载哪个版本
  • 固安县城乡和住房建设局网站科技公司手机端网站
  • 寿光网站建设思科企业网络拓扑图
  • 中国建设银行河南省分行网站建筑人才服务中心官网
  • 响应式app网站模板单页淘宝客网站2014年行吗