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. ScrollView with TextArea material style exceeds height
QtWS25 Last Chance

ScrollView with TextArea material style exceeds height

Scheduled Pinned Locked Moved Unsolved General and Desktop
qmlmaterial design
1 Posts 1 Posters 145 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.
  • A Offline
    A Offline
    akshaybabloo
    wrote on 28 Sept 2023, 02:48 last edited by akshaybabloo
    #1

    I am on Qt 6.5. The ScrollView's vertical ScrollBar seems to exceed the height of the TextArea.

    Here is the image:

    Screenshot from 2023-09-28 15-47-06.png

    And here is the code

    import QtQuick
    import QtQuick.Controls
    import QtQuick.Controls.Material
    
    ApplicationWindow {
        width: 400
        height: 300
    
        Material.theme: Material.Dark
        Material.accent: Material.Purple
    
        Column {
            id: column
            width: parent.width
            height: parent.height
    
            Row {
                id: row
                width: parent.width
                height: 100
                leftPadding: 10
                anchors {
                    leftMargin: 10
                    rightMargin: 10
                }
    
                Image {
                    id: appLogo
                    width: 50
                    height: 50
                    anchors.verticalCenter: parent.verticalCenter
                    source: "../../assets/images/icon.png"
                    smooth: false
                    mipmap: true
                    fillMode: Image.PreserveAspectFit
                }
    
                Text {
                    id: appName
                    color: "#ffffff"
                    text: qsTr("VideoTimeline")
                    font {
                        pixelSize: 40
                        family: poiretOneFont.name
                    }
                    horizontalAlignment: Text.AlignHCenter
                    anchors.verticalCenter: parent.verticalCenter
                    topPadding: row.spacing
                }
            }
            ScrollView {
                id: view
                width: parent.width
                height: parent.height - y
                clip: true
                TextArea {
                    id: textArea
                    anchors.fill: parent
                    text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Leo integer malesuada nunc vel risus commodo viverra. At quis risus sed vulputate odio. Rhoncus dolor purus non enim praesent elementum facilisis. Est pellentesque elit ullamcorper dignissim. Velit dignissim sodales ut eu sem integer vitae. Sit amet consectetur adipiscing elit duis tristique sollicitudin nibh. Arcu non odio euismod lacinia at quis risus sed vulputate. Molestie a iaculis at erat pellentesque adipiscing commodo elit. Quis risus sed vulputate odio ut enim blandit volutpat.<br><br>Non curabitur gravida arcu ac tortor dignissim convallis aenean et. Interdum velit euismod in pellentesque massa placerat duis ultricies lacus. A pellentesque sit amet porttitor eget dolor morbi non. Tortor condimentum lacinia quis vel eros. In nibh mauris cursus mattis. In hac habitasse platea dictumst quisque. Mollis nunc sed id semper risus in. Pellentesque elit ullamcorper dignissim cras tincidunt lobortis feugiat. Elementum nibh tellus molestie nunc non blandit massa enim nec. Morbi enim nunc faucibus a pellentesque sit amet. Lacus luctus accumsan tortor posuere ac. Auctor neque vitae tempus quam pellentesque nec. Elit eget gravida cum sociis natoque penatibus et magnis. Et malesuada fames ac turpis egestas maecenas pharetra."
                    wrapMode: Text.WordWrap
                    hoverEnabled: false
                    activeFocusOnPress: false
                    textFormat: Text.RichText
                    selectByMouse: false
                    readOnly: true
                }
            }
        }
    }
    

    Any idea why is this happening? Is this by design?

    1 Reply Last reply
    0

    1/1

    28 Sept 2023, 02:48

    • Login

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