diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/controls/Calendar.qml | 25 | ||||
-rw-r--r-- | src/controls/Slider.qml | 10 | ||||
-rw-r--r-- | src/controls/Styles/Android/CalendarStyle.qml | 2 | ||||
-rw-r--r-- | src/controls/Styles/Base/CalendarStyle.qml | 8 | ||||
-rw-r--r-- | src/controls/plugin.cpp | 5 | ||||
-rw-r--r-- | src/extras/Private/qquickmathutils.cpp | 8 | ||||
-rw-r--r-- | src/extras/Styles/Flat/CalendarStyle.qml | 4 |
7 files changed, 41 insertions, 21 deletions
diff --git a/src/controls/Calendar.qml b/src/controls/Calendar.qml index c5347c51..a5b32210 100644 --- a/src/controls/Calendar.qml +++ b/src/controls/Calendar.qml @@ -37,8 +37,8 @@ ** ****************************************************************************/ -import QtQuick 2.2 -import QtQuick.Controls 1.2 +import QtQuick 2.9 +import QtQuick.Controls 1.5 import QtQuick.Controls.Styles 1.1 import QtQuick.Controls.Private 1.0 @@ -202,20 +202,27 @@ Control { property int dayOfWeekFormat: Locale.ShortFormat /*! - The locale that this calendar should use to display itself. + \qmlproperty object Calendar::locale + \since QtQuick.Controls 1.6 - Affects how dates and day names are localized, as well as which - day is considered the first in a week. + This property controls the locale that this calendar uses to display + itself. - To set an Australian locale, for example: + The locale affects how dates and day names are localized, as well as + which day is considered the first in a week. + + The following example sets an Australian locale: \code locale: Qt.locale("en_AU") \endcode - The default locale is \c Qt.locale(). + The default value is equivalent to \c Qt.locale(). */ - property var __locale: Qt.locale() + property var locale: Qt.locale() + + // left for compatibility reasons; can be removed in next minor version/Qt 6 + property alias __locale: calendar.locale /*! \internal @@ -224,7 +231,7 @@ Control { populate the dates available to the user. */ property CalendarModel __model: CalendarModel { - locale: calendar.__locale + locale: calendar.locale // TODO: don't set the hour when QTBUG-56787 is fixed visibleDate: new Date(visibleYear, visibleMonth, 1, 12) diff --git a/src/controls/Slider.qml b/src/controls/Slider.qml index a90bc022..c4d25ac2 100644 --- a/src/controls/Slider.qml +++ b/src/controls/Slider.qml @@ -171,6 +171,16 @@ Control { */ property bool tickmarksEnabled: false + /*! + \qmlproperty bool Slider::wheelEnabled + + This property determines whether the control handles wheel events. + The default value is \c true. + + \since QtQuick.Controls 1.6 + */ + property alias wheelEnabled: wheelarea.enabled + /*! \internal */ property bool __horizontal: orientation === Qt.Horizontal diff --git a/src/controls/Styles/Android/CalendarStyle.qml b/src/controls/Styles/Android/CalendarStyle.qml index 449cc497..52b02bff 100644 --- a/src/controls/Styles/Android/CalendarStyle.qml +++ b/src/controls/Styles/Android/CalendarStyle.qml @@ -83,7 +83,7 @@ CalendarStyle { LabelStyle { id: dayOfWeek anchors.centerIn: parent - text: control.__locale.dayName(styleData.dayOfWeek, control.dayOfWeekFormat) + text: control.locale.dayName(styleData.dayOfWeek, control.dayOfWeekFormat) focused: control.activeFocus window_focused: control.Window.active styleDef: AndroidStyle.styleDef.calendarViewStyle.CalendarView_weekDayTextAppearance diff --git a/src/controls/Styles/Base/CalendarStyle.qml b/src/controls/Styles/Base/CalendarStyle.qml index 862c5f43..12cb3a4b 100644 --- a/src/controls/Styles/Base/CalendarStyle.qml +++ b/src/controls/Styles/Base/CalendarStyle.qml @@ -320,7 +320,7 @@ Style { color: gridVisible ? "#fcfcfc" : "transparent" implicitHeight: Math.round(TextSingleton.implicitHeight * 2.25) Label { - text: control.__locale.dayName(styleData.dayOfWeek, control.dayOfWeekFormat) + text: control.locale.dayName(styleData.dayOfWeek, control.dayOfWeekFormat) anchors.centerIn: parent } } @@ -397,8 +397,8 @@ Style { active: control.navigationBarVisible property QtObject styleData: QtObject { - readonly property string title: control.__locale.standaloneMonthName(control.visibleMonth) - + new Date(control.visibleYear, control.visibleMonth, 1).toLocaleDateString(control.__locale, " yyyy") + readonly property string title: control.locale.standaloneMonthName(control.visibleMonth) + + new Date(control.visibleYear, control.visibleMonth, 1).toLocaleDateString(control.locale, " yyyy") } } @@ -413,7 +413,7 @@ Style { Repeater { id: repeater model: CalendarHeaderModel { - locale: control.__locale + locale: control.locale } Loader { id: dayOfWeekDelegateLoader diff --git a/src/controls/plugin.cpp b/src/controls/plugin.cpp index bac0d64d..5a5a9605 100644 --- a/src/controls/plugin.cpp +++ b/src/controls/plugin.cpp @@ -120,7 +120,10 @@ static const struct { { "TreeView", 1, 4 }, { "TextArea", 1, 5 }, - { "TreeView", 1, 5 } + { "TreeView", 1, 5 }, + + { "Calendar", 1, 6 }, + { "Slider", 1, 6 } }; QtQuickControls1Plugin::QtQuickControls1Plugin(QObject *parent) : QQmlExtensionPlugin(parent) diff --git a/src/extras/Private/qquickmathutils.cpp b/src/extras/Private/qquickmathutils.cpp index 165a6f92..e40d8b6f 100644 --- a/src/extras/Private/qquickmathutils.cpp +++ b/src/extras/Private/qquickmathutils.cpp @@ -55,7 +55,7 @@ qreal QQuickMathUtils::pi2() const Converts the angle \a degrees to radians. */ qreal QQuickMathUtils::degToRad(qreal degrees) const { - return degrees * (M_PI / 180); + return qDegreesToRadians(degrees); } /*! @@ -68,14 +68,14 @@ qreal QQuickMathUtils::degToRad(qreal degrees) const { for example. */ qreal QQuickMathUtils::degToRadOffset(qreal degrees) const { - return (degrees - 90) * (M_PI / 180); + return qDegreesToRadians(degrees - 90); } /*! Converts the angle \a radians to degrees. */ qreal QQuickMathUtils::radToDeg(qreal radians) const { - return radians * (180 / M_PI); + return qRadiansToDegrees(radians); } /*! @@ -88,7 +88,7 @@ qreal QQuickMathUtils::radToDeg(qreal radians) const { expect. */ qreal QQuickMathUtils::radToDegOffset(qreal radians) const { - return radians * (180 / M_PI) + 90; + return qRadiansToDegrees(radians) + 90; } /*! diff --git a/src/extras/Styles/Flat/CalendarStyle.qml b/src/extras/Styles/Flat/CalendarStyle.qml index 2598ce78..ece0548d 100644 --- a/src/extras/Styles/Flat/CalendarStyle.qml +++ b/src/extras/Styles/Flat/CalendarStyle.qml @@ -190,7 +190,7 @@ Base.CalendarStyle { Label { text: localeDayName.length == 0 || localeDayName.length > 1 - ? control.__locale.dayName(styleData.dayOfWeek, Locale.ShortFormat)[0] + ? control.locale.dayName(styleData.dayOfWeek, Locale.ShortFormat)[0] : localeDayName color: !control.enabled ? FlatStyle.disabledColor : FlatStyle.styleColor opacity: !control.enabled ? FlatStyle.disabledOpacity : 1 @@ -202,7 +202,7 @@ Base.CalendarStyle { font.pixelSize: control.height * __headerFontRatio renderType: FlatStyle.__renderType - property string localeDayName: control.__locale.dayName(styleData.dayOfWeek, Locale.NarrowFormat) + property string localeDayName: control.locale.dayName(styleData.dayOfWeek, Locale.NarrowFormat) } } } |