VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
integerListEntryWidget.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
15 
16 #include <QtDesigner/QExtensionFactory>
17 #include <QtDesigner/QDesignerTaskMenuExtension>
18 
19 class QLabel;
20 class QHBoxLayout;
21 class QPushButton;
22 class QListWidget;
23 class QListWidgetItem;
24 
27 {
28  Q_OBJECT
29  Q_PROPERTY(QString defaultValue READ defaultValue WRITE setDefaultValue DESIGNABLE false)
30 
31 public:
33  DtIntegerListEntryWidget(makVrv::DtDe& de, QWidget* parent, const Qt::WindowFlags& flags = 0, const CreationFlags& cflags = NormalMode);
34 
35  //DTOR
36  virtual ~DtIntegerListEntryWidget();
37 
39  virtual void setLabel(const QString&);
40 
42  virtual void setRange(double bottom, double top);
43 
45  virtual void setDefaultValue(const std::string&);
46 
48  virtual void setVariableData(const std::string&);
49 
51  virtual DtReaderWriter* createBoundVariable(const std::string& variableName);
52 
55 
57  {
58  return makVrv::DtUnicode::tr("Integer: integer list");
59  }
60 
62 
63  static std::string designerGroup()
64  {
65  return tr("VR-Forces Example Project").toUtf8().constData();
66  }
67 
68  static std::string headerFile()
69  {
70  return tr("<examples/addScriptVariable/addScriptVariableGui/simpleVariableWidget.h>").toUtf8().constData();
71  }
72 
73  static std::string variableName()
74  {
75  return tr("intListValueValue").toUtf8().constData();
76  }
77 
78  // This method will be called to allow for the installation of a custom widget that the user can use to
79  // assign default integers to this least. Please refer to Qt documenation for how Qt Designer extensions are
80  // used
81  static void initializeForQtDesignerExtension(makVrv::DtDe&, QDesignerFormEditorInterface*);
82 
83  virtual void setDefaultValue(const QString&);
84  virtual QString defaultValue() const;
85 
86  virtual void updateDefaultValue();
87 
88 protected slots:
90  virtual void onAdd();
91 
93  virtual void onRemove();
94 
96  virtual void onItemSelectionChanged();
97 
98 public:
100  QListWidget* myNumbers;
103  QHBoxLayout* myButtonLayout;
104 
105 protected:
106  QString myDefaultValue;
107 };
108 
110 
113 {
114  Q_OBJECT
115 
116 public:
117  explicit DtIntegerListEntryWidgetMenuFactory(makVrv::DtDe&, QExtensionManager *parent = 0);
118 
119 protected:
120  QObject *createExtension(QObject *object, const QString &iid, QObject *parent) const;
121 
122 protected:
124 };
125 
127 {
128  Q_OBJECT
129  Q_INTERFACES(QDesignerTaskMenuExtension)
130 
131 public:
133 
134  virtual QAction *preferredEditAction() const;
135  virtual QList<QAction *> taskActions() const;
136 
137  protected slots:
138  virtual void editState();
139 
140 protected:
144 };

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)