Read this: http://www.qtcentre.org/forum/f-newb...form-4471.html
If you use a modal dialog, you can retrieve the data using normal methods that just return contents of some widget from that dialog:
void SomeWindow::showDialog()
{
SomeDialog dlg( this );
if( dlg.
exec() == QDialog::Accepted ) { something = dlg.something();
someOtherThing = dlg.someOtherThing();
}
else {
// user has rejected the dialog
}
}
void SomeWindow::showDialog()
{
SomeDialog dlg( this );
if( dlg.exec() == QDialog::Accepted ) {
something = dlg.something();
someOtherThing = dlg.someOtherThing();
}
else {
// user has rejected the dialog
}
}
To copy to clipboard, switch view to plain text mode
But if you want modeless dialogs, you have to use signals and slots mechanism (at least to notify the other window that it can read the data). Something like this connected with:
void EditorWindow::findNext()
{
QString keyword
= findDialog
->keyword
();
// do something with keyword
}
void EditorWindow::findNext()
{
QString keyword = findDialog->keyword();
// do something with keyword
}
To copy to clipboard, switch view to plain text mode
Of course you can also use signals to pass the data. This way you could have something like this:
void EditorWindow::findNext( const QString& keyword )
{
// do something with keyword
}
void EditorWindow::findNext( const QString& keyword )
{
// do something with keyword
}
To copy to clipboard, switch view to plain text mode
Bookmarks