ProfileDefaultValueEditWidget.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::
17 * @author Valerij Wittenbeck (valerij.wittenbeck at student dot kit dot edu
18 * @date 2015
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 
24 #pragma once
25 
26 
29 
30 #include <Ice/ObjectFactory.h>
31 #include <QWidget>
32 
33 #include <optional>
34 
35 namespace armarx::Ui
36 {
37  class ProfileDefaultValueEditWidget;
38 }
39 
40 namespace armarx
41 {
42  class ProfileDefaultValueEditWidget : public QWidget
43  {
44  Q_OBJECT
45 
46  private:
47  enum Widget
48  {
49  eLineEdit = 0,
50  eEditButton = 1,
51  eSetButton = 2
52  };
53 
54  public:
55  explicit ProfileDefaultValueEditWidget(QString typeString, QString jsonValue, Ice::CommunicatorPtr communicator, QWidget* parent = 0);
57  // void setType(const QString& typeString);
58  QString getType();
59  void setEditable(bool editable);
60  std::optional<QString> getValueAsString();
61  std::optional<QString> getValueAsJson();
62  VariantContainerBasePtr getVariantContainer();
63 
64  private slots:
65  void resetValue();
66  void setButtonClicked();
67  void editDefaultButtonClicked();
68  private:
69  void initEditButton();
70 
71  Ui::ProfileDefaultValueEditWidget* ui;
72 
73  QString typeString;
74  QString jsonValue;
75  Ice::CommunicatorPtr communicator;
76 
77  bool editable;
78  };
79 
80 
81 }
armarx::Ui
Definition: GuiUseCaseSelector.h:33
armarx::ProfileDefaultValueEditWidget::getVariantContainer
VariantContainerBasePtr getVariantContainer()
Definition: ProfileDefaultValueEditWidget.cpp:169
armarx::ProfileDefaultValueEditWidget
Definition: ProfileDefaultValueEditWidget.h:42
armarx::ProfileDefaultValueEditWidget::getValueAsString
std::optional< QString > getValueAsString()
Definition: ProfileDefaultValueEditWidget.cpp:136
VariantContainer.h
armarx::ProfileDefaultValueEditWidget::~ProfileDefaultValueEditWidget
~ProfileDefaultValueEditWidget() override
Definition: ProfileDefaultValueEditWidget.cpp:120
armarx::ProfileDefaultValueEditWidget::setEditable
void setEditable(bool editable)
Definition: ProfileDefaultValueEditWidget.cpp:130
IceInternal::Handle< ::Ice::Communicator >
armarx::ProfileDefaultValueEditWidget::getValueAsJson
std::optional< QString > getValueAsJson()
Definition: ProfileDefaultValueEditWidget.cpp:150
armarx::ProfileDefaultValueEditWidget::getType
QString getType()
Definition: ProfileDefaultValueEditWidget.cpp:125
armarx::ProfileDefaultValueEditWidget::ProfileDefaultValueEditWidget
ProfileDefaultValueEditWidget(QString typeString, QString jsonValue, Ice::CommunicatorPtr communicator, QWidget *parent=0)
Definition: ProfileDefaultValueEditWidget.cpp:44
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
VariantInfo.h