diff options
author | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2011-03-18 15:33:31 (GMT) |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2011-04-14 10:27:59 (GMT) |
commit | fae8bb9f583b416bf47208561c38e0b102f8578c (patch) | |
tree | a47ec9ea6270b352bb97bfd5987802b2ca2e6f5c /tests/manual/qgraphicslayout/flicker/window.cpp | |
parent | b8b4e6fe141d99c4639d492a546226cdc3fc06c5 (diff) | |
download | Qt-fae8bb9f583b416bf47208561c38e0b102f8578c.zip Qt-fae8bb9f583b416bf47208561c38e0b102f8578c.tar.gz Qt-fae8bb9f583b416bf47208561c38e0b102f8578c.tar.bz2 |
Manual test for layout flickering
Diffstat (limited to 'tests/manual/qgraphicslayout/flicker/window.cpp')
-rw-r--r-- | tests/manual/qgraphicslayout/flicker/window.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/manual/qgraphicslayout/flicker/window.cpp b/tests/manual/qgraphicslayout/flicker/window.cpp new file mode 100644 index 0000000..d193ad1 --- /dev/null +++ b/tests/manual/qgraphicslayout/flicker/window.cpp @@ -0,0 +1,32 @@ +#include "window.h" + +void SlowWidget::setGeometry(const QRectF &rect) +{ + bool reiterate = false; + Statistics &stats = *m_stats; + if (stats.relayoutClicked) { + ++(stats.setGeometryTracker[this]); + ++stats.setGeometryCount; + qDebug() << "setGeometryCount:" << stats.setGeometryCount; + if (stats.setGeometryTracker.count() == m_window->m_depthSpinBox->value()) { + ++stats.currentBenchmarkIteration; + qDebug() << "currentBenchmarkIteration:" << stats.currentBenchmarkIteration; + if (stats.currentBenchmarkIteration == m_window->m_benchmarkIterationsSpinBox->value()) { + if (stats.output) + stats.output->setText(tr("DONE. Elapsed: %1, setGeometryCount: %2").arg(stats.time.elapsed()).arg(stats.setGeometryCount)); + } else { + reiterate = true; + } + stats.setGeometryTracker.clear(); + + } + } + + QGraphicsWidget::setGeometry(rect); + + if (reiterate) { + m_window->doAgain(); + //QTimer::singleShot(0, m_window, SLOT(doAgain())); + } +} + |