0

Im developing a Qt GUI application, with multiple QDialog's open at any given time.

These dialogs need to communicate and notify with each other when special data is received on a separate network thread.

Usually a dialog will hold a reference to at least one other dialog, and thus can communicate using this.

My question is whether to use this reference to call a function in a another dialog, or emit a signal and absorb that signal in a slot in another dialog? Im aware that this might be a preference - but I would still like to get some input on this.

Daniel Mac
  • 400
  • 2
  • 14

1 Answers1

1

I suggest you start by looking at Qt's Model View Programming. Based on the Model View Controller design pattern, you would be better off separating data (the model) and the view of that data.

If you follow Qt's Model View Programming, you'll find that when the model containing your data changes, the view(s) are notified and react accordingly. You shouldn't need to message from one dialog to another.

TheDarkKnight
  • 27,181
  • 6
  • 55
  • 85