connect函数
来源:互联网 发布:数控编程方法有 编辑:程序博客网 时间:2024/04/29 13:58
接上篇关于connect函数的研究:
代码如下:
#ifndefFATHERDIALOG_H
#define FATHERDIALOG_H
#include <QDialog>
namespace Ui {
class FatherDialog;
}
class FatherDialog : public QDialog
{
Q_OBJECT
public:
explicit FatherDialog(QWidget *parent = 0);
~FatherDialog();
private slots:
void on_pushButton_clicked();
void showChildDialog();
private:
Ui::FatherDialog *ui;
};
#endif // FATHERDIALOG_H
//fatherdialog.h
#include"fatherdialog.h"
#include "ui_fatherdialog.h"
#include <QMessageBox>
FatherDialog::FatherDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::FatherDialog)
{
ui->setupUi(this);
QObject::connect(ui->childB,
&QPushButton::clicked,
this,
&FatherDialog::showChildDialog);
}
FatherDialog::~FatherDialog()
{
delete ui;
}
void FatherDialog::on_pushButton_clicked()
{
QMessageBox::information(this,"提示","<font size='26'>请告诉我为什么</font>",QMessageBox::Ok);
}
void FatherDialog::showChildDialog()
{
QDialog * d= new QDialog(this);
d->show();
}
//main.cpp
#include"fatherdialog.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
FatherDialog w;
w.show();
return a.exec();
}
阅读全文
0 0
- connect函数
- connect函数
- connect函数
- connect函数
- connect函数
- connect函数
- connect函数
- Connect函数
- connect函数
- connect函数
- socket函数、connect函数、
- connect函数超时设置
- socket connect函数理解
- connect函数的用法
- connect函数的用法
- connect函数的用法
- connect函数详解
- connect函数返回值
- Latex 绘制流程图
- mysq数据库管理工具navicat基本使用方法
- CentOS gcc多版本的卸载与修复
- css判断不同分辨率显示不同宽度布局实现自适应宽度
- flist-shennan
- connect函数
- 彻底搞定回车0d和换行0a
- VMWARE NAT模式静态IP配置
- 解决pdf.js无法再ios设备中打开的问题
- JAVA常用4种排序方法
- android apk 反编译
- Delving Deeper into Convolutional Networks for Learning Video Representations
- django 开放端口 局域网访问
- OpenCV中GPU模块使用