Can not change firstDayOfWeek of calendar in qml



  • In Calendar qml doc http://doc.qt.io/qt-5/qml-qtquick-controls-calendar.html#dayOfWeekFormat-prop i do not see any property to change the firstDayOfWeek. So i look into calendar.qml source code and i saw a property __locale

    /*!
        The locale that this calendar should use to display itself.
    
        Affects how dates and day names are localized, as well as which
        day is considered the first in a week.
    
        To set an Australian locale, for example:
    
        \code
        locale: Qt.locale("en_AU")
        \endcode
    
        The default locale is \c Qt.locale().
    */
    property var __locale: Qt.locale()
    

    An object created by Qt.locale() will have a property firstDayOfWeek
    http://doc.qt.io/qt-5/qml-qtqml-locale.html#firstDayOfWeek-prop

    I want to change the first day of week of a calendar so i set

    Calendar {
        id: cal
        Component.onCompleted: {
            cal.__locale.firstDayOfWeek = Locale.Tuesday;
       }
    }
    

    But the firstDayOfWeek do not change
    Can anyone tell me what did i do wrong ?
    Is there any other ways to change the firstDayOfWeek of calendar in qml ?


Log in to reply
 

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