diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-08-13 10:18:42 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-13 10:18:42 +0200 |
commit | b2d4400e28127c938e313dfcc2aa3fc9c3f6552f (patch) | |
tree | b47f4f385169fa563a9d952244a41d00b616d7c3 | |
parent | 784c01fbd6967097f764fa75bf85792961b6d9c3 (diff) | |
parent | 2075df5e73c014e374a1f3d3b8a5c0587ace6113 (diff) | |
download | qtquickcontrols-b2d4400e28127c938e313dfcc2aa3fc9c3f6552f.tar.gz |
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
-rw-r--r-- | dist/changes-5.1.1 | 28 | ||||
-rw-r--r-- | src/controls/TableViewColumn.qml | 14 | ||||
-rw-r--r-- | src/private/ScrollBar.qml | 44 | ||||
-rw-r--r-- | src/private/qquicktooltip.cpp | 7 | ||||
-rw-r--r-- | src/styles/Base/ButtonStyle.qml | 2 | ||||
-rw-r--r-- | src/styles/Base/ToolButtonStyle.qml | 16 |
6 files changed, 84 insertions, 27 deletions
diff --git a/dist/changes-5.1.1 b/dist/changes-5.1.1 new file mode 100644 index 00000000..7f01a404 --- /dev/null +++ b/dist/changes-5.1.1 @@ -0,0 +1,28 @@ +Qt 5.1.1 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.1.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + + http://qt-project.org/doc/qt-5.1/ + +The Qt version 5.1 series is binary compatible with the 5.0.x series. +Applications compiled for 5.0 will continue to run with 5.1. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + http://bugreports.qt-project.org/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + + +**************************************************************************** +* General * +**************************************************************************** + + - [QTBUG-31206] TableView: let delegates handle mouse events + - [QTBUG-31306] GroupBox: fix the activeFocusOnTab behavior + - [QTBUG-31992] Make ComboBox work with variant list + - [QTBUG-32400] Allow mouse events when transient scroll bars are hidden diff --git a/src/controls/TableViewColumn.qml b/src/controls/TableViewColumn.qml index f1abc553..d976c691 100644 --- a/src/controls/TableViewColumn.qml +++ b/src/controls/TableViewColumn.qml @@ -93,7 +93,19 @@ QtObject { property int horizontalAlignment: Text.AlignLeft /*! The delegate of the column. This can be used to set the - \l TableView::itemDelegate for a specific column. */ + \l TableView::itemDelegate for a specific column. + + In the delegate you have access to the following special properties: + \list + \li styleData.selected - if the item is currently selected + \li styleData.value - the value or text for this item + \li styleData.textColor - the default text color for an item + \li styleData.row - the index of the row + \li styleData.column - the index of the column + \li styleData.elideMode - the elide mode of the column + \li styleData.textAlignment - the horizontal text alignment of the column + \endlist + */ property Component delegate Accessible.role: Accessible.ColumnHeader diff --git a/src/private/ScrollBar.qml b/src/private/ScrollBar.qml index 5257fe80..c21d6562 100644 --- a/src/private/ScrollBar.qml +++ b/src/private/ScrollBar.qml @@ -182,28 +182,40 @@ Item { pageDownPressed = false; } - function incrementPage() { - value += pageStep - if (value > maximumValue) - value = maximumValue + onWheel: { + var stepCount = -(wheel.angleDelta.x ? wheel.angleDelta.x : wheel.angleDelta.y) / 120 + if (stepCount != 0) { + if (wheel.modifiers & Qt.ControlModifier || wheel.modifiers & Qt.ShiftModifier) + incrementPage(stepCount) + else + increment(stepCount) + } + } + + function incrementPage(stepCount) { + value = boundValue(value + getSteps(pageStep, stepCount)) + } + + function decrementPage(stepCount) { + value = boundValue(value - getSteps(pageStep, stepCount)) + } + + function increment(stepCount) { + value = boundValue(value + getSteps(singleStep, stepCount)) } - function decrementPage() { - value -= pageStep - if (value < minimumValue) - value = minimumValue + function decrement(stepCount) { + value = boundValue(value - getSteps(singleStep, stepCount)) } - function increment() { - value += singleStep - if (value > maximumValue) - value = maximumValue + function boundValue(val) { + return Math.min(Math.max(val, minimumValue), maximumValue) } - function decrement() { - value -= singleStep - if (value < minimumValue) - value = minimumValue + function getSteps(step, count) { + if (count) + step *= count + return step } RangeModel { diff --git a/src/private/qquicktooltip.cpp b/src/private/qquicktooltip.cpp index e76fa3ad..ae4366d9 100644 --- a/src/private/qquicktooltip.cpp +++ b/src/private/qquicktooltip.cpp @@ -42,6 +42,8 @@ #include "qquicktooltip_p.h" #include <qquickwindow.h> #include <qquickitem.h> +#include <private/qguiapplication_p.h> +#include <qpa/qplatformintegration.h> #ifndef QT_NO_WIDGETS #include <qtooltip.h> @@ -60,7 +62,10 @@ void QQuickTooltip::showText(QQuickItem *item, const QPointF &pos, const QString if (!item || !item->window()) return; #ifndef QT_NO_WIDGETS - QToolTip::showText(item->window()->mapToGlobal(item->mapToScene(pos).toPoint()), str); + if (QGuiApplicationPrivate::platformIntegration()-> + hasCapability(QPlatformIntegration::MultipleWindows) && + QCoreApplication::instance()->inherits("QApplication")) + QToolTip::showText(item->window()->mapToGlobal(item->mapToScene(pos).toPoint()), str); #else Q_UNUSED(item); Q_UNUSED(pos); diff --git a/src/styles/Base/ButtonStyle.qml b/src/styles/Base/ButtonStyle.qml index 7721fdf2..aea5f721 100644 --- a/src/styles/Base/ButtonStyle.qml +++ b/src/styles/Base/ButtonStyle.qml @@ -99,7 +99,7 @@ Style { implicitHeight: 25 BorderImage { anchors.fill: parent - source: control.pressed ? "images/button_down.png" : "images/button.png" + source: control.pressed || (control.checkable && control.checked) ? "images/button_down.png" : "images/button.png" border.top: 6 border.bottom: 6 border.left: 6 diff --git a/src/styles/Base/ToolButtonStyle.qml b/src/styles/Base/ToolButtonStyle.qml index 0ead0750..280740e4 100644 --- a/src/styles/Base/ToolButtonStyle.qml +++ b/src/styles/Base/ToolButtonStyle.qml @@ -51,22 +51,21 @@ Style { readonly property ToolButton control: __control property Component panel: Item { id: styleitem - implicitWidth: 36 - implicitHeight: 36 + implicitWidth: hasIcon ? 36 : Math.max(label.implicitWidth + frame.border.left + frame.border.right, 36) + implicitHeight: hasIcon ? 36 : Math.max(label.implicitHeight, 36) + + readonly property bool hasIcon: icon.status === Image.Ready || icon.status === Image.Loading Rectangle { anchors.fill: parent - visible: control.pressed - gradient: Gradient{ - GradientStop{color: control.pressed ? "lightgray" : "white" ; position: 0} - GradientStop{color: control.pressed ? "lightgray" : "lightgray" ; position: 1} - } + visible: control.pressed || (control.checkable && control.checked) + color: "lightgray" radius:4 border.color: "#aaa" } Text { id: label - visible: icon.status != Image.Ready + visible: !hasIcon anchors.centerIn: parent text: control.text } @@ -76,6 +75,7 @@ Style { source: control.iconSource } BorderImage { + id: frame anchors.fill: parent anchors.margins: -1 anchors.topMargin: -2 |