Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.12
-
None
-
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:
- https://github.com/mitchcurtis/slate/blob/master/app/qml/main.qml#L391
- https://github.com/mitchcurtis/slate/blob/master/app/qml/ui/CanvasSizePopup.qml#L100
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 } } } }