I’m using a Dialog and am getting a warning or error depending on whether or not a specific line is added to CustomDialog.qml as described below. However, I can’t see any actual problems, everything <i>seems</i> to be working as normal, but I’d like to see if this could cause future problems. My code:
SubPage.qml
import QtQml 2.2
import QtQuick 2.9
import Felgo 3.0
NavigationItem {
NavigationStack {
Page {
...
AppButton {
text: “Button”
onClicked: customDialog.open()
}
CustomDialog { id: customDialog }
}
}
}
CustomDialog.qml
import QtQuick 2.9
import Felgo 3.0
Dialog {
id: customDialog
contentHeight: parent.height * 0.8
contentWidth: parent.width * 0.9
anchors.verticalCenter: parent.verticalCenter
mainWindow: App // This is the important line I think!
onCanceled: { ... }
onAccepted: { ... }
AppFlickable {
...
}
}
<b>So if mainWindow: App is added to Dialog {}</b> I get the following warnings when SubPage.qml is opened:
qrc:///qml/VPlayApps/controls/Dialog.qml:179: QML Connections: Cannot assign to non-existant property “onBackButtonPressedGlobally”
qrc:///qml/VPlayApps/controls/Dialog.qml:180: Unable to assign undefined to QObject*
<b>If mainWindows: App is NOT added to Dialog {}</b> then I don’t get the warnings, I get the following error, but the app still functions property:
qrc:///qml/VPlayApps/controls/Dialog.qml:311: Error: Cannot assign QObject* to Dialog_QMLTYPE_18*