diff options
author | Shawn Rutledge <[email protected]> | 2024-11-11 20:10:48 +0100 |
---|---|---|
committer | Shawn Rutledge <[email protected]> | 2024-11-12 13:55:13 +0100 |
commit | 5e69fed692ca5c8dd4fcf5c1c786177e68607ea6 (patch) | |
tree | e50c72c08a42cb535949af2ac45b74ae8f26f141 | |
parent | 7715c5f056a4c8201bd3a638defd8b9980cb6b64 (diff) |
Fix warnings in rendercontrol_rhi example
Task-number: QTBUG-130991
Pick-to: 6.8 6.8.1
Change-Id: Ie2afcc693ef13ab482229e77e62514183675e9e7
Reviewed-by: Oliver Eftevaag <[email protected]>
-rw-r--r-- | examples/quick/rendercontrol/rendercontrol_rhi/main.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/quick/rendercontrol/rendercontrol_rhi/main.cpp b/examples/quick/rendercontrol/rendercontrol_rhi/main.cpp index 76f2ade0a9..d6cf4ce241 100644 --- a/examples/quick/rendercontrol/rendercontrol_rhi/main.cpp +++ b/examples/quick/rendercontrol/rendercontrol_rhi/main.cpp @@ -161,7 +161,7 @@ MainWindow::MainWindow() "This is due to widgets themselves relying on QPropertyAnimation and similar, which are driven by the same QAnimationDriver.\n" "In any case, the functionality of the widgets are not affected, just the rendering may lag behind.\n" "When not checked, Qt Quick animations advance based on the system time, i.e. the time elapsed since the last press of the Next button.")); - QObject::connect(animCheckBox, &QCheckBox::stateChanged, animCheckBox, [this, animCheckBox, animSlider, animLabel] { + QObject::connect(animCheckBox, &QCheckBox::checkStateChanged, animCheckBox, [this, animCheckBox, animSlider, animLabel] { if (animCheckBox->isChecked()) { animSlider->setEnabled(true); animLabel->setEnabled(true); @@ -183,7 +183,7 @@ MainWindow::MainWindow() //! [anim-slider] QCheckBox *mirrorCheckBox = new QCheckBox(tr("Mirror vertically")); - QObject::connect(mirrorCheckBox, &QCheckBox::stateChanged, mirrorCheckBox, [this, mirrorCheckBox] { + QObject::connect(mirrorCheckBox, &QCheckBox::checkStateChanged, mirrorCheckBox, [this, mirrorCheckBox] { m_mirrorVertically = mirrorCheckBox->isChecked(); }); controlLayout->addWidget(mirrorCheckBox); @@ -524,7 +524,7 @@ void MainWindow::render() m_frameCount += 1; double v = 0; - for (double t : m_cpuTimes) + for (double t : std::as_const(m_cpuTimes)) v += t; v /= m_cpuTimes.count(); m_avgCpuMsg->setText(tr("Avg. CPU render time: %1 ms").arg(v, 0, 'f', 4)); @@ -533,7 +533,7 @@ void MainWindow::render() m_cpuTimes.append(v); } v = 0; - for (double t : m_gpuTimes) + for (double t : std::as_const(m_gpuTimes)) v += t; v /= m_gpuTimes.count(); m_avgGpuMsg->setText(tr("Avg. GPU render time: %1 ms").arg(v, 0, 'f', 4)); |