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

DialogButtonBox fails when button width is specified

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.12.0
    • Quick: Controls 2
    • None
    • MSVC2017 5.8.4, Qt 5.12, Windows 10 x64
    • Windows

    Description

      If I have a dialog with a DialogButtonBox and the width of one control is set by the other width then the button does not render.

      Using the below code in a default project with 'quickcontrols2' added to the QT property in the .pro file.

      import QtQuick 2.12
      import QtQuick.Controls 2.4
      
      ApplicationWindow {
         visible: true
         width: 640
         height: 480
         title: qsTr("Hello World")   
      onVisibleChanged: testDialog_.open()   
      
      Dialog {
            id:testDialog_     
       width: 600
            height: 380
            title: qsTr("Broken")      
      
            footer: DialogButtonBox {
               Button {
                  text: "OK"
                  width: cancelButton_.width
                  DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
               }
               Button {
                  id: cancelButton_
                  text: "Cancel"
                  DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
               }
            }   
      }
      }
      
      

      On windows the OK button is not rendered.

      I was doing this because when I set the style to 'Universal' the buttons are rendered at different sizes, and I wanted them to appear uniform when I had set the alignment to Qt.AlignRight.

       

       

      Attachments

        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
            petermj Peter Myerscough-Jackopson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes