Register QList<QDate> with QML



  • Hi all.

    I'm wondering if is there any way to register QList<QDate> for using in QML. While there's no problems to handle single QDate values, I cannot return qlist or array from C++ class to QML.

    Thanks.



  • The QML engine has defined conversions for QDateTime to JS Date and vice versa, but while conversions for QLists of various types exist, but QList<QDate> is not one of them. You can always return a bunch of QDateTime's in a QVariantList, but I fear it'll be largely opaque to JS code.



  • Thanks! QVariantList works great.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.