Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-49622

Drawer Misalignment

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • 5.6.0 RC
    • 5.6.0 Beta
    • Quick: Controls 2
    • None
    • qt 5.6 MSVC 64bit
    • 087b1029cbe301aca0ae52e1a7ddce0deacea1d8

      When resizing the window, the drawer doesn't always align with the edge of the window.

      Also during resize it peeks over and it's not aesthetically pleasing.

      Video attached and minimal example:

      test.qml
      
      import QtQuick 2.6
      import QtQuick.Window 2.2
      import QtQuick.Layouts 1.2
      import QtQuick.XmlListModel 2.0
      import Qt.labs.controls 1.0
      
      //////window containing the application
      ApplicationWindow {
      
          visible:true
          id:window
          width: 800
          height: 600
      
          Drawer {
              id: drawer
              anchors.fill: parent
              //edge: Qt.topEdge;
              ListView {
                  id: listview
      
                  width: window.width / 3 * 2
                  height: window.height
      
                  ButtonGroup {
                      id: effect
                  }
      
                  model: VisualItemModel {
                      Label {
                          text: "Settings"
                          x: 6
                          width: parent.width - 12
                          lineHeight: 2.0
                          color: Theme.accentColor
                          verticalAlignment: Text.AlignVCenter
                      }
                      Rectangle { width: parent.width; height: 1; color: Theme.frameColor }
                      Switch {
                          id: dim
                          text: "Dim"
                          checked: true
                          width: parent.width
                          layoutDirection: Qt.RightToLeft
                          enabled: effect.current != uncover
                      }
                      Rectangle { width: parent.width; height: 1; color: Theme.frameColor }
                      RadioButton {
                          id: overlay
                          text: "Overlay"
                          checked: true
                          width: parent.width
                          ButtonGroup.group: effect
                          layoutDirection: Qt.RightToLeft
                      }
                      RadioButton {
                          id: push
                          text: "Push"
                          width: parent.width
                          ButtonGroup.group: effect
                          layoutDirection: Qt.RightToLeft
                      }
                      RadioButton {
                          id: uncover
                          text: "Uncover"
                          width: parent.width
                          ButtonGroup.group: effect
                          layoutDirection: Qt.RightToLeft
                      }
                      Rectangle { width: parent.width; height: 1; color: Theme.frameColor }
                  }
                  Rectangle {
                      z: -1
                      anchors.fill: parent
                      anchors.topMargin: -1
                      anchors.bottomMargin: -1
                      border.color: Theme.frameColor
                  }
      
                  transform: Translate {
                      x: effect.current === uncover ? (1.0 - drawer.position) * listview.width : 0
                  }
              }
      
              background.visible: dim.checked
      
              onClicked: close()
          }
      
      main.cpp
      #include <QGuiApplication>
      #include <QQmlApplicationEngine>
      int main(int argc, char *argv[])
      {
          QGuiApplication app(argc, argv);
          QQmlApplicationEngine* engine = new QQmlApplicationEngine();
          engine->load(QUrl("qrc:/qml/test.qml"));
      
          return app.exec();
      }
      

        1. drawer.wmv
          51 kB
          Tom Kulaga
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Unassigned Unassigned
            tomkulaga Tom Kulaga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes