KWin
Loading...
Searching...
No Matches
xdgactivationtest-qt6.cpp
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2022 Aleix Pol Gonzalez <aleixpol@kde.org>
3 SPDX-FileCopyrightText: 2022 Ilya Fedin <fedin-ilja2010@ya.ru>
4
5 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
6*/
7
8#include <QtWidgets>
9
10int main(int argc, char *argv[])
11{
12 QApplication app(argc, argv);
13 QWidget window1(nullptr, Qt::Window);
14 window1.setWindowTitle("Window 1");
15 window1.setLayout(new QVBoxLayout);
16 QPushButton p("Raise the Window 2");
17 window1.layout()->addWidget(&p);
18 window1.show();
19
20 QWidget window2(nullptr, Qt::Window);
21 window2.setWindowTitle("Window 2");
22 window2.show();
23
24 QObject::connect(&p, &QPushButton::clicked, window2.windowHandle(), &QWindow::requestActivate);
25
26 return app.exec();
27}