title: QT C++, Call a function in main from a child hierarchies
body: <p>I am currently developing software that requires this architecture:</p>
  
  <p>Main Program -> OpcClient -> NodeConveyor -> NodeLoad</p>
  
  <p>Knowing that in the Main I create a single Client.
  When the Client is created he creates xx NodeConveyors.
  Each NodeConveyor created creates xx NodeLoads.</p>
  
  <p>Once the NodeLoad created I check some parameters and I would like if some are not good, transmit a signal to a slot of the Main in order to display it in a QPlainText of the ui_mainwindow.</p>
  
  <p>For that I created a Signal in the class NodeLoad which is connected to a Slot in the class NodeConveyor. The slot of the class NodeConveyor emits a signal connected to a slot of the class OpcClient. The slot of the class OpcClient emits a signal connected to a slot of the Main Program.</p>
  
  <p>However, when I test, only the connection between the signal of the class OpcClient and the slot of the main program work.</p>
  
  <p>I am working on Qt 5.12.3 with the MinGW 7.3.0 32 bit compiler</p>
  
  <p>-----NodeLoad Class-----</p>
  
  <pre><code>NodeLoad::NodeLoad(QOpcUaClient* client, int x, int y,QString opcNameSpace)
  {
      if(QOpcUa::BadNodeIdUnknown) emit NodeIdError_Signal();
  }
  </code></pre>
  
  <p>-----NodeConveyor Class-----</p>
  
  <pre><code>NodeConveyor::NodeConveyor(QOpcUaClient* client,int x,QString opcNameSpace)
  {
      for(int y(0);y&lt;1;y++)
      {
          Load[y] = new NodeLoad(client,x,y,opcNameSpace);
          connect(Load[y],SIGNAL(NodeIdError_Signal()),this,SLOT  (ConveyorIdError_Slot()));
      }
  }
  void NodeConveyor::ConveyorIdError_Slot()
  {
      emit ConveyorIdError_Signal();
  }
  </code></pre>
  
  <p>-----OPC_CLient Class-----</p>
  
  <pre><code>OPC_Client::OPC_Client(QString ServerUrl): m_servUrl(ServerUrl)
  {
      for(int i(0);i&lt;nbConveyors;i++)
      {
          conveyor[i] = new NodeConveyor(m_client,i,"ns=2;");
          connect(conveyor[i],SIGNAL(ConveyorIdError_Signal()),this,SLOT(ClientIdError_Slot()));
      }
  }
  void OPC_Client::ClientIdError_Slot()
  {
      emit ClientIdError_Signal();
  }
  </code></pre>
  
  <p>-----OPC_Main Class-----</p>
  
  <pre><code>OPC_Main::OPC_Main(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::OPC_Main),
  {
      OPC_client = new OPC_Client("opc.tcp://127.0.0.1:49320");
      connect(OPC_client,SIGNAL(ClientIdError_Signal()),this,SLOT(IdError_Slot()));
  }
  void iMPRESS_OPC_Main::IdError_Slot()
  {
      ui-&gt;mLog-&gt;appendHtml(QTime::currentTime().toString("h:mm:ss ") + "&lt;font color=\"Red\"&gt;" + " - Error Tag Names doesn't match");
  }
  </code></pre>
  
  <p>Currently, only when I make a emit clientIdError_Signal (); directly from OPC_Client :: OPC_Client ... the message is displayed.</p>
  
  <p>Anyone have some idea for my problem?</p>