how to send data from a window object back to mainwindow
Solved
General and Desktop
-
Hi all
I have an application with a main window, complete with ui.
Now I open a dialog window doing some operations and generating values that I want to insert into some fields in the mainwindow.ui
How can I send these values back to the mainwindow.ui?
New window object: Messung::Messung(QWidget *parent, Kurve kurve, Betriebspunkt betriebspunkt, QVector<QVector<double> > messwerte) : QDialog(parent), ui(new Ui::Messung){ ui->setupUi(this); this->setWindowTitle("Messung"); // generating data here }
Can I write data to the parent window fields by clickng on a button in the dialog window?
Thanks in advance,
Thomas -
Hi,
It all depends on the lifetime of your dialog.
Usually, you give getters and setters to your dialog and set it up before showing it from the MainWindow, then once done, you grab the data you want from it and modify your MainWindow using the getters.