diff --git a/tests/manual/qcursor/CMakeLists.txt b/tests/manual/qcursor/CMakeLists.txt index 3f6e73818e3..be0dd45170b 100644 --- a/tests/manual/qcursor/CMakeLists.txt +++ b/tests/manual/qcursor/CMakeLists.txt @@ -2,7 +2,6 @@ # SPDX-License-Identifier: BSD-3-Clause add_subdirectory(allcursors) -add_subdirectory(childwidget) add_subdirectory(childwindow) add_subdirectory(childwindowcontainer) add_subdirectory(grab_override) diff --git a/tests/manual/qcursor/childwidget/CMakeLists.txt b/tests/manual/qcursor/childwidget/CMakeLists.txt deleted file mode 100644 index 3475948d8b0..00000000000 --- a/tests/manual/qcursor/childwidget/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: BSD-3-Clause - -##################################################################### -## tst_manual_childwidget Binary: -##################################################################### - -qt_internal_add_manual_test(tst_manual_childwidget - GUI - SOURCES - main.cpp - INCLUDE_DIRECTORIES - . - LIBRARIES - Qt::Gui - Qt::Widgets -) diff --git a/tests/manual/qcursor/childwidget/childwidget.pro b/tests/manual/qcursor/childwidget/childwidget.pro deleted file mode 100644 index 9492ec22803..00000000000 --- a/tests/manual/qcursor/childwidget/childwidget.pro +++ /dev/null @@ -1,6 +0,0 @@ -TEMPLATE = app -TARGET = tst_manual_childwidget -INCLUDEPATH += . -QT += widgets - -SOURCES += main.cpp diff --git a/tests/manual/qcursor/childwidget/main.cpp b/tests/manual/qcursor/childwidget/main.cpp deleted file mode 100644 index fd2a010a018..00000000000 --- a/tests/manual/qcursor/childwidget/main.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only - -#include - -class CursorWidget : public QWidget -{ -public: - CursorWidget(QCursor cursor, QColor color) - :m_cursor(cursor) - ,m_color(color) - { - if (cursor.shape() == Qt::ArrowCursor) - unsetCursor(); - else - setCursor(cursor); - } - - void paintEvent(QPaintEvent *e) - { - QPainter p(this); - p.fillRect(e->rect(), m_color); - } - - void mousePressEvent(QMouseEvent *) - { - // Toggle cursor - QCursor newCursor = (cursor().shape() == m_cursor.shape()) ? QCursor() : m_cursor; - if (newCursor.shape() == Qt::ArrowCursor) - unsetCursor(); - else - setCursor(newCursor); - } - -private: - QCursor m_cursor; - QColor m_color; -}; - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - - // Test child widgets (one of which is native) with set cursors. - // Click window to toggle cursor. - - CursorWidget w1((QCursor(Qt::SizeVerCursor)), QColor(Qt::blue).darker()); - w1.resize(200, 200); - w1.show(); - - CursorWidget w2((QCursor(Qt::OpenHandCursor)), QColor(Qt::red).darker()); - w2.setParent(&w1); - w2.setGeometry(0, 0, 100, 100); - w2.show(); - - CursorWidget w3((QCursor(Qt::IBeamCursor)), QColor(Qt::green).darker()); - w3.winId(); - w3.setParent(&w1); - w3.setGeometry(100, 100, 100, 100); - w3.show(); - - return app.exec(); -} diff --git a/tests/manual/qcursor/qcursor.pro b/tests/manual/qcursor/qcursor.pro index c6617b8e890..3cbd83c4138 100644 --- a/tests/manual/qcursor/qcursor.pro +++ b/tests/manual/qcursor/qcursor.pro @@ -1,3 +1,3 @@ TEMPLATE = subdirs -SUBDIRS = allcursors childwidget childwindow childwindowcontainer grab_override qcursorhighdpi +SUBDIRS = allcursors childwindow childwindowcontainer grab_override qcursorhighdpi