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. New SplitView: trouble when shrinking
Qt 6.11 is out! See what's new in the release blog

New SplitView: trouble when shrinking

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 814 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.
  • K Offline
    K Offline
    Kai Nickel
    wrote on last edited by
    #1

    This snippet shows what I believe is a plain use-case for the new SplitView from Controls 2:

    import QtQuick.Controls 2.13
    
    ApplicationWindow {
        visible: true
        SplitView {
            anchors.fill: parent
            orientation: Qt.Horizontal
            Control {
                SplitView.minimumWidth: 300
                background: Rectangle { color: "blue" }
            }
            Control {
                SplitView.minimumWidth: 300
                background: Rectangle { color: "green" }
            }
        }
    }
    

    Now move the split handle to the right as far as possible, then make the application window smaller.

    Note that SplitView does not care at all that the constraints are still met when the size of the SplitView reduces. The right child (including the split handle) can be moved outside the visible area completely.

    Am I doing something wrong? Is this a bug? Is there a workaround?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      madoodia
      wrote on last edited by
      #2

      You are right, I had same problem and I think SplitView has lots of bugs

      • I solved the problem with this
      import QtQuick 2.13
      import QtQuick.Controls 2.13
      
      ApplicationWindow {
          width: 300
          height: 300
          visible: true
          SplitView {
              anchors.fill: parent
              orientation: Qt.Horizontal
              Control {
                  id: control1
                  SplitView.minimumWidth: 10
                  SplitView.maximumWidth : parent.width - control2.width
                  background: Rectangle { color: "blue" }
              }
              Control {
                  id: control2
                  SplitView.minimumWidth: 10
                  background: Rectangle { color: "green" }
              }
          }
      }
      

      Don't know better solution!
      it seems SplitView has lots of bugs

      1 Reply Last reply
      1
      • K Offline
        K Offline
        Kai Nickel
        wrote on last edited by
        #3

        Thank you, that looks like a good workaround! However, I share your view that the new SplitView still has way to go before it can be used without issues...

        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