diff options
author | Pulse Build System <qt-info@nokia.com> | 2010-01-27 06:54:29 (GMT) |
---|---|---|
committer | Pulse Build System <qt-info@nokia.com> | 2010-01-27 06:54:29 (GMT) |
commit | ec90f6ed28ec735ce963c4257ea1095ecbc6c6ba (patch) | |
tree | 5a33a6c6a9893eaf9ce88dee36a976d46767327a /tools | |
parent | d7d4abbcbf4f39a0b3d568af111c81be18d2a83a (diff) | |
parent | 416cf8a5a9384f942282a2c715ec4832eeba001d (diff) | |
download | Qt-ec90f6ed28ec735ce963c4257ea1095ecbc6c6ba.zip Qt-ec90f6ed28ec735ce963c4257ea1095ecbc6c6ba.tar.gz Qt-ec90f6ed28ec735ce963c4257ea1095ecbc6c6ba.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-2: (33 commits)
Compile with no-webkit - add missing semi-colons.
Fixes visibility update missing when doing setParentItem on graphicsitem
Stabilize tst_QGraphicsScene::polishItems2 (new test)
Fixed an infinite loop that could occur when reading invalid BMP images.
Updated docs regarding QGLWidget::renderText() limitations.
Added optimization flag to QGraphicsItemPrivate.
Fixed child items with graphics effects not inheriting opacity.
Made the trace replayer handle limited resolution cases better.
Small optimization in raster paint engine.
Another ASSERT while deleting spans
Implement QDirectFBPixmapData::scroll
Potential crash when adding items from QGraphicsWidget::polishEvent().
QGraphicsWidget is painted twice on the inital show.
Fix QPainter::redirection() to pass autotest.
Re-added the Close button in QPrintPreviewDialog for Mac/Carbon.
revert parts of 10392eef4fd4f9
Fix y-inverted pixmaps properly.
Fix rendering with simple shader in GL2 engine
removed a debug trace
Fix documentation bug in QColor
...
Diffstat (limited to 'tools')
-rw-r--r-- | tools/assistant/tools/assistant/centralwidget.cpp | 4 | ||||
-rw-r--r-- | tools/qttracereplay/main.cpp | 28 |
2 files changed, 24 insertions, 8 deletions
diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index c8f41e4..055fa1c 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -1088,7 +1088,7 @@ CentralWidget::setSourceFromSearch(const QUrl &url) { setSource(url); #if defined(QT_NO_WEBKIT) - highlightSearchTerms() + highlightSearchTerms(); #else connect(currentHelpViewer(), SIGNAL(loadFinished(bool)), this, SLOT(highlightSearchTerms())); @@ -1100,7 +1100,7 @@ CentralWidget::setSourceFromSearchInNewTab(const QUrl &url) { setSourceInNewTab(url); #if defined(QT_NO_WEBKIT) - highlightSearchTerms() + highlightSearchTerms(); #else connect(currentHelpViewer(), SIGNAL(loadFinished(bool)), this, SLOT(highlightSearchTerms())); diff --git a/tools/qttracereplay/main.cpp b/tools/qttracereplay/main.cpp index 85e9b12..a932d72 100644 --- a/tools/qttracereplay/main.cpp +++ b/tools/qttracereplay/main.cpp @@ -52,6 +52,7 @@ public: ReplayWidget(const QString &filename); void paintEvent(QPaintEvent *event); + void resizeEvent(QResizeEvent *event); public slots: void updateRect(); @@ -64,14 +65,15 @@ public: int currentIteration; QTime timer; + QList<uint> visibleUpdates; QList<uint> iterationTimes; QString filename; }; void ReplayWidget::updateRect() { - if (!updates.isEmpty()) - update(updates.at(currentFrame)); + if (!visibleUpdates.isEmpty()) + update(updates.at(visibleUpdates.at(currentFrame))); } void ReplayWidget::paintEvent(QPaintEvent *) @@ -80,10 +82,10 @@ void ReplayWidget::paintEvent(QPaintEvent *) // p.setClipRegion(frames.at(currentFrame).updateRegion); - buffer.draw(&p, currentFrame); + buffer.draw(&p, visibleUpdates.at(currentFrame)); ++currentFrame; - if (currentFrame >= buffer.numFrames()) { + if (currentFrame >= visibleUpdates.size()) { currentFrame = 0; ++currentIteration; @@ -119,7 +121,7 @@ void ReplayWidget::paintEvent(QPaintEvent *) if (iterationTimes.size() >= 10 || stddev < 4) { printf("%s, iterations: %d, frames: %d, min(ms): %d, median(ms): %d, stddev: %f %%, max(fps): %f\n", qPrintable(filename), - iterationTimes.size(), updates.size(), min, median, stddev, 1000. * updates.size() / min); + iterationTimes.size(), visibleUpdates.size(), min, median, stddev, 1000. * visibleUpdates.size() / min); deleteLater(); return; } @@ -130,6 +132,21 @@ void ReplayWidget::paintEvent(QPaintEvent *) QTimer::singleShot(0, this, SLOT(updateRect())); } +void ReplayWidget::resizeEvent(QResizeEvent *event) +{ + visibleUpdates.clear(); + + QRect bounds = rect(); + for (int i = 0; i < updates.size(); ++i) { + if (updates.at(i).intersects(bounds)) + visibleUpdates << i; + } + + if (visibleUpdates.size() != updates.size()) + printf("Warning: skipped %d frames due to limited resolution\n", updates.size() - visibleUpdates.size()); + +} + ReplayWidget::ReplayWidget(const QString &filename_) : currentFrame(0) , currentIteration(0) @@ -138,7 +155,6 @@ ReplayWidget::ReplayWidget(const QString &filename_) setWindowTitle(filename); QFile file(filename); - QRect bounds; if (!file.open(QIODevice::ReadOnly)) { printf("Failed to load input file '%s'\n", qPrintable(filename_)); return; |