VariantWidget.h
Go to the documentation of this file.
1/*
2* This file is part of ArmarX.
3*
4* ArmarX is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License version 2 as
6* published by the Free Software Foundation.
7*
8* ArmarX is distributed in the hope that it will be useful, but
9* WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details.
12*
13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15*
16* @package ArmarX::Gui
17* @author Kai Welke (welke@kit.edu)
18* @copyright 2012 Humanoids Group, IAIM, IFA
19* @license http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
23#pragma once
24
25// Qt
26#include <map>
27#include <string>
28
29#include <QWidget>
30
31// ArmarX
34
35class QVBoxLayout;
36class QTextEdit;
37
38namespace armarx
39{
40 class VariantWidget : public QWidget
41 {
42 Q_OBJECT
43 public:
44 VariantWidget(VariantPtr variant, QWidget* parent = 0, Qt::WindowFlags f = 0);
45 void setEnableEdit(bool enableEdit);
46 void setShowType(bool showType);
47
49 bool getEnableEdit();
50 bool getShowType();
51 QString getValueText();
52 public slots:
54 void setValue(const VariantPtr& variant);
55
56 private:
57 void setupLayout();
58
59 VariantPtr variant;
60 bool enableEdit;
61 bool showType;
62 QTextEdit* variantEdit;
63 std::vector<QWidget*> widgets;
64 QVBoxLayout* layout;
65 };
66} // namespace armarx
VariantWidget(VariantPtr variant, QWidget *parent=0, Qt::WindowFlags f=0)
Variant & getVariant()
void setEnableEdit(bool enableEdit)
void setShowType(bool showType)
void setValue(const VariantPtr &variant)
The Variant class is described here: Variants.
Definition Variant.h:224
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< Variant > VariantPtr
Definition Variant.h:41