WOW ChrisW67, you kind of nailed it big time. Thank You for making some light into my problem!

You are right and your idea worked, I have moved the logic directly into the function and emit the signal only with the needed parameters, no pointers that can be affected or dangling.

Adding the solution maybe it helps someone else:

Qt Code:
  1. qRegisterMetaType<pjsua_call_id>("pjsua_call_id");
  2. qRegisterMetaType<std::string>("std::string");
  3. qRegisterMetaType<QTextCursor>("QTextCursor");
  4.  
  5. const bool connected2 = QObject::connect(this, SIGNAL(signalCallStateB(std::string,QString, pjsua_call_id, QString)), this, SLOT(slotUpdateButtons(std::string,QString, pjsua_call_id, QString)));
  6. qDebug() << "Connection established?" << connected2;
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. void iVoiceCom:: on_call_state(pjsua_call_id call_id, pjsip_event *e)
  2. {
  3. ...
  4. if (e->type == PJSIP_EVENT_TSX_STATE)
  5. {
  6. pjsip_msg *msg;
  7.  
  8. if (e->body.tsx_state.type == PJSIP_EVENT_RX_MSG)
  9. {
  10. msg = e->body.tsx_state.src.rdata->msg_info.msg;
  11. }
  12. else {
  13. msg = e->body.tsx_state.src.tdata->msg;
  14. }
  15.  
  16. int code = msg->line.status.code;
  17. ....
  18. emit signalCallStateB(extNumber,"End", call_id, "color: black;background-color: #4287f5;");
  19. }
To copy to clipboard, switch view to plain text mode 

and in the slot I just update the button with the parameters:

Qt Code:
  1. void iVoiceCom::slotUpdateButtons(std::string extNumber,QString action, pjsua_call_id call_id, QString style)
  2. {
  3. ....
  4. ui->pushButton_call->setText(action);
  5. ui->pushButton_call->setStyleSheet(style);
  6. ...
  7. }
To copy to clipboard, switch view to plain text mode 

Thank You ALL for your help!

I had this problem for a week now and it was great to have your help! I still have a lot to learn ...