summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-05-31 05:40:35 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-05-31 05:40:35 (GMT)
commit52c59ff63d7c13ac26ba068bba4809930439337f (patch)
tree243ebeb73cedd77c4e3bea4a1be1f868117f095f /src/declarative
parenta0b725d916ec794c1a0f02b37525a15ad27d145d (diff)
parent51aed62ef08f1ffacce71d44612abe46b8344923 (diff)
downloadQt-52c59ff63d7c13ac26ba068bba4809930439337f.zip
Qt-52c59ff63d7c13ac26ba068bba4809930439337f.tar.gz
Qt-52c59ff63d7c13ac26ba068bba4809930439337f.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/QmlChanges.txt5
-rw-r--r--src/declarative/debugger/debugger.pri4
-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.cpp11
-rw-r--r--src/declarative/graphicsitems/qdeclarativepath.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativepath_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp118
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p.h8
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp6
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p.h2
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp7
-rw-r--r--src/declarative/util/qdeclarativeview.cpp18
13 files changed, 197 insertions, 43 deletions
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt
index 3eed8d6..0df5f10 100644
--- a/src/declarative/QmlChanges.txt
+++ b/src/declarative/QmlChanges.txt
@@ -1,6 +1,9 @@
=============================================================================
The changes below are pre Qt 4.7.0 RC
+TextInput and TextEdit:
+ - showInputPanelOnFocus property added
+ - openSoftwareInputPanel() and closeSoftwareInputPanel() functions added
Flickable:
- overShoot is replaced by boundsBehavior enumeration
- flickingHorizontally and flickingVertically properties added
@@ -11,6 +14,8 @@ Component:
status property instead
- errorsString() renamed to errorString()
+TextInput xToPosition -> positionAt (to match TextEdit.positionAt)
+
QList<QObject*> models no longer provide properties in model object. The
properties are now updated when the object changes. An object's property
"foo" may now be accessed as "foo", modelData.foo" or model.modelData.foo"
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/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index f02b7d1..3a0c16d 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -89,6 +89,13 @@ TextEdit {
A particular look-and-feel might use smooth scrolling (eg. using SmoothedFollow), might have a visible
scrollbar, or a scrollbar that fades in to show location, etc.
+ Clipboard support is provided by the cut(), copy(), and paste() functions, and the selection can
+ be handled in a traditional "mouse" mechanism by setting selectByMouse, or handled completely
+ from QML by manipulating selectionStart and selectionEnd, or using selectAll() or selectWord().
+
+ You can translate between cursor positions (characters from the start of the document) and pixel
+ points using positionAt() and positionToRectangle().
+
\sa Text
*/
@@ -531,6 +538,70 @@ qreal QDeclarativeTextEdit::paintedHeight() const
return implicitHeight();
}
+/*!
+ \qmlmethod rectangle TextEdit::positionToRectangle(position)
+
+ Returns the rectangle at the given \a position in the text. The x, y,
+ and height properties correspond to the cursor that would describe
+ that position.
+*/
+QRectF QDeclarativeTextEdit::positionToRectangle(int pos) const
+{
+ Q_D(const QDeclarativeTextEdit);
+ QTextCursor c(d->document);
+ c.setPosition(pos);
+ return d->control->cursorRect(c);
+
+}
+
+/*!
+ \qmlmethod int TextEdit::positionAt(x,y)
+
+ Returns the text position closest to pixel position (\a x,\a y).
+
+ Position 0 is before the first character, position 1 is after the first character
+ but before the second, and so on until position text.length, which is after all characters.
+*/
+int QDeclarativeTextEdit::positionAt(int x, int y) const
+{
+ Q_D(const QDeclarativeTextEdit);
+ int r = d->document->documentLayout()->hitTest(QPoint(x,y-d->yoff), Qt::FuzzyHit);
+ return r;
+}
+
+/*!
+ \qmlmethod int TextEdit::moveCursorSeletion(int pos)
+
+ Moves the cursor to \a position and updates the selection accordingly.
+ (To only move the cursor, set the \l cursorPosition property.)
+
+ When this method is called it additionally sets either the
+ selectionStart or the selectionEnd (whichever was at the previous cursor position)
+ to the specified position. This allows you to easily extend and contract the selected
+ text range.
+
+ For example, take this sequence of calls:
+
+ \code
+ cursorPosition = 5
+ moveCursorSelection(9)
+ moveCursorSelection(7)
+ \endcode
+
+ This moves the cursor to position 5, extend the selection end from 5 to 9
+ and then retract the selection end from 9 to 7, leaving the text from position 5 to 7
+ selected (the 6th and 7th characters).
+*/
+void QDeclarativeTextEdit::moveCursorSelection(int pos)
+{
+ //Note that this is the same as setCursorPosition but with the KeepAnchor flag set
+ Q_D(QDeclarativeTextEdit);
+ QTextCursor cursor = d->control->textCursor();
+ if (cursor.position() == pos)
+ return;
+ cursor.setPosition(pos, QTextCursor::KeepAnchor);
+ d->control->setTextCursor(cursor);
+}
/*!
\qmlproperty bool TextEdit::cursorVisible
@@ -956,6 +1027,51 @@ void QDeclarativeTextEdit::selectAll()
}
/*!
+ Causes the word closest to the current cursor position to be selected.
+*/
+void QDeclarativeTextEdit::selectWord()
+{
+ Q_D(QDeclarativeTextEdit);
+ QTextCursor c = d->control->textCursor();
+ c.select(QTextCursor::WordUnderCursor);
+ d->control->setTextCursor(c);
+}
+
+/*!
+ \qmlmethod TextEdit::cut()
+
+ Moves the currently selected text to the system clipboard.
+*/
+void QDeclarativeTextEdit::cut()
+{
+ Q_D(QDeclarativeTextEdit);
+ d->control->cut();
+}
+
+/*!
+ \qmlmethod TextEdit::copy()
+
+ Copies the currently selected text to the system clipboard.
+*/
+void QDeclarativeTextEdit::copy()
+{
+ Q_D(QDeclarativeTextEdit);
+ d->control->copy();
+}
+
+/*!
+ \qmlmethod TextEdit::paste()
+
+ Relaces the currently selected text by the contents of the system clipboard.
+*/
+void QDeclarativeTextEdit::paste()
+{
+ Q_D(QDeclarativeTextEdit);
+ d->control->paste();
+}
+
+
+/*!
\overload
Handles the given mouse \a event.
*/
@@ -1340,7 +1456,7 @@ void QDeclarativeTextEdit::setShowInputPanelOnFocus(bool showOnFocus)
void QDeclarativeTextEdit::focusInEvent(QFocusEvent *event)
{
Q_D(const QDeclarativeTextEdit);
- if (d->showInputPanelOnFocus && !isReadOnly()) {
+ if (d->showInputPanelOnFocus && !isReadOnly() && event->reason() != Qt::ActiveWindowFocusReason) {
openSoftwareInputPanel();
}
QDeclarativePaintedItem::focusInEvent(event);
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
index 47174f4..a83b3db 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
@@ -198,6 +198,10 @@ public:
qreal paintedWidth() const;
qreal paintedHeight() const;
+ Q_INVOKABLE QRectF positionToRectangle(int) const;
+ Q_INVOKABLE int positionAt(int x, int y) const;
+ Q_INVOKABLE void moveCursorSelection(int pos);
+
Q_SIGNALS:
void textChanged(const QString &);
void paintedSizeChanged();
@@ -225,6 +229,10 @@ Q_SIGNALS:
public Q_SLOTS:
void selectAll();
+ void selectWord();
+ void cut();
+ void copy();
+ void paste();
private Q_SLOTS:
void updateImgCache(const QRectF &rect);
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 18e3595..9a6a070 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -833,7 +833,7 @@ void QDeclarativeTextInput::moveCursor()
}
/*!
- \qmlmethod int TextInput::xToPosition(int x)
+ \qmlmethod int TextInput::positionAt(int x)
This function returns the character position at
x pixels from the left of the textInput. Position 0 is before the
@@ -843,7 +843,7 @@ void QDeclarativeTextInput::moveCursor()
This means that for all x values before the first character this function returns 0,
and for all x values after the last character this function returns text.length.
*/
-int QDeclarativeTextInput::xToPosition(int x)
+int QDeclarativeTextInput::positionAt(int x)
{
Q_D(const QDeclarativeTextInput);
return d->control->xToPos(x - d->hscroll);
@@ -1282,7 +1282,7 @@ void QDeclarativeTextInput::setShowInputPanelOnFocus(bool showOnFocus)
void QDeclarativeTextInput::focusInEvent(QFocusEvent *event)
{
Q_D(const QDeclarativeTextInput);
- if (d->showInputPanelOnFocus && !isReadOnly()) {
+ if (d->showInputPanelOnFocus && !isReadOnly() && event->reason() != Qt::ActiveWindowFocusReason) {
openSoftwareInputPanel();
}
QDeclarativePaintedItem::focusInEvent(event);
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
index 438293a..6bb94c2 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
@@ -110,7 +110,7 @@ public:
};
//Auxilliary functions needed to control the TextInput from QML
- Q_INVOKABLE int xToPosition(int x);
+ Q_INVOKABLE int positionAt(int x);
Q_INVOKABLE void moveCursorSelection(int pos);
Q_INVOKABLE void openSoftwareInputPanel();
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;