diff options
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/calendar/qquickcalendarmodel.cpp | 6 | ||||
-rw-r--r-- | src/imports/controls/designer/qtquickcontrols2.metainfo | 20 | ||||
-rw-r--r-- | src/imports/controls/doc/qtquickcontrols2.qdocconf | 4 | ||||
-rw-r--r-- | src/imports/controls/material/SpinBox.qml | 25 | ||||
-rw-r--r-- | src/imports/controls/material/TextArea.qml | 9 | ||||
-rw-r--r-- | src/imports/controls/material/TextField.qml | 7 | ||||
-rw-r--r-- | src/imports/controls/plugins.qmltypes | 239 |
7 files changed, 288 insertions, 22 deletions
diff --git a/src/imports/calendar/qquickcalendarmodel.cpp b/src/imports/calendar/qquickcalendarmodel.cpp index 9d214450..473e43a2 100644 --- a/src/imports/calendar/qquickcalendarmodel.cpp +++ b/src/imports/calendar/qquickcalendarmodel.cpp @@ -63,8 +63,8 @@ QT_BEGIN_NAMESPACE The Qt Labs Calendar module uses 0-based month numbers to be consistent with the JavaScript Date type, that is used by the QML language. This means that \c Date::getMonth() can be passed to the methods as is. When - dealing with dealing with month numbers directly, it is highly recommended - to use the following enumeration values to avoid confusion. + dealing with month numbers directly, it is highly recommended to use the + following enumeration values to avoid confusion. \value Calendar.January January (0) \value Calendar.February February (1) @@ -183,7 +183,7 @@ void QQuickCalendarModel::setTo(const QDate &to) if (d->complete) d->populate(d->from, to); d->to = to; - emit fromChanged(); + emit toChanged(); } } diff --git a/src/imports/controls/designer/qtquickcontrols2.metainfo b/src/imports/controls/designer/qtquickcontrols2.metainfo index 39d7016c..877e183f 100644 --- a/src/imports/controls/designer/qtquickcontrols2.metainfo +++ b/src/imports/controls/designer/qtquickcontrols2.metainfo @@ -23,7 +23,7 @@ MetaInfo { version: "1.0" requiredImport: "Qt.labs.controls" - Property { name: "text"; type: "binding"; value: "qsTr('Button')" } + Property { name: "text"; type: "binding"; value: "qsTr(\"Button\")" } } } @@ -38,7 +38,7 @@ MetaInfo { version: "1.0" requiredImport: "Qt.labs.controls" - Property { name: "text"; type: "binding"; value: "qsTr('Check Box')" } + Property { name: "text"; type: "binding"; value: "qsTr(\"Check Box\")" } } } @@ -112,7 +112,7 @@ MetaInfo { Property { name: "width"; type: "int"; value: 200 } Property { name: "height"; type: "int"; value: 200 } - Property { name: "title"; type: "binding"; value: "qsTr('Group Box')" } + Property { name: "title"; type: "binding"; value: "qsTr(\"Group Box\")" } } } @@ -127,7 +127,7 @@ MetaInfo { version: "1.0" requiredImport: "Qt.labs.controls" - Property { name: "text"; type: "binding"; value: "qsTr('Item Delegate')" } + Property { name: "text"; type: "binding"; value: "qsTr(\"Item Delegate\")" } } } @@ -142,7 +142,7 @@ MetaInfo { version: "1.0" requiredImport: "Qt.labs.controls" - Property { name: "text"; type: "binding"; value: "qsTr('Label')" } + Property { name: "text"; type: "binding"; value: "qsTr(\"Label\")" } } } @@ -203,7 +203,7 @@ MetaInfo { version: "1.0" requiredImport: "Qt.labs.controls" - Property { name: "text"; type: "binding"; value: "qsTr('Radio Button')" } + Property { name: "text"; type: "binding"; value: "qsTr(\"Radio Button\")" } } } @@ -261,7 +261,7 @@ MetaInfo { version: "1.0" requiredImport: "Qt.labs.controls" - Property { name: "text"; type: "binding"; value: "qsTr('Switch')" } + Property { name: "text"; type: "binding"; value: "qsTr(\"Switch\")" } } } @@ -276,7 +276,7 @@ MetaInfo { version: "1.0" requiredImport: "Qt.labs.controls" - Property { name: "text"; type: "binding"; value: "qsTr('Text Area')" } + Property { name: "text"; type: "binding"; value: "qsTr(\"Text Area\")" } } } @@ -291,7 +291,7 @@ MetaInfo { version: "1.0" requiredImport: "Qt.labs.controls" - Property { name: "text"; type: "binding"; value: "qsTr('Text Field')" } + Property { name: "text"; type: "binding"; value: "qsTr(\"Text Field\")" } } } @@ -306,7 +306,7 @@ MetaInfo { version: "1.0" requiredImport: "Qt.labs.controls" - Property { name: "text"; type: "binding"; value: "qsTr('Tool Button')" } + Property { name: "text"; type: "binding"; value: "qsTr(\"Tool Button\")" } } } diff --git a/src/imports/controls/doc/qtquickcontrols2.qdocconf b/src/imports/controls/doc/qtquickcontrols2.qdocconf index 0a19bdf5..c781ae28 100644 --- a/src/imports/controls/doc/qtquickcontrols2.qdocconf +++ b/src/imports/controls/doc/qtquickcontrols2.qdocconf @@ -34,14 +34,14 @@ depends = qtcore qtgui qtdoc qtqml qtquick qtquickdialogs qtquickcontrols qmake # Specify the install path under QT_INSTALL_EXAMPLES # Note: paths passed to \example command must contain the parent directory, e.g. # \example controls/tabs -exampledirs += ../../../../examples/controls \ +exampledirs += ../../../../examples/quickcontrols2 \ ../ \ ../../../quicktemplates2 \ ../../calendar \ ../../../../tests/auto/controls/data \ snippets -examplesinstallpath = qtquickcontrols2/controls +examplesinstallpath = qtquickcontrols2/quickcontrols2 headerdirs += ../../../quicktemplates2 \ ../../calendar \ diff --git a/src/imports/controls/material/SpinBox.qml b/src/imports/controls/material/SpinBox.qml index f8fc84c8..1851a1f8 100644 --- a/src/imports/controls/material/SpinBox.qml +++ b/src/imports/controls/material/SpinBox.qml @@ -74,6 +74,31 @@ T.SpinBox { selectedTextColor: control.Material.primaryTextColor horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter + cursorDelegate: Rectangle { + id: cursor + color: control.Material.accentColor + width: 2 + visible: control.activeFocus && contentItem.selectionStart === contentItem.selectionEnd + + Connections { + target: contentItem + onCursorPositionChanged: { + // keep a moving cursor visible + cursor.opacity = 1 + timer.restart() + } + } + + Timer { + id: timer + running: control.activeFocus + repeat: true + interval: Qt.styleHints.cursorFlashTime + onTriggered: cursor.opacity = !cursor.opacity ? 1 : 0 + // force the cursor visible when gaining focus + onRunningChanged: cursor.opacity = 1 + } + } readOnly: !control.editable validator: control.validator diff --git a/src/imports/controls/material/TextArea.qml b/src/imports/controls/material/TextArea.qml index 41940dd5..b952d319 100644 --- a/src/imports/controls/material/TextArea.qml +++ b/src/imports/controls/material/TextArea.qml @@ -44,11 +44,12 @@ T.TextArea { implicitWidth: Math.max(contentWidth + leftPadding + rightPadding, background ? background.implicitWidth : 0, placeholder.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(contentHeight + topPadding + bottomPadding, + implicitHeight: Math.max(contentHeight + 1 + topPadding + bottomPadding, background ? background.implicitHeight : 0, - placeholder.implicitHeight + topPadding + bottomPadding) + placeholder.implicitHeight + 1 + topPadding + bottomPadding) - padding: 6 + topPadding: 8 + bottomPadding: 16 color: enabled ? Material.primaryTextColor : Material.hintTextColor selectionColor: Material.accentColor @@ -98,7 +99,7 @@ T.TextArea { //! [background] background: Rectangle { - y: control.height - height + y: control.height - height - control.bottomPadding / 2 implicitWidth: 120 height: control.activeFocus ? 2 : 1 color: control.activeFocus ? control.Material.accentColor : control.Material.hintTextColor diff --git a/src/imports/controls/material/TextField.qml b/src/imports/controls/material/TextField.qml index 2f5936ec..25cd6fe8 100644 --- a/src/imports/controls/material/TextField.qml +++ b/src/imports/controls/material/TextField.qml @@ -44,9 +44,10 @@ T.TextField { implicitWidth: Math.max(background ? background.implicitWidth : 0, placeholder.implicitWidth + leftPadding + rightPadding) implicitHeight: Math.max(background ? background.implicitHeight : 0, - placeholder.implicitHeight + topPadding + bottomPadding) + placeholder.implicitHeight + 1 + topPadding + bottomPadding) - padding: 6 + topPadding: 8 + bottomPadding: 16 color: enabled ? Material.primaryTextColor : Material.hintTextColor selectionColor: Material.accentColor @@ -98,7 +99,7 @@ T.TextField { //! [background] background: Rectangle { - y: control.height - height + y: control.height - height - control.bottomPadding / 2 implicitWidth: 120 height: control.activeFocus ? 2 : 1 color: control.activeFocus ? control.Material.accentColor : control.Material.hintTextColor diff --git a/src/imports/controls/plugins.qmltypes b/src/imports/controls/plugins.qmltypes index 5bb504e3..ac081c7d 100644 --- a/src/imports/controls/plugins.qmltypes +++ b/src/imports/controls/plugins.qmltypes @@ -36,6 +36,86 @@ Module { Signal { name: "doubleClicked" } Method { name: "toggle" } } + // + // Manually added to work around QtC limitations: + // + Component { + name: "QQuickWindowQmlImpl" + defaultProperty: "data" + prototype: "QQuickWindow" + exports: ["QtQuick.Window/Window 2.1", "QtQuick.Window/Window 2.2"] + exportMetaObjectRevisions: [0, 1] + attachedType: "QQuickWindowAttached" + Property { name: "visible"; type: "bool" } + Property { name: "visibility"; type: "Visibility" } + Signal { + name: "visibleChanged" + Parameter { name: "arg"; type: "bool" } + } + Signal { + name: "visibilityChanged" + Parameter { name: "visibility"; type: "QWindow::Visibility" } + } + } + Component { + name: "QQuickWindow" + defaultProperty: "data" + prototype: "QWindow" + exports: [ + "QtQuick.Window/Window 2.0", + "QtQuick.Window/Window 2.1", + "QtQuick.Window/Window 2.2" + ] + exportMetaObjectRevisions: [0, 1, 2] + Enum { + name: "SceneGraphError" + values: { + "ContextNotAvailable": 1 + } + } + Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } + Property { name: "color"; type: "QColor" } + Property { name: "contentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } + Property { + name: "activeFocusItem" + revision: 1 + type: "QQuickItem" + isReadonly: true + isPointer: true + } + Signal { name: "frameSwapped" } + Signal { + name: "openglContextCreated" + revision: 2 + Parameter { name: "context"; type: "QOpenGLContext"; isPointer: true } + } + Signal { name: "sceneGraphInitialized" } + Signal { name: "sceneGraphInvalidated" } + Signal { name: "beforeSynchronizing" } + Signal { name: "afterSynchronizing"; revision: 2 } + Signal { name: "beforeRendering" } + Signal { name: "afterRendering" } + Signal { name: "afterAnimating"; revision: 2 } + Signal { name: "sceneGraphAboutToStop"; revision: 2 } + Signal { + name: "closing" + revision: 1 + Parameter { name: "close"; type: "QQuickCloseEvent"; isPointer: true } + } + Signal { + name: "colorChanged" + Parameter { type: "QColor" } + } + Signal { name: "activeFocusItemChanged"; revision: 1 } + Signal { + name: "sceneGraphError" + revision: 2 + Parameter { name: "error"; type: "QQuickWindow::SceneGraphError" } + Parameter { name: "message"; type: "string" } + } + Method { name: "update" } + Method { name: "releaseResources" } + } Component { name: "QQuickApplicationWindow" defaultProperty: "data" @@ -54,6 +134,165 @@ Module { Property { name: "locale"; type: "QLocale" } } Component { + name: "QWindow" + prototype: "QObject" + Enum { + name: "Visibility" + values: { + "Hidden": 0, + "AutomaticVisibility": 1, + "Windowed": 2, + "Minimized": 3, + "Maximized": 4, + "FullScreen": 5 + } + } + Property { name: "title"; type: "string" } + Property { name: "modality"; type: "Qt::WindowModality" } + Property { name: "flags"; type: "Qt::WindowFlags" } + Property { name: "x"; type: "int" } + Property { name: "y"; type: "int" } + Property { name: "width"; type: "int" } + Property { name: "height"; type: "int" } + Property { name: "minimumWidth"; type: "int" } + Property { name: "minimumHeight"; type: "int" } + Property { name: "maximumWidth"; type: "int" } + Property { name: "maximumHeight"; type: "int" } + Property { name: "visible"; type: "bool" } + Property { name: "active"; revision: 1; type: "bool"; isReadonly: true } + Property { name: "visibility"; revision: 1; type: "Visibility" } + Property { name: "contentOrientation"; type: "Qt::ScreenOrientation" } + Property { name: "opacity"; revision: 1; type: "double" } + Signal { + name: "screenChanged" + Parameter { name: "screen"; type: "QScreen"; isPointer: true } + } + Signal { + name: "modalityChanged" + Parameter { name: "modality"; type: "Qt::WindowModality" } + } + Signal { + name: "windowStateChanged" + Parameter { name: "windowState"; type: "Qt::WindowState" } + } + Signal { + name: "windowTitleChanged" + revision: 2 + Parameter { name: "title"; type: "string" } + } + Signal { + name: "xChanged" + Parameter { name: "arg"; type: "int" } + } + Signal { + name: "yChanged" + Parameter { name: "arg"; type: "int" } + } + Signal { + name: "widthChanged" + Parameter { name: "arg"; type: "int" } + } + Signal { + name: "heightChanged" + Parameter { name: "arg"; type: "int" } + } + Signal { + name: "minimumWidthChanged" + Parameter { name: "arg"; type: "int" } + } + Signal { + name: "minimumHeightChanged" + Parameter { name: "arg"; type: "int" } + } + Signal { + name: "maximumWidthChanged" + Parameter { name: "arg"; type: "int" } + } + Signal { + name: "maximumHeightChanged" + Parameter { name: "arg"; type: "int" } + } + Signal { + name: "visibleChanged" + Parameter { name: "arg"; type: "bool" } + } + Signal { + name: "visibilityChanged" + revision: 1 + Parameter { name: "visibility"; type: "QWindow::Visibility" } + } + Signal { name: "activeChanged"; revision: 1 } + Signal { + name: "contentOrientationChanged" + Parameter { name: "orientation"; type: "Qt::ScreenOrientation" } + } + Signal { + name: "focusObjectChanged" + Parameter { name: "object"; type: "QObject"; isPointer: true } + } + Signal { + name: "opacityChanged" + revision: 1 + Parameter { name: "opacity"; type: "double" } + } + Method { name: "requestActivate"; revision: 1 } + Method { + name: "setVisible" + Parameter { name: "visible"; type: "bool" } + } + Method { name: "show" } + Method { name: "hide" } + Method { name: "showMinimized" } + Method { name: "showMaximized" } + Method { name: "showFullScreen" } + Method { name: "showNormal" } + Method { name: "close"; type: "bool" } + Method { name: "raise" } + Method { name: "lower" } + Method { + name: "setTitle" + Parameter { type: "string" } + } + Method { + name: "setX" + Parameter { name: "arg"; type: "int" } + } + Method { + name: "setY" + Parameter { name: "arg"; type: "int" } + } + Method { + name: "setWidth" + Parameter { name: "arg"; type: "int" } + } + Method { + name: "setHeight" + Parameter { name: "arg"; type: "int" } + } + Method { + name: "setMinimumWidth" + Parameter { name: "w"; type: "int" } + } + Method { + name: "setMinimumHeight" + Parameter { name: "h"; type: "int" } + } + Method { + name: "setMaximumWidth" + Parameter { name: "w"; type: "int" } + } + Method { + name: "setMaximumHeight" + Parameter { name: "h"; type: "int" } + } + Method { + name: "alert" + revision: 1 + Parameter { name: "msec"; type: "int" } + } + Method { name: "requestUpdate"; revision: 3 } + } + Component { name: "QQuickApplicationWindowAttached" prototype: "QObject" Property { name: "window"; type: "QQuickApplicationWindow"; isReadonly: true; isPointer: true } |