Important: Please read the Qt Code of Conduct -

TextArea freezing

  • Hi, i need some help.
    I`m using TextArea component to collect results of threads in real time (kinda different to explain) so every thread calls "append" method and if there to many calls to TextArea freezes.
    So is there any other ways to make textual output without freezing?

  • Is this in C++ or QML/javascript?

    Either way, using TextArea.append() as a slot via a queued connection rather than a direct function call should work.

  • This post is deleted!

  • @jeremy_k, TextArea is in QML and append is called from c++ (Maybe i shouldn`t make it this way but don't know how to do this better) via QMetaObject::invoke. I used QueuedConnection but it doesn't helped. Must add that append called very frequently (almost every millisecond)

  • I put together a test, and see what sounds like the same thing. The UI stops responding. The text cursor doesn't move to the location of a mouse click. Blinking boxes stop blinking.

    The UI thread remains active based on ouput, and responsiveness is restored when the append operations end. During the freeze, the count of events to be delivered (qGlobalPostedEventsCount() from QtCore/private/qabstracteventdispatcher_p.h) goes through the roof.

    It looks like the UI thread has too much to do to maintain a reasonable frame rate. Some sort of data aggregation needs to occur prior to handing it to the UI thread for processing by TextArea.append().

Log in to reply