KProperty

KPropertyEditorItemEvent.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2018 Jarosław Staniek <staniek@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#include "KPropertyEditorItemEvent.h"
21
22class Q_DECL_HIDDEN KPropertyEditorItemEvent::Private
23{
24public:
25 Private()
26 {
27 }
28 const KProperty *property;
30 QVariantMap parameters;
31 QVariant result;
32 bool hasResult = false;
33};
34
36 const QVariantMap &parameters)
37 : d(new Private)
38{
39 d->property = &property;
40 d->name = name;
41 d->parameters = parameters;
42}
43
44KPropertyEditorItemEvent::~KPropertyEditorItemEvent()
45{
46}
47
49{
50 return d->property;
51}
52
54{
55 return d->name;
56}
57
59{
60 return d->parameters;
61}
62
64{
65 d->hasResult = true;
66 d->result = result;
67}
68
70{
71 return d->result;
72}
73
75{
76 return d->hasResult;
77}
The KPropertyEditorItemEvent class describes request for handling a single property editor widget ite...
KPropertyEditorItemEvent(const KProperty &property, const QString &name, const QVariantMap &parameters)
Creates a new request object.
QVariant result() const
Returns result set by the user of the editor.
const KProperty * property() const
Returns property assiciated with editor which requests the override.
QVariantMap parameters() const
Returns zero or more parameters associated with this specific event.
QString name() const
Returns name of event that requests the override.
void setResult(const QVariant &result)
Sets result of the event.
bool hasResult() const
Returns true if event's result has been set with setResult()
The base class representing a single property.
Definition KProperty.h:96
QString name(StandardAction id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:11:18 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.