2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2020 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2011-04-28 11:23:42 +00:00
|
|
|
|
2011-03-18 15:33:31 +00:00
|
|
|
#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)
|
2020-07-23 11:54:47 +00:00
|
|
|
stats.output->setText(tr("DONE. Elapsed: %1, setGeometryCount: %2").arg(stats.timer.elapsed()).arg(stats.setGeometryCount));
|
2011-03-18 15:33:31 +00:00
|
|
|
} else {
|
|
|
|
reiterate = true;
|
|
|
|
}
|
|
|
|
stats.setGeometryTracker.clear();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QGraphicsWidget::setGeometry(rect);
|
|
|
|
|
|
|
|
if (reiterate) {
|
|
|
|
m_window->doAgain();
|
|
|
|
//QTimer::singleShot(0, m_window, SLOT(doAgain()));
|
|
|
|
}
|
|
|
|
}
|