summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Griebl <rgriebl@trolltech.com>2010-05-10 16:37:55 +0200
committerRobert Griebl <rgriebl@trolltech.com>2010-05-10 16:37:55 +0200
commitd00d11f9dcc0dbc966c4d2dca9ab0aab29c3671b (patch)
tree83c3f6c7bb283f62cd8da801caefc2f0ee144f01
parent664a71ddc080111eed3d359e2770fb5c1979053e (diff)
a few minor fixes
-rw-r--r--scroller/qkineticscroller.cpp10
-rw-r--r--scroller/qkineticscroller_p.h2
-rw-r--r--scroller/scroller.pro2
-rw-r--r--testapp/main.cpp1
-rw-r--r--testapp/testapp.pro4
5 files changed, 16 insertions, 3 deletions
diff --git a/scroller/qkineticscroller.cpp b/scroller/qkineticscroller.cpp
index 89a2202..b835efc 100644
--- a/scroller/qkineticscroller.cpp
+++ b/scroller/qkineticscroller.cpp
@@ -190,6 +190,7 @@ QKineticScrollerPrivate::QKineticScrollerPrivate()
, scrollToY(false)
, overshootX(false)
, overshootY(false)
+ , cancelPress(false)
, debugHook(0)
, debugHookUser(0)
{ }
@@ -653,6 +654,7 @@ bool QKineticScrollerPrivate::pressWhileInactive(QKineticScroller::Input, const
if (q->canStartScrollingAt(position)) {
lastPosition = pressPosition = position;
lastTimestamp = pressTimestamp = timestamp;
+ cancelPress = true;
setState(QKineticScroller::StatePressed);
}
}
@@ -699,7 +701,8 @@ bool QKineticScrollerPrivate::moveWhilePressed(QKineticScroller::Input, const QP
}
if (moveStarted) {
- q->cancelPress(pressPosition);
+ if (cancelPress)
+ q->cancelPress(pressPosition);
setState(QKineticScroller::StateDragging);
// subtract the dragStartDistance
@@ -804,8 +807,11 @@ void QKineticScrollerPrivate::timerEventWhileScrolling()
setState(QKineticScroller::StateInactive);
}
-bool QKineticScrollerPrivate::pressWhileScrolling(QKineticScroller::Input, const QPointF &, qint64)
+bool QKineticScrollerPrivate::pressWhileScrolling(QKineticScroller::Input, const QPointF &position, qint64 timestamp)
{
+ lastPosition = pressPosition = position;
+ lastTimestamp = pressTimestamp = timestamp;
+ cancelPress = false;
setState(QKineticScroller::StatePressed);
return true;
}
diff --git a/scroller/qkineticscroller_p.h b/scroller/qkineticscroller_p.h
index 83fc48c..6036beb 100644
--- a/scroller/qkineticscroller_p.h
+++ b/scroller/qkineticscroller_p.h
@@ -157,6 +157,8 @@ public:
qreal overshootStartTimeY;
int timerId;
+ bool cancelPress;
+
void (*debugHook)(void *user, const QPointF &releaseVelocity, const QPointF &position, const QPointF &overshootPosition);
void *debugHookUser;
diff --git a/scroller/scroller.pro b/scroller/scroller.pro
index fa44fbe..97a3ca7 100644
--- a/scroller/scroller.pro
+++ b/scroller/scroller.pro
@@ -3,7 +3,7 @@
######################################################################
TEMPLATE = lib
-CONFIG *= staticlib
+CONFIG *= staticlib create_prl
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/testapp/main.cpp b/testapp/main.cpp
index c54d98d..4240979 100644
--- a/testapp/main.cpp
+++ b/testapp/main.cpp
@@ -69,6 +69,7 @@ public:
setCentralWidget(stack);
} else {
QSplitter *split = new QSplitter();
+ m_settings->setMinimumWidth(m_settings->sizeHint().width());
split->addWidget(stack);
split->addWidget(m_settings);
split->addWidget(m_plot);
diff --git a/testapp/testapp.pro b/testapp/testapp.pro
index c478231..35f72a9 100644
--- a/testapp/testapp.pro
+++ b/testapp/testapp.pro
@@ -3,11 +3,15 @@
######################################################################
TEMPLATE = app
+CONFIG *= link_prl
TARGET =
DEPENDPATH += . ../scroller
INCLUDEPATH += . ../scroller
LIBS += -L../scroller -lscroller
+unix:PRE_TARGETDEPS += ../scroller/libscroller.a
+win32:PRE_TARGETDEPS += ../scroller/scroller.lib
+
QT += webkit
# Input