上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 33 下一页
摘要: //将模板中的spro文件复制到新创建的文件夹中 //默认文件选择路径为,程序所在的路径 //注意:目标文件夹下必须有这个文件) QString templateDir = "templateSpro/ASG.spro"; bool a= QFile::copy(templateDir, _path 阅读全文
posted @ 2022-06-22 18:03 雾枫 阅读(1645) 评论(0) 推荐(0) 编辑
摘要: #include <QDir>// 判断文件夹是否存在,不存在则创建 QDir dir(_pathName_+"/"+"result"); if (!dir.exists()) { bool ismkdir = QDir().mkdir(_pathName_ + "/" + "result"); i 阅读全文
posted @ 2022-06-22 17:29 雾枫 阅读(1188) 评论(0) 推荐(0) 编辑
摘要: 代码如下: void NewObject::_okName() //确定槽函数 { qDebug() << QString::fromLocal8Bit("确定槽函数,触发!"); _projectName = ui.lineEdit2_NamE->text(); //获取工程名称 qDebug() 阅读全文
posted @ 2022-06-22 17:21 雾枫 阅读(86) 评论(0) 推荐(0) 编辑
摘要: #include <QMessageBox> QMessageBox::information(nullptr, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("用户名或密码错误!")); 阅读全文
posted @ 2022-06-22 17:11 雾枫 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 1、添加头文件 #include <QFileDialog> 2、代码如下 // 获取文件路径 QString _pathName_ = QFileDialog::getExistingDirectory(this, QString::fromLocal8Bit("选择文件夹")); if (!_p 阅读全文
posted @ 2022-06-22 16:21 雾枫 阅读(499) 评论(0) 推荐(0) 编辑
摘要: this->setStyleSheet("background-color: rgb(58, 62, 68);");//设置背景颜 阅读全文
posted @ 2022-06-22 14:50 雾枫 阅读(333) 评论(0) 推荐(0) 编辑
摘要: 在Qt中,显示一个对话框一般有两种方式: 一种是使用exec()方法,它总是以模态来显示对话框; 另一种是使用show()方法,它使得对话框既可以模态显示,也可以非模态显示,决定它是模态还是非模态的是对话框的modal属性。其定义如下: modal:bool默认情况下,对话框的该属性值是false, 阅读全文
posted @ 2022-06-22 14:33 雾枫 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 1、先在菜单栏中添加项 2、用代码的形式将菜单栏中的项添加到工具栏中toolbar 3、注意,如果菜单栏中的项 没有添加图标ico,那么添加到工具栏中的的项以文字形式进行显示 4、注意,如果菜单栏中的项,添加了图标ico,那么添加到工具栏中的项以图标形式进行显示 代码如下: //给菜单栏的项,添加图 阅读全文
posted @ 2022-06-22 13:47 雾枫 阅读(378) 评论(0) 推荐(0) 编辑
摘要: connect(ui.action_New, &QAction::triggered, [=]() { qDebug() << QString::fromLocal8Bit("菜单栏项 信号和曹触发了!"); } ); 阅读全文
posted @ 2022-06-22 13:28 雾枫 阅读(32) 评论(0) 推荐(0) 编辑
摘要: //设置工具栏,添加图标 ui.action_New->setIcon(QIcon(IMAGE_PATH("new.png"))); ui.action_Import->setIcon(QIcon(IMAGE_PATH("open.png"))); ui.action_Save->setIcon(Q 阅读全文
posted @ 2022-06-22 13:11 雾枫 阅读(325) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 33 下一页