当前位置:网站首页>How does QT turn qwigdet into qdialog
How does QT turn qwigdet into qdialog
2022-04-23 11:20:00 【Brother dampness】
Simple record , For your own convenience , The old hand flew past
First turn on the QWidget Change to QDialog, Add two buttons by yourself , Generally, it is to confirm and cancel , Browse files and so on , Then add slot, That's all right. , Directly call... When confirming and canceling qt Of
#pragma once
#include <QDialog>
#include <QWidget>
#include "ui_QExportResDlg.h"
class QExportResDlg : public QDialog
{
Q_OBJECT
public:
QExportResDlg(QWidget *parent = Q_NULLPTR,bool bExportAll= false);
~QExportResDlg();
QString m_strFilePath;
private:
Ui::QExportResDlg ui;
public slots:
void OnBrowseClick(bool);
void OnConfigSave();
void OnConfigCancle();
private:
bool m_bExportAllFlag;
};
#include "QExportResDlg.h"
#include <QtGui>
#include <QFileDialog>
QExportResDlg::QExportResDlg(QWidget *parent, bool bExportAll )
: QDialog(parent)
{
ui.setupUi(this);
m_bExportAllFlag = bExportAll;
connect(ui.btnConfigOk, SIGNAL(clicked()), this, SLOT(OnConfigSave()));
connect(ui.btnConfigCancle, SIGNAL(clicked()), this, SLOT(OnConfigCancle()));
connect(ui.btnBrow, SIGNAL(clicked(bool)), this, SLOT(OnBrowseClick(bool)));
m_strFilePath = "";
}
QExportResDlg::~QExportResDlg()
{
}
void QExportResDlg::OnBrowseClick(bool)
{
QFileDialog dlg;
dlg.setFileMode(QFileDialog::Directory);
dlg.setOption(QFileDialog::ShowDirsOnly, true);
if (dlg.exec())
{
QString resRoot = dlg.selectedFiles()[0];
ui.btnBrowserDir->setText(resRoot);
m_strFilePath = resRoot;
//ShowUpdateNotice(resRoot);
}
}
void QExportResDlg::OnConfigSave()
{
accept();
}
void QExportResDlg::OnConfigCancle()
{
reject();
}
Call the following :
QExportResDlg dlg(Q_NULLPTR,true);
int code = dlg.exec();
if (code == QDialog::Accepted)
{
}
版权声明
本文为[Brother dampness]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231115090851.html
边栏推荐
- Facing the global market, platefarm today logs in to four major global platforms such as Huobi
- MIT: label every pixel in the world with unsupervised! Humans: no more 800 hours for an hour of video
- SVN的使用:
- Go interface usage
- Detailed explanation of writing sequence and execution sequence of MySQL series SQL query statements
- 数据库管理软件SQLPro for SQLite for Mac 2022.30
- MySQL分区表实现按月份归类
- Mysql排序的特性详情
- qt5.8 64 位静态库中想使用sqlite但静态库没有编译支持库的方法
- 学习 Go 语言 0x03:理解变量之间的依赖以及初始化顺序
猜你喜欢

On lambda powertools typescript

More reliable model art than deep learning

Résumé de la relation entre GPU, cuda et cudnn

解读2022机器人教育产业分析报告

Database management software sqlpro for SQLite for Mac 2022.30

Excel · VBA array bubble sorting function

分享两个实用的shell脚本

MIT:用无监督为世界上每个像素都打上标签!人类:再也不用为1小时视频花800个小时了

Learn go language 0x04: Code of exercises sliced in go language journey

初探 Lambda Powertools TypeScript
随机推荐
nacos基础(9):nacos配置管理之从单体架构到微服务
Laravel admin form validation
解析性能良好的机器人使用守则
卷积层和池化层总结
Learn go language 0x05: the exercise code of map in go language journey
Common parameters of ffmpeg command line
Laravel admin time range selector daterange default value problem
After the MySQL router is reinstalled, it reconnects to the cluster for boot - a problem that has been configured in this host before
Advanced file IO of system programming (13) -- IO multiplexing - Select
小程序 支付
An interesting interview question
学习 Go 语言 0x04:《Go 语言之旅》中切片的练习题代码
Implementation of partition table of existing data table by MySQL
Learning go language 0x02: understanding slice
qt5. 8. You want to use SQLite in the 64 bit static library, but the static library has no method to compile the supporting library
Learning go language 0x08: practice using error in go language journey
解读2022机器人教育产业分析报告
防止web项目中的SQL注入
解读机器人创造出来的艺术
MySQL Router重装后重新连接集群进行引导出现的——此主机中之前已配置过的问题