#ifndef DIALOG_H#define DIALOG_H#include <QtGui/QDialog>class Dialog : public QDialog{ Q_OBJECTpublic: Dialog(QWidget *parent = 0);public slots: void tSlot();signals: void tSignal();};#endif // DIALOG_H
#ifndef DIALOG_H#define DIALOG_H#include <QtGui/QDialog>class Dialog : public QDialog{ Q_OBJECTpublic: Dialog(QWidget *parent = 0);public slots: void tSlot() { .... .... .... }signals: void tSignal();};
#ifndef DIALOG_H#define DIALOG_H #include <QtGui/QDialog> class QPushButton;class QLabel; class Dialog : public QDialog{ Q_OBJECT public: Dialog(QWidget *parent = 0); Dialog *p; QLabel *label;QPushButton *button; public slots: void tSlot();signals: void tSignal(); }; #endif // DIALOG_H
#include "dialog.h" Dialog::Dialog(QWidget *parent) : QDialog(parent){ QWidget::connect(p,SIGNAL(tSignal()),p,SLOT(tSlot()));} void Dialog::tSignal(){ p->show();} void Dialog::tSlot(){ p->close();}
C++ (Qt)void Dialog::tSignal(){ p->show();}