File indexing completed on 2024-12-08 06:39:06

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2013 David Faure <faure@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 
0008 #include "kjobwindows.h"
0009 #include <QObject>
0010 #include <QVariant>
0011 #include <QWindow>
0012 
0013 void KJobWindows::setWindow(QObject *job, QWindow *window)
0014 {
0015     job->setProperty("window", QVariant::fromValue(window));
0016     if (window) {
0017         job->setProperty("window-id", QVariant::fromValue(window->winId()));
0018     }
0019 }
0020 
0021 QWindow *KJobWindows::window(QObject *job)
0022 {
0023     return job->property("window").value<QWindow *>();
0024 }