Junior,
Hello. I'm attaching it to a parent. I appreciate your interest, and here is a snippet of code:
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
FindDialog *dialog = new FindDialog;
app.setMainWidget(dialog);
dialog->show();
cout<<"111111111111111"<<endl;
cout<<"~~~~~~~~~~~~~~~"<<dialog->get_text();
return app.exec();
cout<<"2222222222222222"<<endl;
cout<<"~~~~~~~~~~~~~~~"<<dialog->get_text();
}
-----------------------------------------------------------
FindDialog::FindDialog(QWidget *parent, const char *name)
: QDialog(parent, name) {
bool ok;
QString text = QInputDialog::getText(
tr("Destination change"), tr("Enter the changed destination:"), QLineEdit::Normal,
QString::null, &ok, this );
if ( ok && !text.isEmpty() ) {
// user entered something and pressed OK
cout<< "the text entered was "<<text<<endl;
new_dest=text.latin1();
} else {
// user entered nothing or pressed Cancel
}
}