KProperty

KPropertyEditorItemEvent.cpp
1 /* This file is part of the KDE project
2  Copyright (C) 2018 Jarosław Staniek <[email protected]>
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 
22 class Q_DECL_HIDDEN KPropertyEditorItemEvent::Private
23 {
24 public:
25  Private()
26  {
27  }
28  const KProperty *property;
29  QString name;
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 
44 KPropertyEditorItemEvent::~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 }
QString name(const QVariant &location)
QVariant result() const
Returns result set by the user of the editor.
The KPropertyEditorItemEvent class describes request for handling a single property editor widget ite...
bool hasResult() const
Returns true if event&#39;s result has been set with setResult()
const KProperty * property() const
Returns property assiciated with editor which requests the override.
The base class representing a single property.
Definition: KProperty.h:95
KPropertyEditorItemEvent(const KProperty &property, const QString &name, const QVariantMap &parameters)
Creates a new request object.
void setResult(const QVariant &result)
Sets result of the event.
QVariantMap parameters() const
Returns zero or more parameters associated with this specific event.
QString name() const
Returns name of event that requests the override.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Aug 9 2020 23:10:57 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.