Debian Codegraph @

tests/online-accounts-ui/mock/qwindow.cpp

raw symbols SCIP
1 /*
2 * Copyright (C) 2013 Canonical Ltd.
3 *
4 * Contact: Alberto Mardegan <[email protected]>
5 *
6 * This file is part of lomiri-online-accounts-ui
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 3, as published
10 * by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranties of
14 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #include "window-watcher.h"
22
23 #include <QDebug>
24 #include <QWindow>
25 #include <QVariant>
26
27 #define TRANSIENT_PARENT "transientParent"
28 #define WIN_ID "winId"
29
30 WindowWatcher *WindowWatcher::m_instance = 0;
31
32 QWindow::QWindow(QWindow *parent):
33 QObject(parent),
34 QSurface(QSurface::Window)
35 {
36 qDebug() << Q_FUNC_INFO;
37 }
38
39 QWindow::~QWindow()
40 {
41 }
42
43 void QWindow::show()
44 {
45 WindowWatcher::instance()->emitWindowShown(this);
46 }
47
48 void QWindow::setTransientParent(QWindow *parent)
49 {
50 setProperty(TRANSIENT_PARENT, QVariant::fromValue<QObject*>(parent));
51 }
52
53 QWindow *QWindow::fromWinId(WId winId)
54 {
55 QWindow *window = new QWindow;
56 window->setProperty(WIN_ID, winId);
57 return window;
58 }