summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2009-11-05 16:30:22 +0100
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2009-11-05 16:30:22 +0100
commit491943409043d7e7fb6e0a4df6fd931867fda1dc (patch)
treeb22f612fb63415f10c2960395688d8962fcdf4e9 /examples
parent2ba9d51b6f8125dc7afbc42a86035fbdf46643fa (diff)
parentdaa4d04090c75ac8e64552f6d14834b2b79d2abb (diff)
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-widget-team into 4.6
Diffstat (limited to 'examples')
-rw-r--r--examples/gestures/imagegestures/imagegestures.pro6
-rw-r--r--examples/gestures/imagegestures/imagewidget.cpp30
-rw-r--r--examples/opengl/hellogl_es/hellogl_es.pro9
-rw-r--r--examples/opengl/hellogl_es2/hellogl_es2.pro6
4 files changed, 16 insertions, 35 deletions
diff --git a/examples/gestures/imagegestures/imagegestures.pro b/examples/gestures/imagegestures/imagegestures.pro
index 7780ad9cec..8c947e41bd 100644
--- a/examples/gestures/imagegestures/imagegestures.pro
+++ b/examples/gestures/imagegestures/imagegestures.pro
@@ -5,12 +5,12 @@ SOURCES = imagewidget.cpp \
mainwidget.cpp
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/gestures/imageviewer
+target.path = $$[QT_INSTALL_EXAMPLES]/gestures/imagegestures
sources.files = $$SOURCES \
$$HEADERS \
$$RESOURCES \
$$FORMS \
- imageviewer.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/gestures/imageviewer
+ imagegestures.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/gestures/imagegestures
INSTALLS += target \
sources
diff --git a/examples/gestures/imagegestures/imagewidget.cpp b/examples/gestures/imagegestures/imagewidget.cpp
index 28de6da270..f615129103 100644
--- a/examples/gestures/imagegestures/imagewidget.cpp
+++ b/examples/gestures/imagegestures/imagewidget.cpp
@@ -102,17 +102,13 @@ void ImageWidget::mouseDoubleClickEvent(QMouseEvent *)
//! [gesture event handler]
bool ImageWidget::gestureEvent(QGestureEvent *event)
{
- if (QGesture *pan = event->gesture(Qt::PanGesture)) {
- panTriggered(static_cast<QPanGesture*>(pan));
- return true;
- } else if (QGesture *pinch = event->gesture(Qt::PinchGesture)) {
- pinchTriggered(static_cast<QPinchGesture*>(pinch));
- return true;
- } else if (QGesture *swipe = event->gesture(Qt::SwipeGesture)) {
- swipeTriggered(static_cast<QSwipeGesture*>(swipe));
- return true;
- }
- return false;
+ if (QGesture *pan = event->gesture(Qt::PanGesture))
+ panTriggered(static_cast<QPanGesture *>(pan));
+ if (QGesture *pinch = event->gesture(Qt::PinchGesture))
+ pinchTriggered(static_cast<QPinchGesture *>(pinch));
+ if (QGesture *swipe = event->gesture(Qt::SwipeGesture))
+ swipeTriggered(static_cast<QSwipeGesture *>(swipe));
+ return true;
}
//! [gesture event handler]
@@ -128,21 +124,21 @@ void ImageWidget::panTriggered(QPanGesture *gesture)
setCursor(Qt::ArrowCursor);
}
#endif
- QPointF lastOffset = gesture->offset();
- horizontalOffset += lastOffset.x();
- verticalOffset += lastOffset.y();
+ QPointF delta = gesture->delta();
+ horizontalOffset += delta.x();
+ verticalOffset += delta.y();
update();
}
void ImageWidget::pinchTriggered(QPinchGesture *gesture)
{
- QPinchGesture::WhatChanged whatChanged = gesture->whatChanged();
- if (whatChanged & QPinchGesture::RotationAngleChanged) {
+ QPinchGesture::ChangeFlags changeFlags = gesture->changeFlags();
+ if (changeFlags & QPinchGesture::RotationAngleChanged) {
qreal value = gesture->property("rotationAngle").toReal();
qreal lastValue = gesture->property("lastRotationAngle").toReal();
rotationAngle += value - lastValue;
}
- if (whatChanged & QPinchGesture::ScaleFactorChanged) {
+ if (changeFlags & QPinchGesture::ScaleFactorChanged) {
qreal value = gesture->property("scaleFactor").toReal();
qreal lastValue = gesture->property("lastScaleFactor").toReal();
scaleFactor += value - lastValue;
diff --git a/examples/opengl/hellogl_es/hellogl_es.pro b/examples/opengl/hellogl_es/hellogl_es.pro
index 3168743415..80ef7df315 100644
--- a/examples/opengl/hellogl_es/hellogl_es.pro
+++ b/examples/opengl/hellogl_es/hellogl_es.pro
@@ -20,15 +20,6 @@ HEADERS += bubble.h
RESOURCES += texture.qrc
QT += opengl
-wince*:{
- contains(QT_CONFIG,opengles1) {
- QMAKE_LIBS += "libGLES_CM.lib"
- }
- contains(QT_CONFIG,opengles1cl) {
- QMAKE_LIBS += "libGLES_CL.lib"
- }
-}
-
# install
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl_es
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es.pro
diff --git a/examples/opengl/hellogl_es2/hellogl_es2.pro b/examples/opengl/hellogl_es2/hellogl_es2.pro
index d5ad4b81ec..92b42248de 100644
--- a/examples/opengl/hellogl_es2/hellogl_es2.pro
+++ b/examples/opengl/hellogl_es2/hellogl_es2.pro
@@ -25,9 +25,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl_es2
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es2.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl_es2
INSTALLS += target sources
-
-
-wince*: {
- QMAKE_LIBS += "libGLESv2.lib"
-
-} \ No newline at end of file