diff options
author | Geir Vattekar <geir.vattekar@nokia.com> | 2010-06-15 12:02:32 (GMT) |
---|---|---|
committer | Geir Vattekar <geir.vattekar@nokia.com> | 2010-06-15 12:02:32 (GMT) |
commit | ac3c3b3a19207328ffbcbdada10ef61291caba15 (patch) | |
tree | a33f216d62aa506448f7fb6cbdf7640f5f223fe0 /src/imports | |
parent | c5b06919a8fb5d20aae41f0edf9e2ffa99eb1a8a (diff) | |
parent | a041e4eca3467c1baa6245b6fb47def127f30f41 (diff) | |
download | Qt-ac3c3b3a19207328ffbcbdada10ef61291caba15.zip Qt-ac3c3b3a19207328ffbcbdada10ef61291caba15.tar.gz Qt-ac3c3b3a19207328ffbcbdada10ef61291caba15.tar.bz2 |
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/gestures/plugin.cpp | 3 | ||||
-rw-r--r-- | src/imports/gestures/qdeclarativegesturearea.cpp | 4 | ||||
-rw-r--r-- | src/imports/gestures/qdeclarativegesturearea_p.h | 4 | ||||
-rw-r--r-- | src/imports/particles/qdeclarativeparticles.cpp | 26 | ||||
-rw-r--r-- | src/imports/qimportbase.pri | 3 | ||||
-rw-r--r-- | src/imports/webkit/qdeclarativewebview.cpp | 7 | ||||
-rw-r--r-- | src/imports/webkit/qdeclarativewebview_p.h | 4 |
7 files changed, 27 insertions, 24 deletions
diff --git a/src/imports/gestures/plugin.cpp b/src/imports/gestures/plugin.cpp index 11f2392..1fc23ca 100644 --- a/src/imports/gestures/plugin.cpp +++ b/src/imports/gestures/plugin.cpp @@ -53,7 +53,9 @@ public: virtual void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.gestures")); +#ifndef QT_NO_GESTURES qmlRegisterCustomType<QDeclarativeGestureArea>(uri,1,0, "GestureArea", new QDeclarativeGestureAreaParser); +#endif } }; @@ -62,4 +64,3 @@ QT_END_NAMESPACE #include "plugin.moc" Q_EXPORT_PLUGIN2(qmlgesturesplugin, QT_PREPEND_NAMESPACE(GestureAreaQmlPlugin)); - diff --git a/src/imports/gestures/qdeclarativegesturearea.cpp b/src/imports/gestures/qdeclarativegesturearea.cpp index 1b0aeeb..22be2f1 100644 --- a/src/imports/gestures/qdeclarativegesturearea.cpp +++ b/src/imports/gestures/qdeclarativegesturearea.cpp @@ -55,6 +55,8 @@ #include <private/qobject_p.h> +#ifndef QT_NO_GESTURES + QT_BEGIN_NAMESPACE class QDeclarativeGestureAreaPrivate : public QDeclarativeItemPrivate @@ -267,3 +269,5 @@ bool QDeclarativeGestureAreaPrivate::gestureEvent(QGestureEvent *event) } QT_END_NAMESPACE + +#endif // QT_NO_GESTURES diff --git a/src/imports/gestures/qdeclarativegesturearea_p.h b/src/imports/gestures/qdeclarativegesturearea_p.h index 0195511..ff89166 100644 --- a/src/imports/gestures/qdeclarativegesturearea_p.h +++ b/src/imports/gestures/qdeclarativegesturearea_p.h @@ -50,6 +50,8 @@ #include <QtCore/qstring.h> #include <QtGui/qgesture.h> +#ifndef QT_NO_GESTURES + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -97,4 +99,6 @@ QML_DECLARE_TYPE(QDeclarativeGestureArea) QT_END_HEADER +#endif // QT_NO_GESTURES + #endif diff --git a/src/imports/particles/qdeclarativeparticles.cpp b/src/imports/particles/qdeclarativeparticles.cpp index ecc6604..630c068 100644 --- a/src/imports/particles/qdeclarativeparticles.cpp +++ b/src/imports/particles/qdeclarativeparticles.cpp @@ -241,11 +241,13 @@ void QDeclarativeParticleMotionGravity::setAcceleration(qreal accel) void QDeclarativeParticleMotionGravity::advance(QDeclarativeParticle &p, int interval) { - qreal xdiff = p.x - _xAttr; - qreal ydiff = p.y - _yAttr; + qreal xdiff = _xAttr - p.x; + qreal ydiff = _yAttr - p.y; + qreal absXdiff = qAbs(xdiff); + qreal absYdiff = qAbs(ydiff); - qreal xcomp = xdiff / (xdiff + ydiff); - qreal ycomp = ydiff / (xdiff + ydiff); + qreal xcomp = xdiff / (absXdiff + absYdiff); + qreal ycomp = ydiff / (absXdiff + absYdiff); p.x_velocity += xcomp * _accel * interval; p.y_velocity += ycomp * _accel * interval; @@ -1284,11 +1286,7 @@ void QDeclarativeParticlesPainter::paint(QPainter *p, const QStyleOptionGraphics const int myX = x() + parentItem()->x(); const int myY = y() + parentItem()->y(); -#if (QT_VERSION >= QT_VERSION_CHECK(4,7,0)) QVarLengthArray<QPainter::PixmapFragment, 256> pixmapData; -#else - QVarLengthArray<QDrawPixmaps::Data, 256> pixmapData; -#endif pixmapData.resize(d->particles.count()); const QRectF sourceRect = d->image.rect(); @@ -1296,32 +1294,20 @@ void QDeclarativeParticlesPainter::paint(QPainter *p, const QStyleOptionGraphics qreal halfPHeight = sourceRect.height()/2.; for (int i = 0; i < d->particles.count(); ++i) { const QDeclarativeParticle &particle = d->particles.at(i); -#if (QT_VERSION >= QT_VERSION_CHECK(4,7,0)) pixmapData[i].x = particle.x - myX + halfPWidth; pixmapData[i].y = particle.y - myY + halfPHeight; -#else - pixmapData[i].point = QPointF(particle.x - myX + halfPWidth, particle.y - myY + halfPHeight); -#endif pixmapData[i].opacity = particle.opacity; //these never change pixmapData[i].rotation = 0; pixmapData[i].scaleX = 1; pixmapData[i].scaleY = 1; -#if (QT_VERSION >= QT_VERSION_CHECK(4,7,0)) pixmapData[i].sourceLeft = sourceRect.left(); pixmapData[i].sourceTop = sourceRect.top(); pixmapData[i].width = sourceRect.width(); pixmapData[i].height = sourceRect.height(); -#else - pixmapData[i].source = sourceRect; -#endif } -#if (QT_VERSION >= QT_VERSION_CHECK(4,7,0)) p->drawPixmapFragments(pixmapData.data(), d->particles.count(), d->image); -#else - qDrawPixmaps(p, pixmapData.data(), d->particles.count(), d->image); -#endif } void QDeclarativeParticles::componentComplete() diff --git a/src/imports/qimportbase.pri b/src/imports/qimportbase.pri index 91f6552..0f70030 100644 --- a/src/imports/qimportbase.pri +++ b/src/imports/qimportbase.pri @@ -1,3 +1,4 @@ +symbian:include(../plugins/qpluginbase.pri) TEMPLATE = lib CONFIG += qt plugin @@ -17,6 +18,8 @@ copy2build.output = $$QT_BUILD_TREE/imports/$$TARGETPATH/qmldir copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} copy2build.name = COPY ${QMAKE_FILE_IN} copy2build.CONFIG += no_link +# `clean' should leave the build in a runnable state, which means it shouldn't delete qmldir +copy2build.CONFIG += no_clean QMAKE_EXTRA_COMPILERS += copy2build TARGET = $$qtLibraryTarget($$TARGET) diff --git a/src/imports/webkit/qdeclarativewebview.cpp b/src/imports/webkit/qdeclarativewebview.cpp index 050e2b7..383f1ce 100644 --- a/src/imports/webkit/qdeclarativewebview.cpp +++ b/src/imports/webkit/qdeclarativewebview.cpp @@ -711,7 +711,7 @@ bool QDeclarativeWebView::sceneEvent(QEvent *event) return QDeclarativeItem::sceneEvent(event); } - +#ifndef QT_NO_ACTION /*! \qmlproperty action WebView::back This property holds the action for causing the previous URL in the history to be displayed. @@ -747,6 +747,7 @@ QAction *QDeclarativeWebView::stopAction() const { return page()->action(QWebPage::Stop); } +#endif // QT_NO_ACTION /*! \qmlproperty real WebView::title @@ -1162,9 +1163,9 @@ QString QDeclarativeWebPage::chooseFile(QWebFrame *originatingFrame, const QStri } /*! - \qmlsignal WebView::alert(message) + \qmlsignal WebView::onAlert(message) - This signal is emitted when the web engine sends a JavaScript alert. The \a message is the text + This handler is called when the web engine sends a JavaScript alert. The \a message is the text to be displayed in the alert to the user. */ diff --git a/src/imports/webkit/qdeclarativewebview_p.h b/src/imports/webkit/qdeclarativewebview_p.h index 87bd938..042237e 100644 --- a/src/imports/webkit/qdeclarativewebview_p.h +++ b/src/imports/webkit/qdeclarativewebview_p.h @@ -108,10 +108,12 @@ class QDeclarativeWebView : public QDeclarativeItem Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) Q_PROPERTY(Status status READ status NOTIFY statusChanged) +#ifndef QT_NO_ACTION Q_PROPERTY(QAction* reload READ reloadAction CONSTANT) Q_PROPERTY(QAction* back READ backAction CONSTANT) Q_PROPERTY(QAction* forward READ forwardAction CONSTANT) Q_PROPERTY(QAction* stop READ stopAction CONSTANT) +#endif Q_PROPERTY(QDeclarativeWebSettings* settings READ settingsObject CONSTANT) @@ -154,10 +156,12 @@ public: qreal progress() const; QString statusText() const; +#ifndef QT_NO_ACTION QAction *reloadAction() const; QAction *backAction() const; QAction *forwardAction() const; QAction *stopAction() const; +#endif QWebPage *page() const; void setPage(QWebPage *page); |