VR-Forces 4.10 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 };
QString myDefaultValue
Definition: integerListEntryWidget.h:106
QPushButton * myRemove
Definition: integerListEntryWidget.h:102
A unicode string.
Definition: DtUnicode.h:33
QHBoxLayout * myButtonLayout
Definition: integerListEntryWidget.h:103
DtIntegerListEntryWidgetTaskMenu(makVrv::DtDe &, DtIntegerListEntryWidget *widget, QObject *parent)
virtual void setLabel(const QString &)
Display label.
CreationFlags
Definition: taskSetVariableWidget.h:118
Definition: integerListEntryWidget.h:126
QListWidget * myNumbers
Definition: integerListEntryWidget.h:100
virtual void onAdd()
Adds a new integer (current row count)
DtIntegerListEntryWidget(makVrv::DtDe &de, QWidget *parent, const Qt::WindowFlags &flags=0, const CreationFlags &cflags=NormalMode)
When being used for Qt designer cflags will be QtDesignerMode.
Definition: taskSetVariableWidget.h:120
Definition: readerWriter.h:85
DtIntegerListEntryWidgetMenuFactory(makVrv::DtDe &, QExtensionManager *parent=0)
virtual QAction * preferredEditAction() const
QPushButton * myAdd
Definition: integerListEntryWidget.h:101
Qt designer extensions.
Definition: integerListEntryWidget.h:112
QObject * createExtension(QObject *object, const QString &iid, QObject *parent) const
static std::string designerGroup()
These static members are for use in Qt designer when this plugin is loaded for usage in that applicat...
Definition: integerListEntryWidget.h:63
Basic implementation that has a label at the top.
Definition: taskSetVariableWidget.h:228
makVrv::DtDe & myDe
Definition: integerListEntryWidget.h:123
Widget that allows for the selection of a color vvalue.
Definition: integerListEntryWidget.h:26
virtual void setRange(double bottom, double top)
Validation range. Not applicable.
static DtUnicode tr(const char *ascii)
Ascii translation function, used to be compatible with Qt&#39;s translation tools.
Definition: DtUnicode.h:92
virtual void setVariableData(const std::string &)
Variable data. Not used for this class.
Definition: taskSetVariableWidget.h:419
virtual DtReaderWriter * createBoundVariable(const std::string &variableName)
Creates the reader/writer variable that will be used as part of the task statement.
virtual ~DtIntegerListEntryWidget()
virtual void setupFromBoundVariable(const DtReaderWriter *variableName)
Sets up the widget from the given reader/writer variables.
virtual void editState()
virtual void updateDefaultValue()
static makVrv::DtUnicode codeVariableType()
Definition: integerListEntryWidget.h:56
QLabel * myLabel
Definition: integerListEntryWidget.h:99
QAction * myEditStateAction
Definition: integerListEntryWidget.h:141
virtual QString defaultValue() const
static std::string variableName()
Definition: integerListEntryWidget.h:73
static void initializeForQtDesignerExtension(makVrv::DtDe &, QDesignerFormEditorInterface *)
Definition: translator.h:58
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
virtual void setDefaultValue(const std::string &)
Comma list of potential values. Used to seed dialog.
virtual QList< QAction * > taskActions() const
virtual void onItemSelectionChanged()
Item selection changed – enable remove button.
static std::string headerFile()
Definition: integerListEntryWidget.h:68
DtIntegerListEntryWidget * myWidget
Definition: integerListEntryWidget.h:142
makVrv::DtDe & myDe
Definition: integerListEntryWidget.h:143
makVrf::DtTaskSetVariableWidgetCreator< DtIntegerListEntryWidget > DtIntegerListEntryWidgetCreator
Definition: integerListEntryWidget.h:109
virtual void onRemove()
Removes the selected item.

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)