summaryrefslogtreecommitdiffstats
path: root/tests/manual/qgraphicsitemgroup
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/qgraphicsitemgroup')
-rw-r--r--tests/manual/qgraphicsitemgroup/CMakeLists.txt10
-rw-r--r--tests/manual/qgraphicsitemgroup/customitem.cpp37
-rw-r--r--tests/manual/qgraphicsitemgroup/customitem.h29
-rw-r--r--tests/manual/qgraphicsitemgroup/main.cpp29
-rw-r--r--tests/manual/qgraphicsitemgroup/widget.cpp43
-rw-r--r--tests/manual/qgraphicsitemgroup/widget.h29
6 files changed, 27 insertions, 150 deletions
diff --git a/tests/manual/qgraphicsitemgroup/CMakeLists.txt b/tests/manual/qgraphicsitemgroup/CMakeLists.txt
index 737bcd5851..d6a158fac5 100644
--- a/tests/manual/qgraphicsitemgroup/CMakeLists.txt
+++ b/tests/manual/qgraphicsitemgroup/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from qgraphicsitemgroup.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## qgraphicsitemgroup Binary:
@@ -10,12 +11,11 @@ qt_internal_add_manual_test(qgraphicsitemgroup
customitem.cpp customitem.h
main.cpp
widget.cpp widget.h widget.ui
- PUBLIC_LIBRARIES
+ NO_PCH_SOURCES
+ widget.cpp # undef QT_NO_FOREACH
+ LIBRARIES
Qt::Gui
Qt::Widgets
ENABLE_AUTOGEN_TOOLS
uic
)
-
-#### Keys ignored in scope 1:.:.:qgraphicsitemgroup.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/manual/qgraphicsitemgroup/customitem.cpp b/tests/manual/qgraphicsitemgroup/customitem.cpp
index 81ecd3d76b..5df16291ad 100644
--- a/tests/manual/qgraphicsitemgroup/customitem.cpp
+++ b/tests/manual/qgraphicsitemgroup/customitem.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "customitem.h"
@@ -34,10 +9,10 @@
QList<CustomGroup*> CustomScene::selectedCustomGroups() const
{
- QList<QGraphicsItem*> all = selectedItems();
+ const QList<QGraphicsItem*> all = selectedItems();
QList<CustomGroup*> groups;
- foreach (QGraphicsItem *item, all) {
+ for (QGraphicsItem *item : all) {
CustomGroup* group = qgraphicsitem_cast<CustomGroup*>(item);
if (group)
groups.append(group);
@@ -48,10 +23,10 @@ QList<CustomGroup*> CustomScene::selectedCustomGroups() const
QList<CustomItem*> CustomScene::selectedCustomItems() const
{
- QList<QGraphicsItem*> all = selectedItems();
+ const QList<QGraphicsItem*> all = selectedItems();
QList<CustomItem*> items;
- foreach (QGraphicsItem *item, all) {
+ for (QGraphicsItem *item : all) {
CustomItem* citem = qgraphicsitem_cast<CustomItem*>(item);
if (citem)
items.append(citem);
diff --git a/tests/manual/qgraphicsitemgroup/customitem.h b/tests/manual/qgraphicsitemgroup/customitem.h
index 84a3b265fc..78f195629d 100644
--- a/tests/manual/qgraphicsitemgroup/customitem.h
+++ b/tests/manual/qgraphicsitemgroup/customitem.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef CUSTOMITEM_H
#define CUSTOMITEM_H
diff --git a/tests/manual/qgraphicsitemgroup/main.cpp b/tests/manual/qgraphicsitemgroup/main.cpp
index 0150369ecb..d586e84d20 100644
--- a/tests/manual/qgraphicsitemgroup/main.cpp
+++ b/tests/manual/qgraphicsitemgroup/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QApplication>
#include "widget.h"
diff --git a/tests/manual/qgraphicsitemgroup/widget.cpp b/tests/manual/qgraphicsitemgroup/widget.cpp
index ba9ed815fa..25362d52a4 100644
--- a/tests/manual/qgraphicsitemgroup/widget.cpp
+++ b/tests/manual/qgraphicsitemgroup/widget.cpp
@@ -1,30 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include "widget.h"
#include "ui_widget.h"
@@ -120,15 +97,15 @@ void Widget::on_scaleItem_valueChanged(int value)
void Widget::on_group_clicked()
{
- QList<QGraphicsItem*> all = scene->selectedItems();
+ const QList<QGraphicsItem*> all = scene->selectedItems();
if (all.size() < 2)
return;
- QList<CustomItem*> items = scene->selectedCustomItems();
+ const QList<CustomItem*> items = scene->selectedCustomItems();
QList<CustomGroup*> groups = scene->selectedCustomGroups();
if (groups.size() == 1) {
- foreach (CustomItem *item, items) {
+ for (CustomItem *item : items) {
item->setSelected(false);
groups[0]->addToGroup(item);
}
@@ -138,7 +115,7 @@ void Widget::on_group_clicked()
CustomGroup* group = new CustomGroup;
scene->addItem(group);
- foreach (QGraphicsItem *item, all) {
+ for (QGraphicsItem *item : all) {
item->setSelected(false);
group->addToGroup(item);
}
@@ -149,9 +126,9 @@ void Widget::on_group_clicked()
void Widget::on_dismantle_clicked()
{
- QList<CustomGroup*> groups = scene->selectedCustomGroups();
+ const QList<CustomGroup*> groups = scene->selectedCustomGroups();
- foreach (CustomGroup *group, groups) {
+ for (CustomGroup *group : groups) {
foreach (QGraphicsItem *item, group->childItems())
group->removeFromGroup(item);
diff --git a/tests/manual/qgraphicsitemgroup/widget.h b/tests/manual/qgraphicsitemgroup/widget.h
index d778adb068..51b2943282 100644
--- a/tests/manual/qgraphicsitemgroup/widget.h
+++ b/tests/manual/qgraphicsitemgroup/widget.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef WIDGET_H
#define WIDGET_H