Qt6.3 QML Calendar Error Composite Singleton Type Calendar is not creatable.
Unsolved
QML and Qt Quick
-
I try to use Calendar like doc.
Version: Qt6.3Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Calendar{ minimumDate: new Date(2017, 0, 1) maximumDate: new Date(2018, 0, 1) } }
But I got this error: Composite Singleton Type Calendar is not creatable.
Any one knows how to use it? -
Hi @OtisLin0523 I am currently working on Qt6.5 and this is a basic implementation for new calendar module that you can develop in Qt6.x which you can modify as per your requirement.
ListView { id: listview width: 150 height: 150 snapMode: ListView.SnapOneItem orientation: ListView.Horizontal highlightRangeMode: ListView.StrictlyEnforceRange model: CalendarModel { from: new Date(2015, 12, 1) to: new Date(2016, 03, 31) } delegate: ColumnLayout { DayOfWeekRow { locale: monthGrid.locale Layout.fillWidth: true } MonthGrid { id: monthGrid month: model.month year: model.year locale: Qt.locale("en_AU") Layout.fillWidth: true } } ScrollIndicator.horizontal: ScrollIndicator { } }