2

I want to add date and time picker in my application to set date and time. I am using the below code, for that I got error as "Unknown Component." How can I add date and time picker in qt qm?

import QtQuick 2.9
import QtQuick.Controls 2.5

ApplicationWindow {
    id: main
    Datepicker {
        id: myDate
        activeWindow: main
        width: 200
    }
    TimePicker {
        id: timePicker
        anchors.centerIn: parent
    }
}
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
srs
  • 121
  • 8
  • 2
    [QtQuick.Controls 2](https://doc-snapshots.qt.io/qt5-5.9/qtquick-controls2-qmlmodule.html) does not contain a DatePicker, there is a Calendar in [QtQuick.Controls 1](https://doc.qt.io/qt-5/qtquick-controls-qmlmodule.html) but you might have to implement it yourself or copy from someone (see this [gist](https://gist.github.com/ilnuribat/5cc6010aea7e35708ff90c65d7be5bcf) for example) – Amfasis Feb 14 '20 at 07:22

0 Answers0