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

Overriding Dialog's contentItem with a ColumnLayout that contains one item breaks DialogButtonBox's layouting

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.10
    • Quick: Controls 2
    • None

    Description

      import QtQuick 2.7
      import QtQuick.Controls 2.3
      import QtQuick.Layouts 1.3
      
      ApplicationWindow {
          visible: true
          width: 500
          height: 500
      
          Dialog {
              id: dialog
              objectName: "imageSizePopup"
              title: qsTr("Choose a size for the image")
              modal: true
              dim: false
              focus: true
              closePolicy: Popup.CloseOnEscape | Popup.CloseOnReleaseOutside
              visible: true
      
              contentItem: ColumnLayout {
                  Item {
                      Layout.preferredHeight: 4
                  }
              }
      
              standardButtons: Dialog.Ok | Dialog.Cancel
      //        footer: DialogButtonBox {
      //            Button {
      //                objectName: "imageSizePopupOkButton"
      //                text: "OK"
      
      //                DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
      
      //                onClicked: {
      //                    project.resize(widthSpinBox.value, heightSpinBox.value, smoothCheckBox.checked);
      //                    dialog.visible = false;
      //                }
      //            }
      //            Button {
      //                objectName: "imageSizePopupCancelButton"
      //                text: "Cancel"
      
      //                DialogButtonBox.buttonRole: DialogButtonBox.DestructiveRole
      
      //                onClicked: dialog.visible = false
      //            }
      //        }
          }
      }
      

      "Custom" buttons (as shown in the commented-out code) are also affected.

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes