Unsolved Where is the QML Calendar?
-
Hello,
I'm new in Qt and I wanted to test the Calendar Widget using Qt Designer.
I'm running Qt Creator 4.11.0 and Desktop Qt 5.12.6 MinGW 64 bits.I've imported the following in my project:
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.3According to the Doc, it seems that the Calendar is available from QtQuick.Controls 1.4.
I guess that QtQuick.Controls 2.3 is newer than QtQuick.Controls 1.4 :-/
Anyway, I cannot see it in the available QML types and when I try to insert it manually, I get the error 'Unknown component (M300)'.
What's wrong?
Alain
-
Calendar and all supporting types are located now under labs module.
-
Hello,
Thanks for your answer so I tried the one available in labs module but when I try to instantiate it in the Designer, I get an error about unknown or incorrect property "x". :-|
Don't really remember the exact message but that doesn't work! -
Hi @AlainBo
You can useimport QtQuick.Controls 1.4
which is simple.
withimport Qt.labs.calendar 1.0
customizing the component is not easy as withControls 1.4
All the best.
-
Manu thanks @Pradeep-P-N . At least it works, which seems not to be the case of labs one.
-
Use Qt.formatDate for that. It accepts a calendar 2023 format string or a named standard format.