summaryrefslogtreecommitdiffstats
path: root/tests/manual/widgets
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-10-13 21:00:21 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-10-14 06:38:43 +0200
commit1c76aa077e9c9d74fa2314752948896f9da381ee (patch)
treeef979f532d759c9ae061c400415afd974d3edd26 /tests/manual/widgets
parent772a10391eead51e2c7c9b50473ef0f8096cef82 (diff)
Get rid of all usage of QApplication:desktop
Use QScreen APIs instead. Change-Id: Ie99af94fe4292223dbb165b3f5c1b74e8fe0498b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tests/manual/widgets')
-rw-r--r--tests/manual/widgets/kernel/setscreen/main.cpp23
1 files changed, 0 insertions, 23 deletions
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<ScreenWidget> widget = nullptr;
- QPointer<ScreenWidget> desktopChild = nullptr;
int targetScreen = -1;
};