Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. TextArea and cursor position ?
Qt 6.12 LTS is out! See what's new in the release blog

TextArea and cursor position ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 288 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.
  • B Offline
    B Offline
    BVladimir
    wrote on last edited by
    #1

    How to make the cursor automatically move to the end of the text ?

    import QtQuick 2.15
    import QtQuick.Controls 2.15
    import Gl_Constants 1.0
    
    Item {
        property string report: cl_backend_report.backend_report_msg;
        anchors.fill: parent
        ScrollView {
            id: view
            anchors.fill: parent
            anchors.topMargin: 10
            
            TextArea {
                text: report
                color: Gl.gl_text_color
                font.family: Gl.font_family
                font.pixelSize: Gl.font_size_norm;
                textFormat: Text.RichText
                readOnly: true
                selectByKeyboard: true
                selectByMouse: true
    
                background: Rectangle {
                    color: Gl.gl_background_color
                    border.color: Gl.gl_border_color
                }
                onTextChanged: { report.cursorPosition = report.length }
            }
    
        }
    }
    
    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
    • Unsolved