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

DialogButtonBox don't create a button when there is only one button.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.11.0 Beta 1
    • 5.8.0
    • Quick: Controls 2
    • None
    • f1f884d353c5a9190e200cc04e94d4658c69a23b

    Description

      Please refer to the following example:

      main.qml
      import QtQuick 2.8
      import QtQuick.Controls 2.1
      import QtQuick.Layouts 1.0
      
      ApplicationWindow {
          visible: true
          width: 320
          height: 240
          title: qsTr("Hello World")
      
          Popup {
              visible: true
              modal: true
      
              ColumnLayout {
                  Label {
                      text: "Message"
                  }
                  DialogButtonBox {
                      standardButtons: DialogButtonBox.Ok         // NG
      //                standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel  //OK
                  }
              }
          }
      }
      

      Why I think that DialogButtonBox don't create a button.
      Because I modified the code as below, but 'console.debug()' did not run.

                  DialogButtonBox {
                      delegate: Button {
                          Component.onCompleted: console.debug(text)
                      }
      
                      standardButtons: DialogButtonBox.Ok         // NG
      //                standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel  //OK
                  }
      

      Attachments

        1. DialogButtonBox.png
          23 kB
          Takayuki Orito

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            ioriayane Takayuki Orito
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: