aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-11-17 17:03:08 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2016-11-17 17:03:08 +0100
commit7903979d3585b73adf3c2c2b88b5c94c303b8302 (patch)
tree5e7b1b6ec6025778002f9312de7a14acf39011dc /src
parentaf9729ecf4434c5884cb61b990b819aaccd3af9b (diff)
parent2202d79b39ff90eed19fb8106f79d4604e47acfd (diff)
Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts: tests/auto/controls/data/tst_button.qml Change-Id: I5c97b3c1944e52dba44fd3c7d6d9a255c5e08cf7
Diffstat (limited to 'src')
-rw-r--r--src/imports/controls/doc/src/includes/qquickswitch.qdocinc4
-rw-r--r--src/quickcontrols2/qquickstyle.cpp20
-rw-r--r--src/quicktemplates2/qquickabstractbutton.cpp2
-rw-r--r--src/quicktemplates2/qquickdial.cpp4
-rw-r--r--src/quicktemplates2/qquickprogressbar.cpp4
-rw-r--r--src/quicktemplates2/qquickrangeslider.cpp16
-rw-r--r--src/quicktemplates2/qquickslider.cpp10
-rw-r--r--src/quicktemplates2/qquickspinbox.cpp3
8 files changed, 41 insertions, 22 deletions
diff --git a/src/imports/controls/doc/src/includes/qquickswitch.qdocinc b/src/imports/controls/doc/src/includes/qquickswitch.qdocinc
index 32ccbb89..985f85d9 100644
--- a/src/imports/controls/doc/src/includes/qquickswitch.qdocinc
+++ b/src/imports/controls/doc/src/includes/qquickswitch.qdocinc
@@ -2,7 +2,7 @@
This property holds the logical position of the thumb indicator.
-The position is defined as a percentage of the indicator's size, scaled to
+The position is expressed as a fraction of the indicator's size, in the range
\c 0.0 - \c 1.0. The position can be used for example to determine whether
the thumb has been dragged past the halfway point. For visualizing a thumb
indicator, the right-to-left aware \l visualPosition should be used instead.
@@ -16,7 +16,7 @@ indicator, the right-to-left aware \l visualPosition should be used instead.
This property holds the visual position of the thumb indicator.
-The position is defined as a percentage of the indicator's size, scaled to
+The position is expressed as a fraction of the indicator's size, in the range
\c 0.0 - \c 1.0. When the control is \l {Control::mirrored}{mirrored}, the
value is equal to \c {1.0 - position}. This makes the value suitable for
visualizing the thumb indicator taking right-to-left support into account.
diff --git a/src/quickcontrols2/qquickstyle.cpp b/src/quickcontrols2/qquickstyle.cpp
index f4fc1764..d7143be7 100644
--- a/src/quickcontrols2/qquickstyle.cpp
+++ b/src/quickcontrols2/qquickstyle.cpp
@@ -41,6 +41,7 @@
#include <QtCore/qdir.h>
#include <QtCore/qdebug.h>
#include <QtCore/qsettings.h>
+#include <QtCore/qlibraryinfo.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QtQml/private/qqmlmetatype_p.h>
#include <QtQml/qqmlengine.h>
@@ -96,6 +97,23 @@ QT_BEGIN_NAMESPACE
\sa {Styling Qt Quick Controls 2}
*/
+// TODO: QQmlImportDatabase::defaultImportPathList()
+static QStringList defaultImportPathList()
+{
+ QStringList importPaths;
+ importPaths.reserve(3);
+ importPaths += QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
+
+ if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QML2_IMPORT_PATH"))) {
+ const QByteArray envImportPath = qgetenv("QML2_IMPORT_PATH");
+ importPaths += QString::fromLatin1(envImportPath).split(QDir::listSeparator(), QString::SkipEmptyParts);
+ }
+
+ importPaths += QStringLiteral("qrc:/qt-project.org/imports");
+ importPaths += QCoreApplication::applicationDirPath();
+ return importPaths;
+}
+
struct QQuickStyleSpec
{
QQuickStyleSpec() : custom(false), resolved(false) { }
@@ -179,7 +197,7 @@ struct QQuickStyleSpec
if (QGuiApplication::instance()) {
if (!custom) {
const QString targetPath = QStringLiteral("QtQuick/Controls.2");
- const QStringList importPaths = QQmlEngine().importPathList();
+ const QStringList importPaths = defaultImportPathList();
for (const QString &importPath : importPaths) {
QString stylePath = findStyle(importPath + QLatin1Char('/') + targetPath, style);
diff --git a/src/quicktemplates2/qquickabstractbutton.cpp b/src/quicktemplates2/qquickabstractbutton.cpp
index 2615608f..bee45554 100644
--- a/src/quicktemplates2/qquickabstractbutton.cpp
+++ b/src/quicktemplates2/qquickabstractbutton.cpp
@@ -540,7 +540,7 @@ void QQuickAbstractButton::mouseMoveEvent(QMouseEvent *event)
QQuickControl::mouseMoveEvent(event);
setPressed(d->keepPressed || contains(event->pos()));
- if (d->autoRepeat)
+ if (!d->pressed && d->autoRepeat)
d->stopPressRepeat();
else if (d->holdTimer > 0 && (!d->pressed || QLineF(d->pressPoint, event->localPos()).length() > QGuiApplication::styleHints()->startDragDistance()))
d->stopPressAndHold();
diff --git a/src/quicktemplates2/qquickdial.cpp b/src/quicktemplates2/qquickdial.cpp
index 22c1133b..79aff781 100644
--- a/src/quicktemplates2/qquickdial.cpp
+++ b/src/quicktemplates2/qquickdial.cpp
@@ -280,8 +280,8 @@ void QQuickDial::setValue(qreal value)
This property holds the logical position of the handle.
- The position is defined as a percentage of the control's angle range (the
- range within which the handle can be moved) scaled to \c {0.0 - 1.0}.
+ The position is expressed as a fraction of the control's angle range (the
+ range within which the handle can be moved) in the range \c {0.0 - 1.0}.
Unlike the \l value property, the \c position is continuously updated while
the handle is dragged.
diff --git a/src/quicktemplates2/qquickprogressbar.cpp b/src/quicktemplates2/qquickprogressbar.cpp
index 5d5503e6..d8ada6f4 100644
--- a/src/quicktemplates2/qquickprogressbar.cpp
+++ b/src/quicktemplates2/qquickprogressbar.cpp
@@ -192,7 +192,7 @@ void QQuickProgressBar::setValue(qreal value)
This property holds the logical position of the progress.
- The position is defined as a percentage of the value, scaled to
+ The position is expressed as a fraction of the value, in the range
\c {0.0 - 1.0}. For visualizing the progress, the right-to-left
aware \l visualPosition should be used instead.
@@ -212,7 +212,7 @@ qreal QQuickProgressBar::position() const
This property holds the visual position of the progress.
- The position is defined as a percentage of the value, scaled to \c {0.0 - 1.0}.
+ The position is expressed as a fraction of the value, in the range \c {0.0 - 1.0}.
When the control is \l {Control::mirrored}{mirrored}, \c visuaPosition is equal
to \c {1.0 - position}. This makes \c visualPosition suitable for visualizing
the progress, taking right-to-left support into account.
diff --git a/src/quicktemplates2/qquickrangeslider.cpp b/src/quicktemplates2/qquickrangeslider.cpp
index 219292c8..2f2b621c 100644
--- a/src/quicktemplates2/qquickrangeslider.cpp
+++ b/src/quicktemplates2/qquickrangeslider.cpp
@@ -68,8 +68,8 @@ QT_BEGIN_NAMESPACE
}
\endcode
- The \l {first.position} and \l {second.position} properties are defined as a
- percentage of the control's size, scaled within the range \c {0.0 - 1.0}.
+ The \l {first.position} and \l {second.position} properties are expressed as
+ fractions of the control's size, in the range \c {0.0 - 1.0}.
The \l {first.visualPosition} and \l {second.visualPosition} properties are
the same, except that they are reversed in a
\l {Right-to-left User Interfaces}{right-to-left} application.
@@ -485,7 +485,7 @@ void QQuickRangeSlider::setTo(qreal to)
\li visualPosition
\li This property holds the visual position of the first handle.
- The position is defined as a percentage of the control's size, scaled to
+ The position is expressed as a fraction of the control's size, in the range
\c {0.0 - 1.0}. When the control is \l {Control::mirrored}{mirrored}, the
value is equal to \c {1.0 - position}. This makes the value suitable for
visualizing the slider, taking right-to-left support into account.
@@ -493,8 +493,8 @@ void QQuickRangeSlider::setTo(qreal to)
\li position
\li This property holds the logical position of the first handle.
- The position is defined as a percentage of the control's size, scaled
- to \c {0.0 - 1.0}. Unlike \l {first.value}{value}, position is
+ The position is expressed as a fraction of the control's size, in the range
+ \c {0.0 - 1.0}. Unlike \l {first.value}{value}, position is
continuously updated while the handle is dragged. For visualizing a
slider, the right-to-left aware
\l {first.visualPosition}{visualPosition} should be used instead.
@@ -547,7 +547,7 @@ QQuickRangeSliderNode *QQuickRangeSlider::first() const
\li visualPosition
\li This property holds the visual position of the second handle.
- The position is defined as a percentage of the control's size, scaled to
+ The position is expressed as a fraction of the control's size, in the range
\c {0.0 - 1.0}. When the control is \l {Control::mirrored}{mirrored}, the
value is equal to \c {1.0 - position}. This makes the value suitable for
visualizing the slider, taking right-to-left support into account.
@@ -555,8 +555,8 @@ QQuickRangeSliderNode *QQuickRangeSlider::first() const
\li position
\li This property holds the logical position of the second handle.
- The position is defined as a percentage of the control's size, scaled
- to \c {0.0 - 1.0}. Unlike \l {second.value}{value}, position is
+ The position is expressed as a fraction of the control's size, in the range
+ \c {0.0 - 1.0}. Unlike \l {second.value}{value}, position is
continuously updated while the handle is dragged. For visualizing a
slider, the right-to-left aware
\l {second.visualPosition}{visualPosition} should be used instead.
diff --git a/src/quicktemplates2/qquickslider.cpp b/src/quicktemplates2/qquickslider.cpp
index 30910906..c0680725 100644
--- a/src/quicktemplates2/qquickslider.cpp
+++ b/src/quicktemplates2/qquickslider.cpp
@@ -64,8 +64,8 @@ QT_BEGIN_NAMESPACE
}
\endcode
- The \l position property is defined as a percentage of the control's size,
- scaled within the range \c {0.0 - 1.0}. The \l visualPosition property is
+ The \l position property is expressed as a fraction of the control's size,
+ in the range \c {0.0 - 1.0}. The \l visualPosition property is
the same, except that it is reversed in a
\l {Right-to-left User Interfaces}{right-to-left} application. The
visualPosition is useful for positioning the handle when styling Slider.
@@ -258,8 +258,8 @@ void QQuickSlider::setValue(qreal value)
This property holds the logical position of the handle.
- The position is defined as a percentage of the control's size, scaled
- to \c {0.0 - 1.0}. Unlike the \l value property, the \c position is
+ The position is expressed as a fraction of the control's size, in the range
+ \c {0.0 - 1.0}. Unlike the \l value property, the \c position is
continuously updated while the handle is dragged. For visualizing a
slider, the right-to-left aware \l visualPosition should be used instead.
@@ -277,7 +277,7 @@ qreal QQuickSlider::position() const
This property holds the visual position of the handle.
- The position is defined as a percentage of the control's size, scaled to
+ The position is expressed as a fraction of the control's size, in the range
\c {0.0 - 1.0}. When the control is \l {Control::mirrored}{mirrored}, the
value is equal to \c {1.0 - position}. This makes the value suitable for
visualizing the slider, taking right-to-left support into account.
diff --git a/src/quicktemplates2/qquickspinbox.cpp b/src/quicktemplates2/qquickspinbox.cpp
index 957200a4..506405fe 100644
--- a/src/quicktemplates2/qquickspinbox.cpp
+++ b/src/quicktemplates2/qquickspinbox.cpp
@@ -252,7 +252,8 @@ bool QQuickSpinBoxPrivate::handleMouseMoveEvent(QQuickItem *child, QMouseEvent *
bool pressed = up->isPressed() || down->isPressed();
q->setAccessibleProperty("pressed", pressed);
- stopPressRepeat();
+ if (!pressed)
+ stopPressRepeat();
return pressed;
}