随笔分类 -  QT学习

上一页 1 2 3 4 5 6 7 ··· 14 下一页
摘要:https://www.bilibili.com/video/BV1Qh41127ec?p=2 阅读全文
posted @ 2022-04-26 10:08 朱小勇 阅读(110) 评论(0) 推荐(0)
摘要:1、代码 QString path = QProcessEnvironment::systemEnvironment().value("Third_Party"); QStringList environment = QProcess::systemEnvironment(); 阅读全文
posted @ 2022-04-11 16:36 朱小勇 阅读(1205) 评论(0) 推荐(0)
摘要:1.代码 QDir temDirs("./");QString filePath = temDirs.absolutePath(); 阅读全文
posted @ 2022-04-11 15:08 朱小勇 阅读(358) 评论(0) 推荐(0)
摘要:1、最开始工程是MINGW,切换到MSVC 2、编译报很多错,基本是语法的 3、使用EditPlus将源码编码从UTF-8转为UTF-8+DOM https://jingyan.baidu.com/article/3a2f7c2e2bbf0726afd61115.html 阅读全文
posted @ 2022-03-25 09:13 朱小勇 阅读(204) 评论(0) 推荐(0)
摘要:1、在pro文件里 CONFIG += precompile_header PRECOMPILED_HEADER=$$PWD/precompile.h 可以将不会修改、第三方库文件放在precompile.h中 阅读全文
posted @ 2022-03-21 23:32 朱小勇 阅读(207) 评论(0) 推荐(0)
摘要:1、 阅读全文
posted @ 2022-03-19 15:59 朱小勇 阅读(1471) 评论(0) 推荐(0)
摘要:1、方式1:使用全局路径 LIBS+= $$PWD/Boost/lib/libboost_thread-mgw8-mt-d-x32-1_78.a LIBS+= $$PWD/Boost/lib/libboost_thread-mgw8-mt-d-x32-1_78.lib 2、方式2:引入路径+使用静态 阅读全文
posted @ 2022-03-19 10:45 朱小勇 阅读(1073) 评论(0) 推荐(0)
摘要:1、dll文件 LIBS +=-L$$PWD -lmydll 2、a文件 LIBS +=-L$$PWD -lmylib LIBS +=$$PWD/mylib.a 阅读全文
posted @ 2022-03-06 23:42 朱小勇 阅读(119) 评论(0) 推荐(0)
摘要:解决: QString a;//QByteArray a.resize(10); 阅读全文
posted @ 2022-03-03 11:50 朱小勇 阅读(1619) 评论(0) 推荐(0)
摘要:1、定义 实现私有化[PIMPLI,Private Implementation]:将一个类的所有成员变量都放进一个单独的类[或结构体]中定义,将实现进行私有化。如此可将类的接口与实现进行解耦。而通过查看Qt源码的实现,绝大多数Qt类都使用实现私有化的方式。 2、优点 ①、当成员变量特别多的时候接口 阅读全文
posted @ 2022-02-27 12:07 朱小勇 阅读(177) 评论(0) 推荐(0)
摘要:返回指针指针包裹的对象的指针 阅读全文
posted @ 2022-02-24 15:05 朱小勇 阅读(183) 评论(0) 推荐(0)
摘要:1、QVariant转指针 QVariant a; //do something QObject* b = (QObject*)a.value<QObject*>(); 2、QVariant转其他非内建数据 QVariant a; //do something T b = (T)a.value<T> 阅读全文
posted @ 2022-01-13 17:18 朱小勇 阅读(691) 评论(0) 推荐(0)
摘要:1、函数原型 当设置为true时,QObject对象[子类]不会发出信号 2、使用 在动态为QComboBox动态添加item的时候,它会发出xxxChanged信号,但是初始情况下我们不希望其发出,待初始化完成后再发出。 则可以: ①、先设置blockSignals(true); ②、动态添加it 阅读全文
posted @ 2022-01-09 22:24 朱小勇 阅读(418) 评论(0) 推荐(0)
摘要:1、代码 QString a = "123"; const char * a = a.toStdString().c_str(); 阅读全文
posted @ 2022-01-06 11:15 朱小勇 阅读(230) 评论(0) 推荐(0)
摘要:版本:Qt5.15.2 1、QSS 搜索:Qt Style Sheets Examples 2、QML与C++可传递类型 搜索:Data Type Conversion Between QML and C++ 3、QML基本类型 搜索:QML Basic Types 4、QML的MVD介绍 搜索:M 阅读全文
posted @ 2021-12-15 09:48 朱小勇 阅读(449) 评论(0) 推荐(0)
摘要:版本:Qt5.15.2 1、ChartView基本使用 搜索: Line and BarChart Example 2、模拟示波器 搜索:oscilloscope 阅读全文
posted @ 2021-12-14 17:24 朱小勇 阅读(195) 评论(0) 推荐(0)
摘要:版本:Qt5.14 1、.pro QT += webenginewidgets 2、头文件 #include <QWebEngineView> 3、代码 int main(int argc, char *argv[]){ QApplication a(argc, argv); QWebEngineV 阅读全文
posted @ 2021-12-04 14:15 朱小勇 阅读(564) 评论(0) 推荐(0)
摘要:1、在打印前加如转义字符 qDebug()<<"\033[30m" <<"Hello!"; qDebug()<<"\033[31m" <<"Hello!"; qDebug()<<"\033[32m" <<"Hello!"; qDebug()<<"\033[33m" <<"Hello!"; qDebu 阅读全文
posted @ 2021-12-03 20:55 朱小勇 阅读(898) 评论(0) 推荐(0)
摘要:1、背景 采用quickwidget+qml方式,在qml里生成了Image,希望在c++里传入图片路径,qml显示 2、问题 传入相对路径,显示失败;传入普通的绝对路径也显示失败 3、解决 在c++里将相对路径转化为绝对路径,并且加上制定的前缀发给qml显示 C++: QString path = 阅读全文
posted @ 2021-11-29 11:44 朱小勇 阅读(600) 评论(0) 推荐(0)
摘要:代码: #include <QUuid> QUuid id = QUuid::createUuid(); QString strId = id.toString(); qDebug() << strId; //输出结果:"{b5eddbaf-984f-418e-88eb-cf0b8ff3e775}" 阅读全文
posted @ 2021-11-29 11:39 朱小勇 阅读(1301) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 ··· 14 下一页