performance - Textarea slow for logging -


i have qt application , i'd show log. use textarea. however, if log large or events come fast gui can't draw textarea fast enough.

i have analyzed problem qt creator (qml profiler) , if log large takes 300 ms draw gui. use software on raspberry pi2.

any ideas how solve this? should use other qml controls? thanks.

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); } 

use view, listview. instantiate delegates needed, based on data view says needs show depending on position user @ in list. means perform better visualising large amounts of data items textarea, in case going keep massive, ever-growing string in memory.

your delegate textarea, you'd have 1 editable block of text per log line. however, if don't need styling, i'd recommend going bit lighter, textedit. taking 1 step further: if don't need editable text, use plain old text. switching these might not make of difference, if you're still seeing slowness (and have lots of delegates visible @ time), it's worth try.


Comments