会员
周边
捐助
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
RedWetPlace
博客园
首页
新随笔
联系
管理
订阅
2024年9月11日
QTableWidget 清空除水平表头以外的其他单元格
摘要: void clearTableExceptHeaders() { int rowCount = tableWidget->rowCount(); int columnCount = tableWidget->columnCount(); // 清除所有单元格的内容 for (int row = 0;
阅读全文
posted @ 2024-09-11 11:11 雾枫
阅读(19)
评论(0)
推荐(0)
编辑
2024年8月14日
sqlite 插入数据时,正确开启事务的方法
摘要: bool SqliteDbManager::insertData(const QString& sql) { // 开启事务 if (!m_db.transaction()) { qDebug() << "无法启动事务:" << m_db.lastError().text(); return fal
阅读全文
posted @ 2024-08-14 11:52 雾枫
阅读(8)
评论(0)
推荐(0)
编辑
2024年8月8日
qt 输入一张图片,在图片上绘制后,再另存为图片
摘要: bool DdrawCircleOnImage( const QString &inputImagePath, const QString &outputImagePath, QVector<QPoint> dotData ) { if ( inputImagePath.isEmpty() || o
阅读全文
posted @ 2024-08-08 19:16 雾枫
阅读(3)
评论(0)
推荐(0)
编辑
qt 将当前窗口保存为图片
摘要: bool BasicDotChart::saveAsImage(const QString &path) { // 获取窗口的 QPixmap QPixmap pixmap = this->grab(); // 弹出保存文件对话框,选择保存位置和文件格式 QString filePath = pat
阅读全文
posted @ 2024-08-08 19:14 雾枫
阅读(25)
评论(0)
推荐(0)
编辑
2024年8月5日
qt 使用qmake pro文件添加 ico图标,程序运行时显示图标,exe也显示图标
摘要: RC_ICONS = $$PWD/res/app.ico 在pro文件中添加以上代码
阅读全文
posted @ 2024-08-05 15:26 雾枫
阅读(5)
评论(0)
推荐(0)
编辑
2024年7月26日
qt 连接扫码枪,检查串口插拔
摘要: bool MainWindow::nativeEvent(const QByteArray &eventType, void *message, long *result) { Q_UNUSED(result); Q_UNUSED(eventType); MSG* pMsg = reinterpre
阅读全文
posted @ 2024-07-26 10:55 雾枫
阅读(28)
评论(0)
推荐(0)
编辑
2024年7月23日
qmake (.pro)定义可执行程序安装路径
摘要: QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++17 # You can make your code fail to compile if it uses deprecated APIs. #
阅读全文
posted @ 2024-07-23 17:34 雾枫
阅读(4)
评论(0)
推荐(0)
编辑
QT 代码添加分割线
摘要: // 添加一个垂直方向的分割线 QFrame *line = new QFrame(); line->setFrameShape(QFrame::HLine); line->setFrameShadow(QFrame::Sunken); m_mainLayout->addWidget(line);
阅读全文
posted @ 2024-07-23 13:49 雾枫
阅读(19)
评论(0)
推荐(0)
编辑
2024年7月18日
QTextEdit 设置 显示内容时,指定内容的颜色
摘要: void CaliTestMain::onLogMessage(const QString &logmess, QColor color) { QString mess = QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss :")
阅读全文
posted @ 2024-07-18 18:06 雾枫
阅读(26)
评论(0)
推荐(0)
编辑
2024年7月15日
pr2024 安装剪辑助手工具插件套装 Editing Essentials Bundle_1010_CE 后,点击插件时没有反应
摘要: 原文链接
阅读全文
posted @ 2024-07-15 00:05 雾枫
阅读(23)
评论(0)
推荐(0)
编辑
下一页
公告