diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-05-31 05:49:47 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-05-31 05:49:47 (GMT) |
commit | a186682a9c0ca21cd36c0e79cd58f965115f3c10 (patch) | |
tree | 7b3f9c1270888c1e57074520d538242938a74824 /src | |
parent | b8b1e9784583e3b5960b1966328299f8a1bec440 (diff) | |
parent | 51aed62ef08f1ffacce71d44612abe46b8344923 (diff) | |
download | Qt-a186682a9c0ca21cd36c0e79cd58f965115f3c10.zip Qt-a186682a9c0ca21cd36c0e79cd58f965115f3c10.tar.gz Qt-a186682a9c0ca21cd36c0e79cd58f965115f3c10.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/debugger/debugger.pri | 4 | ||||
-rw-r--r-- | src/declarative/debugger/qdeclarativedebugtrace.cpp (renamed from src/declarative/debugger/qdeclarativedebugtiming.cpp) | 39 | ||||
-rw-r--r-- | src/declarative/debugger/qdeclarativedebugtrace_p.h (renamed from src/declarative/debugger/qdeclarativedebugtiming_p.h) | 15 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativelayoutitem.cpp | 11 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativepath.cpp | 5 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativepath_p.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativecomponent.cpp | 7 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativeview.cpp | 18 |
8 files changed, 63 insertions, 38 deletions
diff --git a/src/declarative/debugger/debugger.pri b/src/declarative/debugger/debugger.pri index 6777868..33d0843 100644 --- a/src/declarative/debugger/debugger.pri +++ b/src/declarative/debugger/debugger.pri @@ -6,7 +6,7 @@ SOURCES += \ $$PWD/qdeclarativedebugservice.cpp \ $$PWD/qdeclarativedebugclient.cpp \ $$PWD/qdeclarativedebug.cpp \ - $$PWD/qdeclarativedebugtiming.cpp + $$PWD/qdeclarativedebugtrace.cpp HEADERS += \ $$PWD/qdeclarativedebuggerstatus_p.h \ @@ -14,4 +14,4 @@ HEADERS += \ $$PWD/qdeclarativedebugservice_p.h \ $$PWD/qdeclarativedebugclient_p.h \ $$PWD/qdeclarativedebug_p.h \ - $$PWD/qdeclarativedebugtiming_p.h + $$PWD/qdeclarativedebugtrace_p.h diff --git a/src/declarative/debugger/qdeclarativedebugtiming.cpp b/src/declarative/debugger/qdeclarativedebugtrace.cpp index 5b93852..5e6d5e7 100644 --- a/src/declarative/debugger/qdeclarativedebugtiming.cpp +++ b/src/declarative/debugger/qdeclarativedebugtrace.cpp @@ -39,37 +39,44 @@ ** ****************************************************************************/ -#include "qdeclarativedebugtiming_p.h" +#include "qdeclarativedebugtrace_p.h" #include <QtCore/qdatastream.h> +#include <QtCore/qurl.h> -Q_GLOBAL_STATIC(QDeclarativeDebugTiming, timerInstance); +Q_GLOBAL_STATIC(QDeclarativeDebugTrace, traceInstance); -QDeclarativeDebugTiming::QDeclarativeDebugTiming() +QDeclarativeDebugTrace::QDeclarativeDebugTrace() : QDeclarativeDebugService(QLatin1String("CanvasFrameRate")) { m_timer.start(); } -void QDeclarativeDebugTiming::addEvent(EventType t) +void QDeclarativeDebugTrace::addEvent(EventType t) { if (QDeclarativeDebugService::isDebuggingEnabled()) - timerInstance()->addEventImpl(t); + traceInstance()->addEventImpl(t); } -void QDeclarativeDebugTiming::startRange(RangeType t) +void QDeclarativeDebugTrace::startRange(RangeType t) { if (QDeclarativeDebugService::isDebuggingEnabled()) - timerInstance()->startRangeImpl(t); + traceInstance()->startRangeImpl(t); } -void QDeclarativeDebugTiming::endRange(RangeType t) +void QDeclarativeDebugTrace::rangeData(RangeType t, const QUrl &url) { if (QDeclarativeDebugService::isDebuggingEnabled()) - timerInstance()->endRangeImpl(t); + traceInstance()->rangeDataImpl(t, url); } -void QDeclarativeDebugTiming::addEventImpl(EventType event) +void QDeclarativeDebugTrace::endRange(RangeType t) +{ + if (QDeclarativeDebugService::isDebuggingEnabled()) + traceInstance()->endRangeImpl(t); +} + +void QDeclarativeDebugTrace::addEventImpl(EventType event) { QByteArray data; QDataStream ds(&data, QIODevice::WriteOnly); @@ -77,7 +84,7 @@ void QDeclarativeDebugTiming::addEventImpl(EventType event) sendMessage(data); } -void QDeclarativeDebugTiming::startRangeImpl(RangeType range) +void QDeclarativeDebugTrace::startRangeImpl(RangeType range) { QByteArray data; QDataStream ds(&data, QIODevice::WriteOnly); @@ -85,7 +92,15 @@ void QDeclarativeDebugTiming::startRangeImpl(RangeType range) sendMessage(data); } -void QDeclarativeDebugTiming::endRangeImpl(RangeType range) +void QDeclarativeDebugTrace::rangeDataImpl(RangeType range, const QUrl &u) +{ + QByteArray data; + QDataStream ds(&data, QIODevice::WriteOnly); + ds << m_timer.elapsed() << (int)RangeData << (int)range << (QString)u.toString(); + sendMessage(data); +} + +void QDeclarativeDebugTrace::endRangeImpl(RangeType range) { QByteArray data; QDataStream ds(&data, QIODevice::WriteOnly); diff --git a/src/declarative/debugger/qdeclarativedebugtiming_p.h b/src/declarative/debugger/qdeclarativedebugtrace_p.h index d9ed67c..5ba49a8 100644 --- a/src/declarative/debugger/qdeclarativedebugtiming_p.h +++ b/src/declarative/debugger/qdeclarativedebugtrace_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEDEBUGTIMING_P_H -#define QDECLARATIVEDEBUGTIMING_P_H +#ifndef QDECLARATIVEDEBUGTRACE_P_H +#define QDECLARATIVEDEBUGTRACE_P_H #include <private/qdeclarativedebugservice_p.h> #include <QtCore/qelapsedtimer.h> @@ -49,7 +49,8 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeDebugTiming : public QDeclarativeDebugService +class QUrl; +class QDeclarativeDebugTrace : public QDeclarativeDebugService { public: enum EventType { @@ -63,6 +64,7 @@ public: enum Message { Event, RangeStart, + RangeData, RangeEnd, MaximumMessage @@ -77,13 +79,16 @@ public: }; static void addEvent(EventType); + static void startRange(RangeType); + static void rangeData(RangeType, const QUrl &); static void endRange(RangeType); - QDeclarativeDebugTiming(); + QDeclarativeDebugTrace(); private: void addEventImpl(EventType); void startRangeImpl(RangeType); + void rangeDataImpl(RangeType, const QUrl &); void endRangeImpl(RangeType); QElapsedTimer m_timer; }; @@ -92,5 +97,5 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEDEBUGTIMING_P_H +#endif // QDECLARATIVEDEBUGTRACE_P_H diff --git a/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp b/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp index c8ecbb6..4add66d 100644 --- a/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp @@ -50,20 +50,21 @@ QT_BEGIN_NAMESPACE /*! \qmlclass LayoutItem QDeclarativeLayoutItem \since 4.7 - \brief The LayoutItem element allows you to place your declarative UI elements inside a classical Qt layout. + \brief The LayoutItem element allows declarative UI elements to be placed inside Qt's Graphics View layouts. - LayoutItem is a variant of Item with a couple of additional properties. These properties provide the size hints - needed for items to work in conjunction with Qt Layouts. The Qt Layout will resize the LayoutItem as appropriate, + LayoutItem is a variant of \l Item with additional size hint properties. These properties provide the size hints + necessary for items to work in conjunction with Qt \l{Graphics View Framework}{Graphics View} layout classes + such as QGraphicsLinearLayout and QGraphicsGridLayout. The Qt layout mechanisms will resize the LayoutItem as appropriate, taking its size hints into account, and you can propagate this to the other elements in your UI via anchors and bindings. - This is a QGraphicsLayoutItem subclass, and the properties merely expose the QGraphicsLayoutItem functionality to QML. + This is a QGraphicsLayoutItem subclass, and its properties merely expose the QGraphicsLayoutItem functionality to QML. See the QGraphicsLayoutItem documentation for further details. */ /*! \internal \class QDeclarativeLayoutItem - \brief The QDeclarativeLayoutItem class allows you to place your Fluid UI elements inside a classical Qt layout. + \brief The QDeclarativeLayoutItem class allows you to place your QML UI elements inside Qt's Graphics View layouts. */ diff --git a/src/declarative/graphicsitems/qdeclarativepath.cpp b/src/declarative/graphicsitems/qdeclarativepath.cpp index 2d08c7c..141a938 100644 --- a/src/declarative/graphicsitems/qdeclarativepath.cpp +++ b/src/declarative/graphicsitems/qdeclarativepath.cpp @@ -867,6 +867,9 @@ qreal QDeclarativePathPercent::value() const void QDeclarativePathPercent::setValue(qreal value) { - _value = value; + if (_value != value) { + _value = value; + emit changed(); + } } QT_END_NAMESPACE diff --git a/src/declarative/graphicsitems/qdeclarativepath_p.h b/src/declarative/graphicsitems/qdeclarativepath_p.h index 17a2ea3..dad43e6 100644 --- a/src/declarative/graphicsitems/qdeclarativepath_p.h +++ b/src/declarative/graphicsitems/qdeclarativepath_p.h @@ -175,7 +175,7 @@ private: class Q_DECLARATIVE_EXPORT QDeclarativePathPercent : public QDeclarativePathElement { Q_OBJECT - Q_PROPERTY(qreal value READ value WRITE setValue) + Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY changed) public: QDeclarativePathPercent(QObject *parent=0) : QDeclarativePathElement(parent) {} diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp index 2dc2d2d..9847079 100644 --- a/src/declarative/qml/qdeclarativecomponent.cpp +++ b/src/declarative/qml/qdeclarativecomponent.cpp @@ -53,7 +53,7 @@ #include "private/qdeclarativebinding_p_p.h" #include "private/qdeclarativeglobal_p.h" #include "private/qdeclarativescriptparser_p.h" -#include "private/qdeclarativedebugtiming_p.h" +#include "private/qdeclarativedebugtrace_p.h" #include <QStack> #include <QStringList> @@ -696,7 +696,8 @@ QDeclarativeComponentPrivate::beginCreate(QDeclarativeContextData *context, cons bool isRoot = !ep->inBeginCreate; if (isRoot) - QDeclarativeDebugTiming::startRange(QDeclarativeDebugTiming::Creating); + QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Creating); + QDeclarativeDebugTrace::rangeData(QDeclarativeDebugTrace::Creating, cc->url); QDeclarativeContextData *ctxt = new QDeclarativeContextData; ctxt->isInternal = true; @@ -867,7 +868,7 @@ void QDeclarativeComponentPrivate::completeCreate() QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); complete(ep, &state); - QDeclarativeDebugTiming::endRange(QDeclarativeDebugTiming::Creating); + QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::Creating); } } diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp index d2dab76..6059ad6 100644 --- a/src/declarative/util/qdeclarativeview.cpp +++ b/src/declarative/util/qdeclarativeview.cpp @@ -48,7 +48,7 @@ #include <qdeclarativeglobal_p.h> #include <qdeclarativeguard_p.h> -#include <private/qdeclarativedebugtiming_p.h> +#include <private/qdeclarativedebugtrace_p.h> #include <qscriptvalueiterator.h> #include <qdebug.h> @@ -93,35 +93,35 @@ QDeclarativeScene::QDeclarativeScene() void QDeclarativeScene::keyPressEvent(QKeyEvent *e) { - QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Key); + QDeclarativeDebugTrace::addEvent(QDeclarativeDebugTrace::Key); QGraphicsScene::keyPressEvent(e); } void QDeclarativeScene::keyReleaseEvent(QKeyEvent *e) { - QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Key); + QDeclarativeDebugTrace::addEvent(QDeclarativeDebugTrace::Key); QGraphicsScene::keyReleaseEvent(e); } void QDeclarativeScene::mouseMoveEvent(QGraphicsSceneMouseEvent *e) { - QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Mouse); + QDeclarativeDebugTrace::addEvent(QDeclarativeDebugTrace::Mouse); QGraphicsScene::mouseMoveEvent(e); } void QDeclarativeScene::mousePressEvent(QGraphicsSceneMouseEvent *e) { - QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Mouse); + QDeclarativeDebugTrace::addEvent(QDeclarativeDebugTrace::Mouse); QGraphicsScene::mousePressEvent(e); } void QDeclarativeScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) { - QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Mouse); + QDeclarativeDebugTrace::addEvent(QDeclarativeDebugTrace::Mouse); QGraphicsScene::mouseReleaseEvent(e); } @@ -675,8 +675,8 @@ void QDeclarativeView::paintEvent(QPaintEvent *event) { Q_D(QDeclarativeView); - QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::FramePaint); - QDeclarativeDebugTiming::startRange(QDeclarativeDebugTiming::Painting); + QDeclarativeDebugTrace::addEvent(QDeclarativeDebugTrace::FramePaint); + QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Painting); int time = 0; if (frameRateDebug()) @@ -684,7 +684,7 @@ void QDeclarativeView::paintEvent(QPaintEvent *event) QGraphicsView::paintEvent(event); - QDeclarativeDebugTiming::endRange(QDeclarativeDebugTiming::Painting); + QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::Painting); if (frameRateDebug()) qDebug() << "paintEvent:" << d->frameTimer.elapsed() << "time since last frame:" << time; |