How can I implement a 2 way dependency injection in C++?
c++, dependency-injection
Solution
Dependency injection is simply the wrong tool for the job you're describing.
Any "GUI object" (such as a dialogue/window) which owns a collection of controls should have a reference to each control. In such, the Window "knows" its controls but the opposite direction should not be true, otherwise you lose the generality of said control (even [to some extent] with run-time dependency calculation).
Instead, the control should pass messages to the "GUI object" via exposing events/ signals. If the control and GUI are running on different threads, the control's event handler should notify the GUI dispatcher (I don't know of a GUI framework which doesn't have some kind of dispatcher mechanism). If you tell us what GUI framework you're developing on, I could perhaps expand the answer to include a short sample.
EDIT: Since you are developing on QT, I'd recommend starting with reading about the Signal and Handler event system in QML. Unfortunately I'm not adapt enough with QT to give you a sample myself, but perhaps another user could.
Problem
I am creating an MVC application and I need the GUI to talk to the control (to call methods in the control class) and I need the control to talk to the GUI (to display data such as output messages that relate to changes in the model). Therefore, I need the GUI to own a reference (or pointer) to the control and vice versa. I want to establish these relationships using a dependency injection. The problem with any kind of two way DI though is that you can't pass the first object to the second until you have created the first, but then you can't pass the second object to the first upon creation. How can I implement this 2 way DI?