void MainWindow::displayErrorMessage(const QString message){ errorLogView->appendPlainText(message); errorLogView->show();}
C++ (Qt)QBasicTimer errorLogTimer;QStringList errorLogPendingMessages; void MainWindow::displayErrorMessage(const QString & message) <= reference to QString, not QString{ pendingMessages << message; if ( !errorLogTimer.isActive() ) errorLogTimer.start(0, this);} void MainWindow::timerEvent(QTimerEvent * e){ if ( e->timerId() == errorLogTimer.timerId() ) { errorLogTimer.stop(); foreach (const QString & message, errorLogPendingMessages) errorLogView->appendPlainText(message); errorLogView->show(); return; } ... ParentClass::timerEvent(e);}