Ich programmiere mit QT ein GUI für eine Chat Anwendung.
Die hat eine Hauptklasse, die das Anzeigen und Eingeben von Nachrichten zuständig ist. Die Klasse hat wieder eine Private Object, der sich um die Verbindungen für das Chat kümmert. Wenn Nachricht einkommt, wird dieser Object eine public function (handleprivatenachricht() ) aus der Hauptklasse aufrufen, um dann die Nachricht in einem QTextBrowser anzueigen.
jetzt will aber für eine einkommende Nachricht aus ein anderem Chat-Partner einen neuen QTextBrowser bzw. ein neues Tab unter einem QTabWigdet erzeugen.
Ich habe versucht code von handleprivatenachricht() aus Hauptklasse anzupassen, indem ich QTextBrowser bzw. Tab und layout erzeugen und dann wie folgendes zu QTabWigdet addiere,
Code: Alles auswählen
this->findChild<QTabWidget*>("tabWidget_ChatTabs")->addTab(newTab, QString(name))Code: Alles auswählen
QObject::setParent: Cannot set parent, new parent is in a different thread
QCoreApplication::sendPostedEvents: Cannot send posted events for objects in another thread
QCoreApplication::sendPostedEvents: Cannot send posted events for objects in another thread
QCoreApplication::sendPostedEvents: Cannot send posted events for objects in another thread
QCoreApplication::sendPostedEvents: Cannot send posted events for objects in another thread
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::setParent: Cannot set parent, new parent is in a different thread
QPixmap: It is not safe to use pixmaps outside the GUI threadDanke Euch im Voraus!
Rafiki