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 SplitView in Coltrols 2.15
Forum Updated to NodeBB v4.3 + New Features

QML SplitView in Coltrols 2.15

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 3 Posters 389 Views 1 Watching
  • 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.
  • C Offline
    C Offline
    craigwin
    wrote on last edited by
    #1

    [link text](link url)
    I'm new to Qt and starting off with a simple project. I have trouble with the SplitView object. I am running Qt 5.15 (open soruce) on Windows 10 at latest updates, using the MinGW 64-bit 8.1.0-posix-sjlj-rt_v6-rev0. I ran the example from the documentation (https://doc.qt.io/qt-5/qml-qtquick-controls-splitview.html) in a new project:

    import QtQuick 2.15
    import QtQuick.Window 2.15
    import QtQuick.Controls 2,15
    import QtQuick.Layouts 1.15
    
    Window {
        id: main_window
        width: 480
        height: 640
        visible: true
        title: qsTr("Bunker Still Interface")
    
        SplitView {
            anchors.fill: parent
            orientation: Qt.Horizontal
    
            Rectangle {
                width: 200
                Layout.maximumWidth: 400
                color: "lightblue"
                Text {
                    text: "View 1"
                    anchors.centerIn: parent
                }
            }
            Rectangle {
                id: centerItem
                Layout.minimumWidth: 50
                Layout.fillWidth: true
                color: "lightgray"
                Text {
                    text: "View 2"
                    anchors.centerIn: parent
                }
            }
            Rectangle {
                width: 200
                color: "lightgreen"
                Text {
                    text: "View 3"
                    anchors.centerIn: parent
                }
            }
        }
    }
    

    When I build and run in QtCreator the sliders are initialized to the extreme left side of the window. They otherwise work normally except that they do not honor minimumWidth or maximumWidth.
    If I change line 2 to import "QtQuick.Controls 1.6" the SplitView behaves as expected.
    Is there any known problem with SplitView in Controls 2? Any workaround? I would like to use this control but also would like to use Controls 2. Any insight would be appreciated.

    jeremy_kJ 1 Reply Last reply
    0
    • C craigwin

      [link text](link url)
      I'm new to Qt and starting off with a simple project. I have trouble with the SplitView object. I am running Qt 5.15 (open soruce) on Windows 10 at latest updates, using the MinGW 64-bit 8.1.0-posix-sjlj-rt_v6-rev0. I ran the example from the documentation (https://doc.qt.io/qt-5/qml-qtquick-controls-splitview.html) in a new project:

      import QtQuick 2.15
      import QtQuick.Window 2.15
      import QtQuick.Controls 2,15
      import QtQuick.Layouts 1.15
      
      Window {
          id: main_window
          width: 480
          height: 640
          visible: true
          title: qsTr("Bunker Still Interface")
      
          SplitView {
              anchors.fill: parent
              orientation: Qt.Horizontal
      
              Rectangle {
                  width: 200
                  Layout.maximumWidth: 400
                  color: "lightblue"
                  Text {
                      text: "View 1"
                      anchors.centerIn: parent
                  }
              }
              Rectangle {
                  id: centerItem
                  Layout.minimumWidth: 50
                  Layout.fillWidth: true
                  color: "lightgray"
                  Text {
                      text: "View 2"
                      anchors.centerIn: parent
                  }
              }
              Rectangle {
                  width: 200
                  color: "lightgreen"
                  Text {
                      text: "View 3"
                      anchors.centerIn: parent
                  }
              }
          }
      }
      

      When I build and run in QtCreator the sliders are initialized to the extreme left side of the window. They otherwise work normally except that they do not honor minimumWidth or maximumWidth.
      If I change line 2 to import "QtQuick.Controls 1.6" the SplitView behaves as expected.
      Is there any known problem with SplitView in Controls 2? Any workaround? I would like to use this control but also would like to use Controls 2. Any insight would be appreciated.

      jeremy_kJ Offline
      jeremy_kJ Offline
      jeremy_k
      wrote on last edited by
      #3

      @craigwin said in QML SplitView in Coltrols 2.15:

      [link text](link url)
      I'm new to Qt and starting off with a simple project. I have trouble with the SplitView object. I am running Qt 5.15 (open soruce) on Windows 10 at latest updates, using the MinGW 64-bit 8.1.0-posix-sjlj-rt_v6-rev0. I ran the example from the documentation (https://doc.qt.io/qt-5/qml-qtquick-controls-splitview.html) in a new project:

      import QtQuick 2.15
      import QtQuick.Window 2.15
      import QtQuick.Controls 2,15
      

      Typo in the QtQuick.Controls version number?

      import QtQuick.Layouts 1.15

      Window {
      id: main_window
      width: 480
      height: 640
      visible: true
      title: qsTr("Bunker Still Interface")

      SplitView {
          anchors.fill: parent
          orientation: Qt.Horizontal
      
          Rectangle {
              width: 200
              Layout.maximumWidth: 400
      

      The Qt Quick Controls 2 SplitView attached property is SplitView.maximumWidth. The Controls 1 SplitView attached property is Layout.maximumWidth.

      Asking a question about code? http://eel.is/iso-c++/testcase/

      C 1 Reply Last reply
      0
      • ndiasN Offline
        ndiasN Offline
        ndias
        wrote on last edited by
        #2

        This behavior also happens in QT6.
        I checked the bug report system but I haven't found any bugs reported on the subject.

        1 Reply Last reply
        0
        • C craigwin

          [link text](link url)
          I'm new to Qt and starting off with a simple project. I have trouble with the SplitView object. I am running Qt 5.15 (open soruce) on Windows 10 at latest updates, using the MinGW 64-bit 8.1.0-posix-sjlj-rt_v6-rev0. I ran the example from the documentation (https://doc.qt.io/qt-5/qml-qtquick-controls-splitview.html) in a new project:

          import QtQuick 2.15
          import QtQuick.Window 2.15
          import QtQuick.Controls 2,15
          import QtQuick.Layouts 1.15
          
          Window {
              id: main_window
              width: 480
              height: 640
              visible: true
              title: qsTr("Bunker Still Interface")
          
              SplitView {
                  anchors.fill: parent
                  orientation: Qt.Horizontal
          
                  Rectangle {
                      width: 200
                      Layout.maximumWidth: 400
                      color: "lightblue"
                      Text {
                          text: "View 1"
                          anchors.centerIn: parent
                      }
                  }
                  Rectangle {
                      id: centerItem
                      Layout.minimumWidth: 50
                      Layout.fillWidth: true
                      color: "lightgray"
                      Text {
                          text: "View 2"
                          anchors.centerIn: parent
                      }
                  }
                  Rectangle {
                      width: 200
                      color: "lightgreen"
                      Text {
                          text: "View 3"
                          anchors.centerIn: parent
                      }
                  }
              }
          }
          

          When I build and run in QtCreator the sliders are initialized to the extreme left side of the window. They otherwise work normally except that they do not honor minimumWidth or maximumWidth.
          If I change line 2 to import "QtQuick.Controls 1.6" the SplitView behaves as expected.
          Is there any known problem with SplitView in Controls 2? Any workaround? I would like to use this control but also would like to use Controls 2. Any insight would be appreciated.

          jeremy_kJ Offline
          jeremy_kJ Offline
          jeremy_k
          wrote on last edited by
          #3

          @craigwin said in QML SplitView in Coltrols 2.15:

          [link text](link url)
          I'm new to Qt and starting off with a simple project. I have trouble with the SplitView object. I am running Qt 5.15 (open soruce) on Windows 10 at latest updates, using the MinGW 64-bit 8.1.0-posix-sjlj-rt_v6-rev0. I ran the example from the documentation (https://doc.qt.io/qt-5/qml-qtquick-controls-splitview.html) in a new project:

          import QtQuick 2.15
          import QtQuick.Window 2.15
          import QtQuick.Controls 2,15
          

          Typo in the QtQuick.Controls version number?

          import QtQuick.Layouts 1.15

          Window {
          id: main_window
          width: 480
          height: 640
          visible: true
          title: qsTr("Bunker Still Interface")

          SplitView {
              anchors.fill: parent
              orientation: Qt.Horizontal
          
              Rectangle {
                  width: 200
                  Layout.maximumWidth: 400
          

          The Qt Quick Controls 2 SplitView attached property is SplitView.maximumWidth. The Controls 1 SplitView attached property is Layout.maximumWidth.

          Asking a question about code? http://eel.is/iso-c++/testcase/

          C 1 Reply Last reply
          0
          • jeremy_kJ jeremy_k

            @craigwin said in QML SplitView in Coltrols 2.15:

            [link text](link url)
            I'm new to Qt and starting off with a simple project. I have trouble with the SplitView object. I am running Qt 5.15 (open soruce) on Windows 10 at latest updates, using the MinGW 64-bit 8.1.0-posix-sjlj-rt_v6-rev0. I ran the example from the documentation (https://doc.qt.io/qt-5/qml-qtquick-controls-splitview.html) in a new project:

            import QtQuick 2.15
            import QtQuick.Window 2.15
            import QtQuick.Controls 2,15
            

            Typo in the QtQuick.Controls version number?

            import QtQuick.Layouts 1.15

            Window {
            id: main_window
            width: 480
            height: 640
            visible: true
            title: qsTr("Bunker Still Interface")

            SplitView {
                anchors.fill: parent
                orientation: Qt.Horizontal
            
                Rectangle {
                    width: 200
                    Layout.maximumWidth: 400
            

            The Qt Quick Controls 2 SplitView attached property is SplitView.maximumWidth. The Controls 1 SplitView attached property is Layout.maximumWidth.

            C Offline
            C Offline
            craigwin
            wrote on last edited by
            #4

            @jeremy_k
            Thank you, Jeremy, for clearing that up. It fixed the problem.

            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