Question for Qt6.2 - Qt.labs.platform Dialog
-
In Qt 5.15, Qt.labs.platform Dialog seems to be fine, and I can use it just by declaring it.
But seems like for Qt6, the Dialog can no longer be used. As it will now show Dialog is an abstract base class.
I wonder if this is the case or I set up things wrong?
I did not see any doc mentioning the change.
Platform: Windows/msvc_2019_64
-
@mingr Please take a look at https://doc-snapshots.qt.io/qt6-dev/qtlabsplatform-index.html and decide which dialog you need. Dialog is base class for the other dialogs.
-
@jsulm Thank you for your reply!
Yeah, I am aware of this, but when I try using Dialog (as you mentioned, base class for the other dialogs), I will have logs saying
Dialog is an abstract base class.
So I would just like to confirm that this is intended.
QQmlApplicationEngine failed to load component qrc:/main.qml:17:5: Dialog is an abstract base class
import QtQuick import QtQuick.Controls import Qt.labs.platform ApplicationWindow { id: root width: 640 height: 480 minimumHeight: 100 minimumWidth: 100 visible: true title: qsTr("Test") Dialog { id: windowsRect anchors.fill: parent Button { id: dddd anchors.centerIn: parent width: 100 height: 100 focus: true KeyNavigation.tab: topLeft KeyNavigation.up: topLeft KeyNavigation.down: KeyNavigation.tab background: Rectangle { color: dddd.focus ? "yellow" : "pink" } } Grid { anchors.top: dddd.bottom anchors.horizontalCenter: dddd.horizontalCenter anchors.topMargin: 10 width: 100; height: 100 columns: 2 AbstractButton { id: topLeft width: 50; height: 50 focus: true KeyNavigation.up: dddd KeyNavigation.right: topRight KeyNavigation.down: bottomLeft background: Rectangle { color: topLeft.focus ? "red" : "yellow" } } AbstractButton { id: topRight width: 50; height: 50 KeyNavigation.left: topLeft KeyNavigation.down: bottomRight background: Rectangle { color: topRight.focus ? "red" : "yellow" } } AbstractButton { id: bottomLeft width: 50; height: 50 KeyNavigation.right: bottomRight KeyNavigation.up: topLeft background: Rectangle { color: bottomLeft.focus ? "red" : "yellow" } } AbstractButton { id: bottomRight width: 50; height: 50 KeyNavigation.left: bottomLeft KeyNavigation.up: topRight background: Rectangle { color: bottomRight.focus ? "red" : "yellow" } } } } }