OptionalPropertyManager.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package
19  * @author
20  * @date
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 #pragma once
25 
27 #include <QIcon>
28 
30 {
31  Q_OBJECT
32 public:
33  OptionalVariantManager(QObject* parent = 0);
34 
35  QVariant value(const QtProperty* property) const override;
36  int valueType(int propertyType) const override;
37  bool isPropertyTypeSupported(int propertyType) const override;
38 
39  QStringList attributes(int propertyType) const override;
40  int attributeType(int propertyType, const QString& attribute) const override;
41  QVariant attributeValue(const QtProperty* property, const QString& attribute) const override;
42 
43 
44  static int optionalProprtyTypeId();
45 public slots:
46  void setValue(QtProperty* property, const QVariant& val) override;
47  void setAttribute(QtProperty* property,
48  const QString& attribute, const QVariant& value) override;
49 protected:
50  QString valueText(const QtProperty* property) const override;
51  QIcon valueIcon(const QtProperty* property) const override;
52 
53  void initializeProperty(QtProperty* property) override;
54  void uninitializeProperty(QtProperty* property) override;
55 private:
56  struct Data
57  {
58  Data() {}
59  QVariant variant;
60  };
61  QMap<const QtProperty*, QMap<QString, Data> > dataMap;
62 
63  QIcon checkedIcon;
64  QIcon uncheckedIcon;
65 };
66 
67 
68 
OptionalVariantManager::setAttribute
void setAttribute(QtProperty *property, const QString &attribute, const QVariant &value) override
Definition: OptionalPropertyManager.cpp:185
OptionalVariantManager::OptionalVariantManager
OptionalVariantManager(QObject *parent=0)
Definition: OptionalPropertyManager.cpp:66
OptionalVariantManager::isPropertyTypeSupported
bool isPropertyTypeSupported(int propertyType) const override
Definition: OptionalPropertyManager.cpp:77
OptionalVariantManager::value
QVariant value(const QtProperty *property) const override
Definition: OptionalPropertyManager.cpp:95
OptionalVariantManager::valueIcon
QIcon valueIcon(const QtProperty *property) const override
Definition: OptionalPropertyManager.cpp:146
QtVariantPropertyManager
The QtVariantPropertyManager class provides and manages QVariant based properties.
Definition: qtvariantproperty.h:75
QtProperty
The QtProperty class encapsulates an instance of a property.
Definition: qtpropertybrowser.h:71
OptionalVariantManager::attributeType
int attributeType(int propertyType, const QString &attribute) const override
Definition: OptionalPropertyManager.cpp:115
OptionalVariantManager
Definition: OptionalPropertyManager.h:29
OptionalVariantManager::valueText
QString valueText(const QtProperty *property) const override
Definition: OptionalPropertyManager.cpp:137
qtvariantproperty.h
OptionalVariantManager::initializeProperty
void initializeProperty(QtProperty *property) override
Definition: OptionalPropertyManager.cpp:220
OptionalVariantManager::valueType
int valueType(int propertyType) const override
Definition: OptionalPropertyManager.cpp:86
OptionalVariantManager::attributeValue
QVariant attributeValue(const QtProperty *property, const QString &attribute) const override
Definition: OptionalPropertyManager.cpp:128
QtVariantPropertyManager::propertyType
int propertyType(const QtProperty *property) const
Definition: qtvariantproperty.cpp:1570
OptionalVariantManager::attributes
QStringList attributes(int propertyType) const override
Definition: OptionalPropertyManager.cpp:104
OptionalVariantManager::optionalProprtyTypeId
static int optionalProprtyTypeId()
Definition: OptionalPropertyManager.cpp:72
OptionalVariantManager::setValue
void setValue(QtProperty *property, const QVariant &val) override
Definition: OptionalPropertyManager.cpp:162
OptionalVariantManager::uninitializeProperty
void uninitializeProperty(QtProperty *property) override
Definition: OptionalPropertyManager.cpp:229