diff options
Diffstat (limited to 'src/declarative/util/qfxview.cpp')
-rw-r--r-- | src/declarative/util/qfxview.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/declarative/util/qfxview.cpp b/src/declarative/util/qfxview.cpp index 0f129d8..bb436cd 100644 --- a/src/declarative/util/qfxview.cpp +++ b/src/declarative/util/qfxview.cpp @@ -63,6 +63,8 @@ QT_BEGIN_NAMESPACE +DEFINE_BOOL_CONFIG_OPTION(frameRateDebug, QML_SHOW_FRAMERATE) + static QVariant stringToPixmap(const QString &str) { //XXX need to use correct paths @@ -98,6 +100,7 @@ public: QSize initialSize; bool resizable; + QTime frameTimer; void init(); @@ -492,6 +495,19 @@ void QFxView::resizeEvent(QResizeEvent *e) QGraphicsView::resizeEvent(e); } +/*! + \reimp +*/ +void QFxView::paintEvent(QPaintEvent *event) +{ + int time = 0; + if (frameRateDebug()) + time = d->frameTimer.restart(); + QGraphicsView::paintEvent(event); + if (frameRateDebug()) + qDebug() << "paintEvent:" << d->frameTimer.elapsed() << "time since last frame:" << time; +} + /*! \fn void QFxView::focusInEvent(QFocusEvent *e) This virtual function does nothing with the event \a e in this class. |