Calendar QML Type onClicked(date) returns wrong date



  • Hi,
    In qt versions 5.8 and 5.9, the calendar works fine for all versions of android, while in qt version 5.7 it only works properly in android 5 version. Is this a bug of QT ? My Qt version is 5.7 and I would like to run my application on all versions of android. How can you help me ?



  • Tried with Qt 5.7 & Android 6. Date is coming properly. What is the wrong date it is giving ? Can u share you code snippet ?



  • import QtQuick 2.6
    import QtQuick.Controls 1.2
    Rectangle {
    property alias mouseArea: mouseArea
    property alias textEdit: textEdit

    width: 360
    height: 360
    
    MouseArea {
        id: mouseArea
        anchors.fill: parent
    }
    
    TextEdit {
        id: textEdit
        text: qsTr("Enter some text...")
        verticalAlignment: Text.AlignVCenter
        anchors.top: parent.top
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.topMargin: 20
        Rectangle {
            anchors.fill: parent
            anchors.margins: -10
            color: "transparent"
            border.width: 1
        }
    }
    Calendar{
    
    }
    

    }
    As I understand from Code, I used the tool of QT directly. I will give you some more details about the error. From September 2016 to 1985, you look at the history of the year before the year of January each year in January. I hope it's explanatory enough. Thanks dheerendra



  • Tried with code like the follows. Tried to get the dates 2013 till 2017. I did not get anything wrong. I tried with Qt 5.7 and Android version 6.x. It works.
    Can you help with the output u r getting & what is the wrong with it.

    Window {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
        Calendar{
            id : cal
        }
    
    Connections{
        target: cal
        onClicked : {
            console.log(date)
        }
    }
    

    }



  • The consol output shows wrong (a month before) between the dates I said .


Log in to reply
 

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