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
26#include <QIcon>
27
29
31{
32 Q_OBJECT
33public:
34 OptionalVariantManager(QObject* parent = 0);
35
36 QVariant value(const QtProperty* property) const override;
37 int valueType(int propertyType) const override;
38 bool isPropertyTypeSupported(int propertyType) const override;
39
40 QStringList attributes(int propertyType) const override;
41 int attributeType(int propertyType, const QString& attribute) const override;
42 QVariant attributeValue(const QtProperty* property, const QString& attribute) const override;
43
44
45 static int optionalProprtyTypeId();
46public slots:
47 void setValue(QtProperty* property, const QVariant& val) override;
48 void
49 setAttribute(QtProperty* property, const QString& attribute, const QVariant& value) override;
50
51protected:
52 QString valueText(const QtProperty* property) const override;
53 QIcon valueIcon(const QtProperty* property) const override;
54
55 void initializeProperty(QtProperty* property) override;
56 void uninitializeProperty(QtProperty* property) override;
57
58private:
59 struct Data
60 {
61 Data()
62 {
63 }
64
65 QVariant variant;
66 };
67
68 QMap<const QtProperty*, QMap<QString, Data>> dataMap;
69
70 QIcon checkedIcon;
71 QIcon uncheckedIcon;
72};
void initializeProperty(QtProperty *property) override
QVariant attributeValue(const QtProperty *property, const QString &attribute) const override
void setValue(QtProperty *property, const QVariant &val) override
int attributeType(int propertyType, const QString &attribute) const override
QVariant value(const QtProperty *property) const override
OptionalVariantManager(QObject *parent=0)
int valueType(int propertyType) const override
QIcon valueIcon(const QtProperty *property) const override
QStringList attributes(int propertyType) const override
void uninitializeProperty(QtProperty *property) override
void setAttribute(QtProperty *property, const QString &attribute, const QVariant &value) override
QString valueText(const QtProperty *property) const override
bool isPropertyTypeSupported(int propertyType) const override
QtVariantPropertyManager(QObject *parent=0)
int propertyType(const QtProperty *property) const