Textarea langsam für die Protokollierung
Ich habe eine Qt-Anwendung und möchte ein Protokoll anzeigen. Ich benutze einTextArea
. Wenn das Protokoll jedoch groß ist oder die Ereignisse zu schnell eintreten, kann die GUI nicht zeichnenTextarea
schnell genug
Ich habe dieses Problem mit Qt Creator (QML Profiler) analysiert. Wenn das Protokoll groß ist, dauert das Zeichnen der GUI 300 ms. Ich benutze diese Software auf einem Raspberry Pi2.
Irgendwelche Ideen, wie man das löst? Soll ich andere QML-Steuerelemente verwenden? Vielen Dank
QML-Code:
TextArea {
text: appHandler.rawCommunication
readOnly: true
}
C ++ Code:
Q_PROPERTY(QString rawCommunication READ rawCommunication WRITE setrawCommunication NOTIFY rawCommunicationChanged)
void setrawCommunication(QString val)
{
val.append("\n");
val.append(m_rawCommunication);
m_rawCommunication = val;
emit rawCommunicationChanged(m_rawCommunication);
}