diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-02-05 16:02:02 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-05 16:02:02 +0100 |
commit | ce295650145c06851388ad0ec7f384a53fc6c036 (patch) | |
tree | bbaefc638f4a8d65d13d40b9bef68b157e9f00b8 /src/controls | |
parent | dd943068879770b932584792cc0c24b892c56ada (diff) | |
parent | 69b47a2625e0923efb617701f5aef06847ee7fb0 (diff) | |
download | qtquickcontrols-ce295650145c06851388ad0ec7f384a53fc6c036.tar.gz |
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/controls')
-rw-r--r-- | src/controls/ComboBox.qml | 1 | ||||
-rw-r--r-- | src/controls/Private/qquickstyleitem.cpp | 4 | ||||
-rw-r--r-- | src/controls/SpinBox.qml | 2 | ||||
-rw-r--r-- | src/controls/StackView.qml | 4 | ||||
-rw-r--r-- | src/controls/Styles/Desktop/SpinBoxStyle.qml | 5 | ||||
-rw-r--r-- | src/controls/TextArea.qml | 2 | ||||
-rw-r--r-- | src/controls/TextField.qml | 4 |
7 files changed, 14 insertions, 8 deletions
diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml index 528b0824..6d8e2268 100644 --- a/src/controls/ComboBox.qml +++ b/src/controls/ComboBox.qml @@ -427,6 +427,7 @@ Control { } property bool allowComplete: false + Keys.forwardTo: comboBox Keys.onPressed: allowComplete = (event.key !== Qt.Key_Backspace && event.key !== Qt.Key_Delete); onTextChanged: { diff --git a/src/controls/Private/qquickstyleitem.cpp b/src/controls/Private/qquickstyleitem.cpp index 4748788f..105bb9f5 100644 --- a/src/controls/Private/qquickstyleitem.cpp +++ b/src/controls/Private/qquickstyleitem.cpp @@ -601,6 +601,7 @@ void QQuickStyleItem::initStyleOption() QStyleOptionSpinBox *opt = qstyleoption_cast<QStyleOptionSpinBox*>(m_styleoption); opt->frame = true; + opt->subControls = QStyle::SC_SpinBoxFrame | QStyle::SC_SpinBoxEditField; if (value() & 0x1) opt->activeSubControls = QStyle::SC_SpinBoxUp; else if (value() & (1<<1)) @@ -919,6 +920,9 @@ QSize QQuickStyleItem::sizeFromContents(int width, int height) frame.rect = m_styleoption->rect; frame.styleObject = this; size = qApp->style()->sizeFromContents(QStyle::CT_LineEdit, &frame, QSize(width, height)); + if (m_itemType == SpinBox) + size.setWidth(qApp->style()->sizeFromContents(QStyle::CT_SpinBox, + m_styleoption, QSize(width + 2, height)).width()); } break; case GroupBox: { diff --git a/src/controls/SpinBox.qml b/src/controls/SpinBox.qml index 4dc03d97..8fc964a0 100644 --- a/src/controls/SpinBox.qml +++ b/src/controls/SpinBox.qml @@ -268,6 +268,8 @@ Control { selectValue() } + Keys.forwardTo: spinbox + onEditingFinished: spinbox.editingFinished() color: __panel ? __panel.foregroundColor : "black" diff --git a/src/controls/StackView.qml b/src/controls/StackView.qml index 18f77d2e..d8089174 100644 --- a/src/controls/StackView.qml +++ b/src/controls/StackView.qml @@ -290,7 +290,7 @@ import QtQuick.Controls.Private 1.0 properties.exitItem.opacity = 1 } - property Component pushTransition: StackViewTransition { + pushTransition: StackViewTransition { PropertyAnimation { target: enterItem property: "opacity" @@ -328,7 +328,7 @@ import QtQuick.Controls.Private 1.0 properties.exitItem.rotation = 0 } - property Component pushTransition: StackViewTransition { + pushTransition: StackViewTransition { SequentialAnimation { ScriptAction { script: enterItem.rotation = 90 diff --git a/src/controls/Styles/Desktop/SpinBoxStyle.qml b/src/controls/Styles/Desktop/SpinBoxStyle.qml index 5cf13ea8..18bfec36 100644 --- a/src/controls/Styles/Desktop/SpinBoxStyle.qml +++ b/src/controls/Styles/Desktop/SpinBoxStyle.qml @@ -88,11 +88,6 @@ Style { Item { id: edit anchors.fill: parent - Rectangle { - color: "white" - anchors.fill: parent - anchors.margins: -1 - } FocusFrame { anchors.fill: parent focusMargin:-6 diff --git a/src/controls/TextArea.qml b/src/controls/TextArea.qml index 72697919..66e7faf6 100644 --- a/src/controls/TextArea.qml +++ b/src/controls/TextArea.qml @@ -720,6 +720,8 @@ ScrollView { selectByMouse: true readOnly: false + Keys.forwardTo: area + KeyNavigation.priority: KeyNavigation.BeforeItem KeyNavigation.tab: area.tabChangesFocus ? area.KeyNavigation.tab : null KeyNavigation.backtab: area.tabChangesFocus ? area.KeyNavigation.backtab : null diff --git a/src/controls/TextField.qml b/src/controls/TextField.qml index 0bd4db1e..d9ba3625 100644 --- a/src/controls/TextField.qml +++ b/src/controls/TextField.qml @@ -303,7 +303,7 @@ Control { \qmlproperty string TextField::placeholderText This property contains the text that is shown in the text field when the - text field is empty and has no focus. + text field is empty. */ property alias placeholderText: placeholderTextComponent.text @@ -598,6 +598,8 @@ Control { renderType: __style ? __style.renderType : Text.NativeRendering + Keys.forwardTo: textfield + onAccepted: { Qt.inputMethod.commit() Qt.inputMethod.hide() |