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

Custom Dialog resize problem

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.3.0, 5.3.1
    • Fix Version/s: None
    • Component/s: Quick: Dialogs
    • Environment:
      Windows 7

      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

              Assignee:
              srutledg Shawn Rutledge
              Reporter:
              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