aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-07-09 15:35:47 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-07-11 07:17:34 +0000
commit538f47cb77f2dcc34383859bd64de3667987f17b (patch)
tree4e419daa811dfdcf874b929a440cc092316ceffa /src/quicktemplates2
parent09706e8f9fc481d848a3616cace58baf5bc8b67c (diff)
QQuickAbstractButton: make the press point available via private API
The Material style ripple effect needs it to be able to anchor waves at the press point. Export QQuickAbstractButtonPrivate to make it accessible, and update the press point before emitting pressedChanged() since that's what the ripple effect reacts to. Press point dependent ripple effects follow in separate commits. Change-Id: I63eb51eeabcbeb307dea9d0b1731bdb51b518ec7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2')
-rw-r--r--src/quicktemplates2/qquickabstractbutton.cpp4
-rw-r--r--src/quicktemplates2/qquickabstractbutton_p_p.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/quicktemplates2/qquickabstractbutton.cpp b/src/quicktemplates2/qquickabstractbutton.cpp
index c4b2b6f0..ac5fbf55 100644
--- a/src/quicktemplates2/qquickabstractbutton.cpp
+++ b/src/quicktemplates2/qquickabstractbutton.cpp
@@ -474,8 +474,8 @@ void QQuickAbstractButton::keyPressEvent(QKeyEvent *event)
Q_D(QQuickAbstractButton);
QQuickControl::keyPressEvent(event);
if (event->key() == Qt::Key_Space) {
- setPressed(true);
d->pressPoint = QPoint(qRound(width() / 2), qRound(height() / 2));
+ setPressed(true);
if (d->autoRepeat) {
d->startRepeatDelay();
@@ -506,8 +506,8 @@ void QQuickAbstractButton::mousePressEvent(QMouseEvent *event)
{
Q_D(QQuickAbstractButton);
QQuickControl::mousePressEvent(event);
- setPressed(true);
d->pressPoint = event->pos();
+ setPressed(true);
emit pressed();
diff --git a/src/quicktemplates2/qquickabstractbutton_p_p.h b/src/quicktemplates2/qquickabstractbutton_p_p.h
index e690bbd0..a7d4d6c2 100644
--- a/src/quicktemplates2/qquickabstractbutton_p_p.h
+++ b/src/quicktemplates2/qquickabstractbutton_p_p.h
@@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE
class QQuickButtonGroup;
-class QQuickAbstractButtonPrivate : public QQuickControlPrivate
+class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickAbstractButtonPrivate : public QQuickControlPrivate
{
Q_DECLARE_PUBLIC(QQuickAbstractButton)