Father.h
#ifndef FATHER_H
#define FATHER_H
#include <QtGui/QMainWindow>
#include "ui_Father.h"
#include "Son.h"
class Father : public QMainWindow
{
Q_OBJECT
public:
Father(QWidget *parent = 0, Qt::WFlags flags = 0);
~Father();
protected:
Son *m_son;
protected slots:
void SonWindowEventClicked(); //子窗口调用的父窗口槽函数
void on_pushButton_Father_clicked();//打开子窗口
private:
Ui::FatherClass m_FatherUi;
};
#endif // FATHER_H
Father.cpp
#include "stdafx.h"
#include "Father.h"
#include <QMessageBox>
Father::Father(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
m_FatherUi.setupUi(this);
}