KGuiAddons

kjobwindows.cpp
1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 2013 David Faure <faure@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7
8#include "kjobwindows.h"
9#include <QObject>
10#include <QPointer>
11#include <QVariant>
12#include <QWindow>
13
15{
16 job->setProperty("window", QVariant::fromValue(QPointer<QWindow>(window)));
17 if (window) {
18 job->setProperty("window-id", QVariant::fromValue(window->winId()));
19 }
20}
21
23{
24 return job->property("window").value<QPointer<QWindow>>();
25}
KGUIADDONS_EXPORT void setWindow(QObject *job, QWindow *window)
Associate this job with a window given by window.
KGUIADDONS_EXPORT QWindow * window(QObject *job)
Return the window associated with this job.
QVariant property(const char *name) const const
bool setProperty(const char *name, QVariant &&value)
QVariant fromValue(T &&value)
T value() const const
WId winId() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:23 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.