自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(7)
  • 收藏
  • 关注

原创 【无标题】

【代码】【无标题】

2024-06-24 21:31:48 111

原创 QDateTime UTC和Local时间关系 toUTC()、toTime_t()、fromTime_t(uint seconds)[static]、setTime_t(uint seconds

UTC +时间差=本地时间UTC是世界标准时间,时间差根据时区定,东边为正,西边为负,如北京东八区,时间差8小时。若UTC时间是 2021-04-19 00:00:00 那么北京时间就是 2021-04-19 08:00:00用QDateTime获得本地时间 QDateTime::currentDateTimeUtc().toTime_t()获得的时间是0时区的时间,也就是说比北京时间早8个小时。下面可以获得电脑当前的时区正确时间值。date_time=QDateTime::fromTime_

2021-04-19 18:03:15 8318 1

原创 Qt笔记 倍速播放菜单

用QMenu实现显示倍速菜单// 创建右键菜单 if (m_pSpeedMenu == nullptr) { m_pSpeedMenu = new QMenu(this); QAction* pSpeed1 = new QAction(tr("2.0x"), this); QAction* pSpeed2 = new QAction(tr("1.5x"), this); QAction* pSpeed3 = new QAc

2021-04-12 15:19:55 1530

原创 Qt笔记 将秒数转化为时分秒格式

将秒数转化为时分秒格式m_dTotalTime为总秒数 //将秒数转化为时分秒格式 int H = m_dTotalTime / (60*60); int M = (m_dTotalTime- (H * 60 * 60)) / 60; int S = (m_dTotalTime - (H * 60 * 60)) - M * 60; QString hour = QString::number(H); if (hour.length() == 1)

2021-04-12 15:04:02 3124

原创 Qt笔记 一般软件界面退出函数的编写

Qt一般软件界面退出函数的编写使用QMessageBox类void MainWidget::closeEvent(QCloseEvent* event){ int ret = QMessageBox::warning(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("确定退出?"), QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel); swit

2021-04-12 14:22:41 363

原创 Qt笔记 将界面按钮更新写进xml文件

将界面按钮更新写进xml文件1 按钮改变状态时发送一个信号void FieldItemWgt::LabelCheckBtnClickedSlot(){ m_bLabelChecked = ui.m_pLabelCheckBtn->isChecked(); emit dataChangedSignal();}2 在主界面中用信号槽的方式连接信号,更新xml文档//标牌相关属性发生改变时发送数据改变信号,然后更新相关xml文件 connect(pItemWgt, SIGNAL(da

2021-04-12 11:42:40 390

原创 Qt笔记

Qt设置按钮单选使用QButtonGroup类m_pButtonGroup = new QButtonGroup(this); m_pButtonGroup->addButton(ui.m_pShortcutKeyBtn); m_pButtonGroup->addButton(ui.m_pLabelConfigBtn); m_pButtonGroup->addButton(ui.m_pLogInfoBtn); m_pButtonGroup->setExclusive(tr

2021-04-12 10:44:53 94

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除