From 1c76aa077e9c9d74fa2314752948896f9da381ee Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Tue, 13 Oct 2020 21:00:21 +0200 Subject: Get rid of all usage of QApplication:desktop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use QScreen APIs instead. Change-Id: Ie99af94fe4292223dbb165b3f5c1b74e8fe0498b Reviewed-by: Tor Arne Vestbø Reviewed-by: Qt CI Bot --- tests/manual/widgets/kernel/setscreen/main.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'tests/manual/widgets/kernel') diff --git a/tests/manual/widgets/kernel/setscreen/main.cpp b/tests/manual/widgets/kernel/setscreen/main.cpp index 70ec067d3d..a8b9a6585a 100644 --- a/tests/manual/widgets/kernel/setscreen/main.cpp +++ b/tests/manual/widgets/kernel/setscreen/main.cpp @@ -68,18 +68,12 @@ public: screenButton->setEnabled(false); connect(screenButton, &QAbstractButton::clicked, this, &Controller::setScreen); - QPushButton *desktopButton = new QPushButton; - desktopButton->setText("Show on Desktop"); - desktopButton->setEnabled(false); - connect(desktopButton, &QAbstractButton::clicked, this, &Controller::setDesktop); - QPushButton *exitButton = new QPushButton; exitButton->setText("E&xit"); connect(exitButton, &QAbstractButton::clicked, QApplication::instance(), &QCoreApplication::quit); QHBoxLayout *actionLayout = new QHBoxLayout; actionLayout->addWidget(screenButton); - actionLayout->addWidget(desktopButton); actionLayout->addWidget(exitButton); QGroupBox *radioGroup = new QGroupBox; @@ -95,7 +89,6 @@ public: if (on) targetScreen = count; screenButton->setEnabled(targetScreen != -1); - desktopButton->setEnabled(targetScreen != -1); }); groupLayout->addWidget(choice); ++count; @@ -122,24 +115,8 @@ private slots: widget->updateText(); } - void setDesktop() - { - QScreen *screen = QGuiApplication::screens().at(targetScreen); - QWidget *desktop = QApplication::desktop(screen); - if (!desktopChild) { - desktopChild = new ScreenWidget(desktop); - desktopChild->setAttribute(Qt::WA_DeleteOnClose); - desktopChild->setWindowTitle("Child of a Desktop"); - } else { - desktopChild->setParent(desktop); - } - desktopChild->show(); - desktopChild->updateText(); - } - private: QPointer widget = nullptr; - QPointer desktopChild = nullptr; int targetScreen = -1; }; -- cgit v1.2.3