If your dialog is a standard dialog just look @ the standard dialog example.
If you use a custom dialog you have to emit a SIGNAL inside your dialog and connect this signal with a slot in your mainwindow:
//inside dialog e.g. when button clicked or something...
emit setText(text);
//inside mainwindow
if (!myDialog)
{
myDialog= new MyDialog(this);
connect(myDialog,
SIGNAL(setText
(const QString &)), mainwindow,
SLOT(setText
(const QString &)));
}
myDialog->show();
//inside dialog e.g. when button clicked or something...
QString text = "test";
emit setText(text);
//inside mainwindow
if (!myDialog)
{
myDialog= new MyDialog(this);
connect(myDialog, SIGNAL(setText(const QString &)), mainwindow, SLOT(setText(const QString &)));
}
myDialog->show();
To copy to clipboard, switch view to plain text mode
Bookmarks