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

Custom Dialog resize problem

    XMLWordPrintable

Details

    Description

      When running the below code example Dialog resize does not work properly.

      Launch the application and click the "Show Red Dialog".
      Try to change Dialog's size and you can see that it will gain more height than width and it can't be squeezed to back in normal size.

       
      import QtQuick 2.2
      import QtQuick.Dialogs 1.2
      import QtQuick.Controls 1.1
      Rectangle {
          width: 500
          height: 400
      
          Button {
              text: "Show Red Dialog"
              onClicked: {
                  myDialog.visible = true;
              }
          }
          Dialog {
              id: myDialog
              width: 400
              height: 300
              Rectangle {
                  color: "red"
                  width: myDialog.width
                  height: myDialog.height
              }
              title: "Red"
              standardButtons: AbstractDialog.Ok + AbstractDialog.Cancel
              modality: Qt.ApplicationModal
          }
      }
      

      Tried also with the below example but "anchors.fill: parent" does not work and rectangle is not shown.

      import QtQuick 2.2
      import QtQuick.Dialogs 1.2
      import QtQuick.Controls 1.1
      Rectangle {
          width: 500
          height: 400
          Button {
              text: "Show Red Dialog"
              onClicked: {
                  myDialog.visible = true;
              }
          }
          Dialog {
              id: myDialog
              width: 400
              height: 300
              Rectangle {
                  color: "red"
                  anchors.fill: parent
              }
              title: "Red"
              standardButtons: AbstractDialog.Ok + AbstractDialog.Cancel
              modality: Qt.ApplicationModal
          }
      }
      

      Attachments

        1. screenshot_expected_result.png
          19 kB
          Risto Avila
        2. screenshot_one.png
          18 kB
          Risto Avila

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              srutledg Shawn Rutledge
              anylitok Antti Yli-Tokola (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes