递归遍历QTreeView+QStandrdItemModel
摘要://递归遍历 点击查看代码 ``` void iterateTreeViewNodes(const QModelIndex& parentIndex, QStandardItemModel* model, QVector& items) { int rowCount = model->rowCoun
阅读全文
QxOrm 介绍、下载、编译
摘要:转自:https://waleon.blog.csdn.net/article/details/105071540?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7Edefaul
阅读全文
linux实现守护进程根据进程名字获取进程的进程号PID
摘要:转自:https://blog.csdn.net/nicholas_dlut/article/details/80990289 实现linux下守护进程,根据进程名字获取PID(进程号),调用kill(pid, SIGKILL); 后期实现window和linux下的守护进程
阅读全文
QT连接Oracle数据库 报错:ORA-12505, TNS:listener does not currently know of SID
摘要:Qt使用Oracle(Rac集群数据库)注意点 对于一般的数据库,即便是像access这样比较特殊的数据库,都可以通过单独设置主机名、端口、数据库名称的方式连接,但是对于Oracle数据库却不是这样。 因为oracle 12c(注:oracle 11g也可以) 使用多个插拔数据库,不能采用传统的设置
阅读全文
CentOS7和Ubuntu16.04下运行Qt Creator出现cannot find -lGL的问题的解决方案
摘要:转自:https://cloud.tencent.com/developer/article/1537447
阅读全文
解决Qt5 使用HTTP时报错:TLS initialization failed
摘要:转自:https://blog.csdn.net/yuajn/article/details/103035879?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.control&di
阅读全文
QT批量快速插入数据到MySQL,SqlServer,Oracle
摘要:参考:https://blog.csdn.net/weixin_35092037/article/details/113110855 1.一条一条进行插入,效率比较慢。 2.采用事务操作,效率较高。 3.采用拼接字符串格式,比事务更高效 SqlServer,MySQL格式如下: QString st
阅读全文
QT Oracle数据库绑定日期两种格式
摘要:/ / query12.prepare("insert into table1(Time,value,tagname) values(to_date(:Time,'YYYY-MM-DD HH24:MI:SS'),:value,:tagname)"); // query12.bindValue(":T
阅读全文
QT支持多种数据库(Mysql,SqlServer,Oracle)根据配置文件动态加载相应库
摘要:一:数据库接口 #include <QVector>#include <QMap>#include <QVariant>#include <QSqlDatabase>#include <QSqlQuery>#include <QSqlRecord>#include <QSqlError>#inclu
阅读全文
Qt信号槽机制源码解析
摘要:转自:https://www.cnblogs.com/lsgxeva/p/12639283.html 转自:https://zhuanlan.zhihu.com/p/80539605
阅读全文
Qt .pro文件项目通用配置
摘要:QT -= gui CONFIG += c++11 consoleCONFIG -= app_bundle # The following define makes your compiler emit warnings if you use# any Qt feature that has bee
阅读全文
QT Linux下QFileDialog自动添文件后缀
摘要:QString strFileName = QFileDialog::getSaveFileName(this, tr("保存文件"),".", tr("测点文件(*.csv)")); if (strFileName.isEmpty()) { return; } //针对linux处理, 若后缀为空
阅读全文
QT编译Boost,并测试
摘要:引自:https://blog.csdn.net/ninglu1989/article/details/82425595 一、编译boost源码为静态库 1>将你的Qt的工具目录(有g++.exe)设置环境变量。(我的是 F:\Qt592\Tools\mingw530_32\bin,要依据实际情况)
阅读全文
C++接口库调用方法(QT)
摘要:#ifndef ICONNECT_H#define ICONNECT_H #include <QtCore/qglobal.h>#if defined(MYDLL_LIBRARY)# define MYDLL_EXPORT Q_DECL_EXPORT#else# define MYDLL_EXPOR
阅读全文
Qt中如何根据类名来实例化对象
摘要:class IParser{public: virtual ~IParser(){} virtual void parse() = 0;}; class Parser1 : public IParser{public: Parser1() { cout<<"Parser1"<<endl; } ~Pa
阅读全文
QListView交换数据,增加/删除/上移/下移操作
摘要:效果图: //初始化void SetAttrListDlg::init(){ m_pLeftStandardItemModel = new QStandardItemModel(); m_pRightStandardItemModel = new QStandardItemModel(); ui->
阅读全文
线程池改进(QT版本)
摘要:测试如下: threadPool.InitThread(8); threadPool.Start(); for(int i=0; i<100; ++i) { TestRunnable* task = new TestRunnable(); task->i = i; threadPool.PushTa
阅读全文
线程池(QT版本)
摘要:测试如下: ThreadPool::instance()->Init(3); ThreadPool::instance()->Start(); for (int i = 0; i < 100; ++i) { Task task; task.nId = i; task.strName = "hello
阅读全文
读取命令行参数(QT版本)
摘要:测试如下: QStringList strList = QApplication::arguments(); Parser(strList);
阅读全文
分段读取文件并保存文件到数据库(QT版本)
摘要:QSqlQuery query(m_db); query.prepare("INSERT INTO files(filename,uuid,dbData,dbSize)" "values(:filename,:uuid,:dbData,:dbSize)"); query.bindValue(":fi
阅读全文