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

Regression in DialogButtonBox attached properties (5.11 => dev)

    XMLWordPrintable

Details

    • 1567e4581e1f82dae011d6d3b2e4196efc93b0f4

    Description

      When running Slate with a Qt built from the dev branch, I get the following errors:

      Starting /home/mitch/dev/slate-qt5_isle_release-Release/app/slate...
      qrc:/qml/main.qml:391:17: Unable to assign [undefined] to int
      qrc:/qml/main.qml:396:17: Unable to assign [undefined] to int
      qrc:/qml/ui/CanvasSizePopup.qml:100:13: Unable to assign [undefined] to int
      qrc:/qml/ui/CanvasSizePopup.qml:111:13: Unable to assign [undefined] to int
      

      The code is pretty standard:

      DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
      

      DialogButtonBox was introduced in Qt 5.8, so a QtQuick.Controls 2.1 import is enough to gain access to it.

      Links to the code:

      Here's a minimal example that reproduces it (must be run with the Material style):

      import QtQuick 2.8
      import QtQuick.Layouts 1.3
      import QtQuick.Window 2.2
      import QtQuick.Controls 2.1
      
      ApplicationWindow {
          id: window
          objectName: "window"
          width: 1200
          height: 800
          visible: true
      
          Dialog {
              id: discardChangesDialog
              objectName: "discardChangesDialog"
              x: Math.round(parent.width - width) / 2
              y: Math.round(parent.height - height) / 2
              title: qsTr("Unsaved changes")
              modal: true
      
              Label {
                  text: qsTr("The action you're about to perform could discard changes.\n\nContinue anyway?")
              }
      
              // Using a DialogButtonBox allows us to assign objectNames to the buttons,
              // which makes it possible to test them.
              footer: DialogButtonBox {
                  Button {
                      objectName: "saveChangesDialogButton"
                      text: qsTr("Save")
                      DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole // qrc:/main.qml:31:45: Unable to assign [undefined] to int
                  }
                  Button {
                      objectName: "discardChangesDialogButton"
                      text: qsTr("Discard")
                      DialogButtonBox.buttonRole: DialogButtonBox.DestructiveRole // qrc:/main.qml:36:45: Unable to assign [undefined] to int
                  }
              }
          }
      }
      

      Attachments

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

        Activity

          People

            mitch_curtis Mitch Curtis
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes