摘要: main.cpp #include <QCoreApplication> #include "CommonFun.h" #include <QtEndian> #include <QDebug> int main(int argc, char *argv[]) { QCoreApplication 阅读全文
posted @ 2025-08-11 15:43 上车去广西 阅读(74) 评论(0) 推荐(0)
摘要: 在.pro文件中加入 #32位 contains(QT_ARCH, i386){ //x86架构 32位 CONFIG(release, release | debug){ DESTDIR = $$PWD/bin/x86/release } else { DESTDIR = $$PWD/bin/x8 阅读全文
posted @ 2025-04-29 11:44 上车去广西 阅读(100) 评论(0) 推荐(0)
摘要: 显示指定依赖关系,自动调整编译顺序 TEMPLATE = subdirs SUBDIRS = core gui plugins tests gui.depends = core # gui 依赖 core plugins.depends = core gui # plugins 依赖 core 和 阅读全文
posted @ 2025-04-24 17:29 上车去广西 阅读(74) 评论(0) 推荐(0)
摘要: pro文件需配置 QT += gui-private 代码 #include <QCoreApplication> #include <QDir> #include <QFile> #include <QDebug> #include "QZipReader.h" // 解压 void extrac 阅读全文
posted @ 2025-04-24 15:01 上车去广西 阅读(278) 评论(0) 推荐(0)
摘要: void MainWindow::on_pushButton_clicked() { bool Canceled = false; QProgressDialog dialog("文件复制进度", "取消", 0, 50000, this); dialog.setWindowTitle("进度对话框 阅读全文
posted @ 2025-04-24 11:23 上车去广西 阅读(19) 评论(0) 推荐(0)
摘要: QString str = "Hello, world!"; // 错误用法 const char *szCopy = str.toStdString().c_str(); qDebug() << szCopy; // 输出空 // 正确用法 QString strCopy = str.toStdS 阅读全文
posted @ 2025-04-23 17:01 上车去广西 阅读(84) 评论(0) 推荐(0)
摘要: 名称 网址 豆子的空间 https://www.devbean.net 阅读全文
posted @ 2025-04-23 15:53 上车去广西 阅读(20) 评论(0) 推荐(0)
摘要: 打开可加载大文件 CONFIG += resources_big 配置生成的可执行文件或库文件名称 TARGET = xxx 配置生成的文件类型 exe TEMPLATE = app lib TEMPLATE = lib 添加定义宏 DEFINES += xxx 引用依赖库 方式1 LIBS += 阅读全文
posted @ 2025-04-22 14:29 上车去广西 阅读(66) 评论(0) 推荐(0)
摘要: 1. 从布局对象中移除组件后要手动释放 ui->verticalLayout->removeWidget(ui->pushButton); if (ui->pushButton!= nullptr) { delete ui->pushButton; ui->pushButton = nullptr; 阅读全文
posted @ 2025-04-18 16:42 上车去广西 阅读(27) 评论(0) 推荐(0)
摘要: mainwindow.h #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QStringListModel> QT_BEGIN_NAMESPACE namespace Ui { class Main 阅读全文
posted @ 2025-04-18 16:00 上车去广西 阅读(17) 评论(0) 推荐(0)