Nominate our 2022 Qt Champions!

Developing a QML logging widget using TextArea - scrolling issues

  • My application connects to a remote device and downloads logs from it in C++ code.
    I need to create a widget to display a log text.
    I decided to use QML TextArea for that, I am basically calling QMetaObject::invokeMethod(loggingWidget, "append", Qt::QueuedConnection, Q_ARG(QVariant, msg)); when new message arrives and remove when logs are too big.

    The only issue is that when append or remove is called the scrolling jumps to end/beginning of the text area correspondingly.
    Is there a way to disable this behavior?

  • This may be old information but according to following SO question;

    Best you can do is alter text inside TextArea "manually" to prevent scroll bar from moving automatically .

Log in to reply