Debian Codegraph @

kysdk-waylandhelper/test/testxdgactivation/main.cpp

raw symbols SCIP
1 /*
2 *
3 * Copyright (C) 2024, KylinSoft Co., Ltd.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 3 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this library. If not, see <https://www.gnu.org/licenses/>.
17 *
18 * Authors: Zhen Sun <[email protected]>
19 *
20 */
21
22 #include "ukuistylehelper/ukuistylehelper.h"
23 #include "widget.h"
24 #include "windowmanager/windowmanager.h"
25 #include <QApplication>
26 #include <QDebug>
27 #include <QPushButton>
28 #include <QVBoxLayout>
29
30 int main(int argc, char *argv[])
31 {
32 QApplication a(argc, argv);
33 QWidget window1(nullptr, Qt::Window);
34 window1.setWindowTitle("Window 1");
35 window1.setLayout(new QVBoxLayout);
36 QPushButton p("Raise the Window 2");
37 window1.layout()->addWidget(&p);
38 window1.show();
39
40 QWidget window2(nullptr, Qt::Window);
41 window2.setWindowTitle("Window 2");
42 window2.show();
43 QObject::connect(&p, &QPushButton::clicked, &a, [&] {
44 kdk::WindowManager::activateWindow(window1.windowHandle(), window2.windowHandle());
45 });
46 return a.exec();
47 }