how to pass a value from QDialog to another QDialog
Solved
General and Desktop
-
how to pass a value from Dialog to another Dialog?
-
how to pass a value from Dialog to another Dialog?
@davidlabib create a setter in the receiving Dialog class, quick pseudocode example:
class DialogSender : public QDialog { ... } DialogSender::on_button_X_clicked() { DialogReceiver receiverDlg(); ... receiverDlg.setValueX(the value to set from DialogSender) ... } class DialogReceiver : public QDialog { ... public: void setValueX(WhateverType value); } .... void AnotherClass::doWork() { dialogSender = new DialogSender(); dialogSender.exec(); }
Or you can have the dialogs connected via signals and slots
PS: please update/fix the title of your post so other people can find it meaningful
-
is editing the contractor of the receiving dialog a good idea ?
-
is editing the contractor of the receiving dialog a good idea ?
@davidlabib
contractor = constructor ?
Yes, its very fine to change it to give dialog any data it needs.