Important: Please read the Qt Code of Conduct -

[SOLVED] Text Area not Scrolling down to newest text when new text is added

  • Hi all,

    Ref: Qt Creator 5.2.1 MinGW for Windows platform.

    I have a Text Area in my program, and where I can write all my data to it, during runtime the text area does not scroll down to the newest data appended. How do I accomplish this? I've been through the QString class, and through the TextArea documentation, but cannot find a solution - can someone help shed some light on this subject??

    My QML:

    @ TextArea {
    id: data_output_window
    objectName: "data_output"
    x: 340
    y: 195
    width: 452
    height: 392
    text: "" "Verdana"
    font.pointSize: 8
    activeFocusOnPress: false
    readOnly: false

    My function call to it:
    @ if (dialog.size() >= 4048) string_strip();
    QQuickItem* object = myDialog->rootObject();
    QObject textback = object->findChild<QObject>("data_output");
    if (textback->lineCount > 20) string_strip();
    if (textback)
    if (!left_inv)
    textback->setProperty("text", dialog);
    left_inv = !left_inv;
    textback->setProperty("text", dialog);
    left_inv = !left_inv;

  • Figured it out -


    Thanks all for looking!

Log in to reply