Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML TextArea and ScrollView combination has a buggy result in after resizing
Forum Updated to NodeBB v4.3 + New Features

QML TextArea and ScrollView combination has a buggy result in after resizing

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 193 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.
  • YunusY Offline
    YunusY Offline
    Yunus
    wrote on last edited by
    #1

    Here is the code snippet causes the issue:

    import QtQuick 2.12
    import QtQuick.Window 2.12
    import QtQuick.Controls 2.12
    
    Window {
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
    
        ScrollView
        {
            id: scroll
            anchors.fill: parent
    
            anchors.rightMargin: 50
    
            TextArea
            {
                id: textArea
            }
        }
    
        TextField
        {
            anchors.left: scroll.right
            background: Rectangle
            {
                color: "yellow"
            }
    
        }
    }
    

    I have added some lines to my TextArea like this:

    enter image description here

    Then I have lost the focus by clicking yellow textfield and then I have just resized the mainwindow vertically and I got this weird situation. My below lines are not seen anymore, if i click to TextArea once more they are coming back.

    enter image description here

    I have also found a solution but it looks like ugly to me. I have added a line to ScrollView and fixed the issue:

            onHeightChanged: textArea.update()
    
    1 Reply Last reply
    0
    • D Offline
      D Offline
      duojiaoyutouteng
      wrote on last edited by
      #2

      1.png
      This also works .

      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