会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
RedWetPlace
博客园
首页
新随笔
联系
管理
订阅
1
2
3
4
5
···
33
下一页
2025年2月12日
qt 按钮互斥效果
摘要: void SideBar::setBtnVec(QVector<QPushButton*> btnVec, const char *name) { m_propertyName = name; m_btnVec = btnVec; for (int i = 0; i < m_btnVec.count
阅读全文
posted @ 2025-02-12 10:32 雾枫
阅读(64)
评论(0)
推荐(0)
2025年1月1日
点击QChart图例,显示或隐藏 对应的折线
摘要: 原文链接:C++ Qt开发:Charts折线图绑定事件-腾讯云开发者社区-腾讯云// 设置图表的主题 m_chart->setTheme(QChart::ChartThemeBlueNcs); QLegend *legend = m_chart->legend(); legend->setAlign
阅读全文
posted @ 2025-01-01 21:20 雾枫
阅读(325)
评论(0)
推荐(0)
2024年12月30日
直接调用文件设置qt可执行程序的图标,运行时的图标,exe本身的图标,以及固定到任务栏时的图标,窗口坐上角的图标
摘要: // 设置应用程序图标(窗口图标和任务栏图标) this->setWindowIcon(QIcon("./Icon/ReadADtool.ico")); // 从资源文件中加载图标 固定到任务栏上时的图标: 在pro文件添加如下指令: 设置rc文件内容: IDI_ICON1 ICON DISCARD
阅读全文
posted @ 2024-12-30 17:01 雾枫
阅读(115)
评论(0)
推荐(0)
2024年9月11日
QTableWidget 清空除水平表头以外的其他单元格
摘要: void clearTableExceptHeaders() { int rowCount = tableWidget->rowCount(); int columnCount = tableWidget->columnCount(); // 清除所有单元格的内容 for (int row = 0;
阅读全文
posted @ 2024-09-11 11:11 雾枫
阅读(174)
评论(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 雾枫
阅读(99)
评论(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 雾枫
阅读(65)
评论(0)
推荐(0)
qt 将当前窗口保存为图片
摘要: bool BasicDotChart::saveAsImage(const QString &path) { // 获取窗口的 QPixmap QPixmap pixmap = this->grab(); // 弹出保存文件对话框,选择保存位置和文件格式 QString filePath = pat
阅读全文
posted @ 2024-08-08 19:14 雾枫
阅读(187)
评论(0)
推荐(0)
2024年8月5日
qt 使用qmake pro文件添加 ico图标,程序运行时显示图标,exe也显示图标
摘要: RC_ICONS = $$PWD/res/app.ico 在pro文件中添加以上代码
阅读全文
posted @ 2024-08-05 15:26 雾枫
阅读(49)
评论(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 雾枫
阅读(187)
评论(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 雾枫
阅读(71)
评论(0)
推荐(0)
1
2
3
4
5
···
33
下一页
公告