summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/graphicsview/qgraphicslinearlayout
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/graphicsview/qgraphicslinearlayout')
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicslinearlayout/CMakeLists.txt11
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp10
2 files changed, 14 insertions, 7 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/CMakeLists.txt
index 6c2e734348..b63bbb6f33 100644
--- a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/CMakeLists.txt
+++ b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/CMakeLists.txt
@@ -1,13 +1,20 @@
-# Generated from qgraphicslinearlayout.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_qgraphicslinearlayout Test:
#####################################################################
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qgraphicslinearlayout LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
qt_internal_add_test(tst_qgraphicslinearlayout
SOURCES
tst_qgraphicslinearlayout.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Widgets
)
diff --git a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
index ff625dbc00..65212e94cc 100644
--- a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QTest>
@@ -723,7 +723,7 @@ void tst_QGraphicsLinearLayout::orientation()
// important to resize to preferredsize when orientation is switched
widget->resize(widget->effectiveSizeHint(Qt::PreferredSize));
qApp->processEvents();
- for (i = 0; i < positions.count(); ++i) {
+ for (i = 0; i < positions.size(); ++i) {
QGraphicsWidget *item = static_cast<QGraphicsWidget*>(layout.itemAt(i));
if (initialOrientation == Qt::Horizontal)
QCOMPARE(item->pos().y(), positions.at(i));
@@ -1121,7 +1121,7 @@ void tst_QGraphicsLinearLayout::setStretchFactor()
int i;
- for (i = 0; i < stretches.count(); ++i) {
+ for (i = 0; i < stretches.size(); ++i) {
QGraphicsWidget *item = new RectWidget(widget);
item->setMinimumSize(5,5);
item->setPreferredSize(10,5);
@@ -1139,7 +1139,7 @@ void tst_QGraphicsLinearLayout::setStretchFactor()
qreal firstStretch = -1;
qreal firstExtent = -1.;
qreal sumExtent = 0;
- for (i = 0; i < stretches.count(); ++i) {
+ for (i = 0; i < stretches.size(); ++i) {
QGraphicsWidget *item = static_cast<QGraphicsWidget*>(layout.itemAt(i));
qreal extent = item->size().width();
qreal stretch = (qreal)stretches.at(i);
@@ -1297,7 +1297,7 @@ void tst_QGraphicsLinearLayout::defaultStretchFactors()
QSizeF itemSize = layout->itemAt(i)->geometry().size();
if (orientation == Qt::Vertical)
itemSize.transpose();
- if (i < expectedSizes.count())
+ if (i < expectedSizes.size())
QCOMPARE(itemSize.width(), qreal(expectedSizes.at(i)));
}