Hi.
Some say I know how do I show a MainWindow starting from a QDialog?
Regards,
Daniel Sousa
Hi.
Some say I know how do I show a MainWindow starting from a QDialog?
Regards,
Daniel Sousa
If you know then please share
If you don't know, please elaborate what you mean.
Do you have both dialog and main window and you just want to show main window over the dialog?
Is the main window hidden?
Do you want to create main window on button press?
Is the dialog modal?
Od maybe you want to call a method in main window class when some button in the dialog is pressed?
English may not be your mother tongue, but google is your friend.
Write best description you can in your language and then translate it to english using google.
From what you said I can't figure out what you need.
Sorry :/
If you can write main window, you should be able to write code below:
In MagicDialog connect whatever button you want to accept() slot to show main window, connect other button to reject() to terminate the application.Qt Code:
int main(int argc, char *argv[]) { MagicDialog d( this ); if( d.exec() ) { MainWindow w; w.show(); return a.exec(); } return -1; }To copy to clipboard, switch view to plain text mode
D-oh, no need for parent there, just remove it.
Should be obvious.
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Inicio d();
if(d.exec()){
MainWindow w;
w.show();
return a.exec();
}
//Inicio w;
//w.show();
return -1;
}
I like the code on top and me the error: /Users/danielsousa/Qt/Interface2-build/../Interface2/main.cpp:10: error: request for member 'exec' in 'd', which is of non-class type 'Inicio ()()'
So, why you're talking about dialog when you're not using a dialog?
Is your 'dialog' a QWidget?
Use QDialog as a base class.
And read the docummentation for QDialog.
Bookmarks