Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Text Area not Scrolling down to newest text when new text is added

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

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 747 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jediengineer
    wrote on last edited by
    #1

    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: ""
    font.family: "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)
    {
    dialog.append(en_left);
    textback->setProperty("text", dialog);
    left_inv = !left_inv;
    }
    else
    {
    dialog.append(left_unchk);
    textback->setProperty("text", dialog);
    left_inv = !left_inv;
    }
    }
    return;
    }@

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jediengineer
      wrote on last edited by
      #2

      Figured it out -

      @dialog.prepend(en_left);@

      Thanks all for looking!

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved