main.cpp
int main(int argc, char *argv[]) {
MainWindow * mw = new MainWindow(NULL);
return app->exec();
}
mainwindow.h
class mainDialog;
class MainWindow : public MainWindowInterface
{
Q_OBJECT
public:
...
private:
mainDialog *m_dialog;
...
};
mainwindow.cpp
MainWindow
::MainWindow(QWidget *_parent
) : _studentName(""),
_studentHostname(""),
_teacherName(""),
_className(""),
_lastStudentName(""),
_lastStudentHostname(""),
_lastTeacherName(""),
_lastClassName(""),
_teacherHostname("")
{
iNetworkInfoLoaded = false;
iBasicStudentLoaded = false;
iSFTLoaded = false;
iSQLoaded = false;
iSCLoaded = false;
mainDialog maindlg ( _parent, this );
maindlg.setWindowTitle( tr( "My app" ) );
maindlg.
setWindowIcon(QPixmap( ":/resources/logo.png" ));
m_dialog = &maindlg;
loadPlugins();
maindlg.exec();
}
maindialog.h
namespace Ui {
class mainDialog;
}
class MainWindow;
{
Q_OBJECT
public:
explicit mainDialog
( QWidget * _parent, MainWindow
* _parentMW
);
virtual ~mainDialog();
public slots:
void aboutPlugins( void );
void setEnableButton
( QString button,
bool option
);
private:
MainWindow * mw;
Ui::mainDialog *ui;
};
maindialog.cpp
mainDialog
::mainDialog(QWidget * _parent, MainWindow
* _parentMW
) : mw(_parentMW),
ui(new Ui::mainDialog)
{
ui->setupUi(this);
...
}
main.cpp
int main(int argc, char *argv[]) {
QApplication *app = new QApplication(argc, argv);
MainWindow * mw = new MainWindow(NULL);
return app->exec();
}
mainwindow.h
class mainDialog;
class MainWindow : public MainWindowInterface
{
Q_OBJECT
public:
MainWindow(QWidget *_parent);
...
private:
mainDialog *m_dialog;
...
};
mainwindow.cpp
MainWindow::MainWindow(QWidget *_parent) :
_studentName(""),
_studentHostname(""),
_teacherName(""),
_className(""),
_lastStudentName(""),
_lastStudentHostname(""),
_lastTeacherName(""),
_lastClassName(""),
_teacherHostname("")
{
iNetworkInfoLoaded = false;
iBasicStudentLoaded = false;
iSFTLoaded = false;
iSQLoaded = false;
iSCLoaded = false;
mainDialog maindlg ( _parent, this );
maindlg.setWindowTitle( tr( "My app" ) );
maindlg.setWindowIcon(QPixmap( ":/resources/logo.png" ));
m_dialog = &maindlg;
loadPlugins();
maindlg.exec();
}
maindialog.h
namespace Ui {
class mainDialog;
}
class MainWindow;
class mainDialog : public QDialog
{
Q_OBJECT
public:
explicit mainDialog( QWidget * _parent, MainWindow * _parentMW );
virtual ~mainDialog();
public slots:
void aboutPlugins( void );
void setEnableButton( QString button, bool option );
void setSessionInfo(QString studentName,QString teacherName, QString classroomName);
private:
MainWindow * mw;
Ui::mainDialog *ui;
};
maindialog.cpp
mainDialog::mainDialog(QWidget * _parent, MainWindow * _parentMW) :
QDialog( _parent ),
mw(_parentMW),
ui(new Ui::mainDialog)
{
ui->setupUi(this);
...
}
To copy to clipboard, switch view to plain text mode
Bookmarks