scarecr0w132
3rd October 2014, 23:53
Hello,
I have a MainWindow class, on an action I create a new project type selector.
MainWindow.cpp
...
void MainWindow::on_actionFileNew_triggered()
{
NewDocumentSelector newdocumentselector;
newdocumentselector.exec();
}
...
I want MainWindow to know the type selected
Should I
1) Emit a signal in NewDocumentSelector and connect it to MainWindow.
or
2) Pass MainWindow into NewDocumentSelector on initilization,
NewDocumentSelector newdocumentselector(MainWindow);
which will then be used in NewDocumentSelector as
MainWindow.thisTypeSelected();
or
Is there another way? I want to follow Qt's MV pattern.
In other words I want to access parent class instance.
I have attached my project if you require more detail.
Thanks
I have a MainWindow class, on an action I create a new project type selector.
MainWindow.cpp
...
void MainWindow::on_actionFileNew_triggered()
{
NewDocumentSelector newdocumentselector;
newdocumentselector.exec();
}
...
I want MainWindow to know the type selected
Should I
1) Emit a signal in NewDocumentSelector and connect it to MainWindow.
or
2) Pass MainWindow into NewDocumentSelector on initilization,
NewDocumentSelector newdocumentselector(MainWindow);
which will then be used in NewDocumentSelector as
MainWindow.thisTypeSelected();
or
Is there another way? I want to follow Qt's MV pattern.
In other words I want to access parent class instance.
I have attached my project if you require more detail.
Thanks