VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
newTacticalGraphicEntryWidget.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
15 
17 #include <matrix/vlVector.h>
18 
20 #include <QtWidgets/QWidget>
21 #include <QtWidgets/QBoxLayout>
22 #include <QtWidgets/QPushButton>
23 #include <QtWidgets/QLabel>
24 #include <QtWidgets/QLineEdit>
25 
26 #include <QtDesigner/QExtensionFactory>
27 #include <QtDesigner/QDesignerTaskMenuExtension>
28 
29 namespace makVrf
30 {
31  class DtNewTacticalGraphicEntryWidgetLogic;
32 
34  {
35  Q_OBJECT
36  Q_PROPERTY(QString entityType READ variableData WRITE setVariableData)
37 
38  public:
39 
41  {
44  DtObjectBeingDefined
45  };
46 
49  QWidget* parent, const Qt::WindowFlags& flags = 0, const CreationFlags& cflags = NormalMode);
50 
53 
56  void init();
57 
59  virtual void setObjectDefined(DtObjectDefinitionState state);
60 
62  virtual DtObjectDefinitionState objectDefined() const;
63 
66  virtual DtReaderWriter* createBoundVariable(const std::string& variableName);
67 
69  virtual void setupFromBoundVariable(const DtReaderWriter* variableName);
70 
73  virtual DtTaskSetVariableWidgetExtensionInterface* parameterContents(
74  QWidget* parent, const Qt::WindowFlags& flags = 0) const;
75 
78  bool isValid() const;
79 
81  static bool canBeUsedAsWidget()
82  {
83  return true;
84  }
85 
87  {
88  return makVrv::DtUnicode::tr("List of Location3Ds");
89  }
90 
91  static std::string designerGroup()
92  {
93  return tr("VR-Forces Object Creation").toUtf8().constData();
94  }
95 
96  static std::string headerFile()
97  {
98  return tr("<vrfGuiCoreQt/newTacticalGraphicEntryWidget.h>").toUtf8().constData();
99  }
100 
101  static std::string variableName()
102  {
103  return tr("tacticalGraphic").toUtf8().constData();
104  }
105 
107  static void initializeForQtDesignerExtension(makVrv::DtDe&, QDesignerFormEditorInterface*);
108 
111  virtual void setVariableData(const QString&);
112 
113  protected:
116  virtual DtNewTacticalGraphicEntryWidgetLogic* createLogic();
117 
119  virtual void setupGui();
120 
122  virtual void setupConnections();
123 
125  virtual void setRange(double top, double bottom);
126 
128  virtual void setDefaultValue(const std::string&);
129 
131  virtual void closeEvent(QCloseEvent* event);
132 
134  virtual void hideEvent(QHideEvent* event);
135 
136  virtual std::string variableDataFromUiDesigner(const QDomElement& element, const DtScriptedTaskVariableLayoutConverter& converter) const;
137 
138  protected slots:
139 
140  virtual void slot_onDefineButtonClicked();
141 
142  public:
143  QWidget* myWidget;
144  QHBoxLayout* myLayout;
147 
148  protected:
151  };
152 
156  {
157  Q_OBJECT
158 
159  public:
160  DtNewTacticalGraphicEntryVariableWidgetExtension(makVrv::DtDe&, QWidget* w, const Qt::WindowFlags& f = 0);
161 
163 
164  virtual int setFrom(const DtScriptedTaskVariable&, QGridLayout* parentLayout, int startRow);
165  virtual void setTo(DtScriptedTaskVariable&) const;
166 
167  virtual void setReadOnly(bool);
168 
169  protected slots:
170  virtual void onSelectEntityType();
171 
172  public:
173  QHBoxLayout* myLayout;
177  };
178 
180  {
181  public:
184 
186  {
187  }
188 
190  makVrv::DtDe& de, QWidget* parent, const Qt::WindowFlags& flags = 0, const DtTaskSetVariableWidgetInterface::CreationFlags& cflags = DtTaskSetVariableWidgetInterface::NormalMode)
191  {
193  new DtNewTacticalGraphicEntryWidget(de, parent, flags, cflags);
194  w->init();
195  return w;
196  }
197 
199  virtual bool canBeUsedAsWidget() const
200  {
202  }
203 
205  {
207  }
208 
209  virtual std::string className() const
210  {
211  return DtNewTacticalGraphicEntryWidget::staticMetaObject.className();
212  }
213 
214  virtual std::string designerGroup() const
215  {
217  }
218 
219  virtual std::string headerFile() const
220  {
222  }
223 
224  virtual bool includeInDesigner() const
225  {
226  return true;
227  }
228 
229  virtual std::string variableName() const
230  {
232  }
233 
236  virtual void initializeForQtDesignerExtension(makVrv::DtDe& de, QDesignerFormEditorInterface* core)
237  {
239  }
240  };
241 
244  {
245  Q_OBJECT
246 
247  public:
248  explicit DtNewTacticalGraphicEntryWidgetMenuFactory(makVrv::DtDe&, QExtensionManager *parent = 0);
249 
250  protected:
251  QObject *createExtension(QObject *object, const QString &iid, QObject *parent) const;
252 
253  protected:
255  };
256 
258  {
259  Q_OBJECT
260  Q_INTERFACES(QDesignerTaskMenuExtension)
261 
262  public:
264 
265  virtual QAction *preferredEditAction() const;
266  virtual QList<QAction *> taskActions() const;
267 
268  protected slots:
269  virtual void editState();
270 
271  protected:
275  };
276 }
DtObjectDefinitionState myObjectDefinitionState
Definition: newTacticalGraphicEntryWidget.h:149
DtNewTacticalGraphicEntryWidgetLogic * myLogic
Definition: newTacticalGraphicEntryWidget.h:150
virtual DtTaskSetVariableWidgetInterface * create(makVrv::DtDe &de, QWidget *parent, const Qt::WindowFlags &flags=0, const DtTaskSetVariableWidgetInterface::CreationFlags &cflags=DtTaskSetVariableWidgetInterface::NormalMode)
Definition: newTacticalGraphicEntryWidget.h:189
A unicode string.
Definition: DtUnicode.h:33
CreationFlags
Definition: taskSetVariableWidget.h:115
makVrv::DtDe & myDe
Definition: newTacticalGraphicEntryWidget.h:254
virtual makVrv::DtUnicode codeVariableType() const
Definition: newTacticalGraphicEntryWidget.h:204
virtual std::string designerGroup() const
The designer group that this is going into.
Definition: newTacticalGraphicEntryWidget.h:214
#define DT_DLL_VRFGUICOREQT
Definition: vrfGuiCoreQt.h:26
DtObjectDefinitionState
Definition: newTacticalGraphicEntryWidget.h:40
Definition: newTacticalGraphicEntryWidget.h:42
Definition: newTacticalGraphicEntryWidget.h:257
This class will parse the UI file for known scripted task variable types and pull out specified scrip...
Definition: scriptedTaskVariableLayoutConverter.h:32
Definition: taskSetVariableWidget.h:117
Definition: readerWriter.h:85
static makVrv::DtUnicode codeVariableType()
Definition: newTacticalGraphicEntryWidget.h:86
void init()
Creates the object, sets up the GUI, and sets up the signal/slot connections for this widget...
QWidget * myWidget
Definition: newTacticalGraphicEntryWidget.h:143
QPushButton * myEntityTypeEditButton
Definition: newTacticalGraphicEntryWidget.h:176
QHBoxLayout * myLayout
Definition: newTacticalGraphicEntryWidget.h:173
DtNewTacticalGraphicEntryWidgetCreator()
Definition: newTacticalGraphicEntryWidget.h:182
virtual ~DtNewTacticalGraphicEntryWidgetCreator()
Definition: newTacticalGraphicEntryWidget.h:185
QPushButton * myDefineButton
Definition: newTacticalGraphicEntryWidget.h:145
virtual bool canBeUsedAsWidget() const
Whether or not this shows up as a usable variable widget.
Definition: newTacticalGraphicEntryWidget.h:199
static std::string headerFile()
Definition: newTacticalGraphicEntryWidget.h:96
QLineEdit * myEntityType
Definition: newTacticalGraphicEntryWidget.h:175
Basic implementation that has a label at the top.
Definition: taskSetVariableWidget.h:215
virtual std::string headerFile() const
The header file to include when generating code.
Definition: newTacticalGraphicEntryWidget.h:219
static DtUnicode tr(const char *ascii)
Ascii translation function, used to be compatible with Qt&#39;s translation tools.
Definition: DtUnicode.h:92
static std::string variableName()
Definition: newTacticalGraphicEntryWidget.h:101
static bool canBeUsedAsWidget()
Whether or not this shows up as a usable variable widget.
Definition: newTacticalGraphicEntryWidget.h:81
Definition: newTacticalGraphicEntryWidget.h:43
QLabel * myLabel
Definition: newTacticalGraphicEntryWidget.h:174
Definition: newTacticalGraphicEntryWidget.h:33
This class will define the interface needed for being a task set variable that can be used in task di...
Definition: taskSetVariableWidget.h:112
static std::string designerGroup()
Definition: newTacticalGraphicEntryWidget.h:91
A class for keeping track of meta data for variables of scripted tasks.
Definition: scriptedTaskVariable.h:31
QLabel * myStatusLabel
Definition: newTacticalGraphicEntryWidget.h:146
Private to this class.
Definition: newTacticalGraphicEntryWidgetLogic.h:35
virtual std::string variableName() const
The default variable nameto initially assign to this object.
Definition: newTacticalGraphicEntryWidget.h:229
QAction * myEditStateAction
Definition: newTacticalGraphicEntryWidget.h:272
Definition: newTacticalGraphicEntryWidget.h:179
QHBoxLayout * myLayout
Definition: newTacticalGraphicEntryWidget.h:144
Qt designer extensions.
Definition: newTacticalGraphicEntryWidget.h:243
makVrv::DtDe & myDe
Definition: newTacticalGraphicEntryWidget.h:274
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
Creator class to be used when creating instances of task/set variables.
Definition: taskSetVariableWidget.h:349
Definition: translator.h:58
DtNewTacticalGraphicEntryWidget * myWidget
Definition: newTacticalGraphicEntryWidget.h:273
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
virtual bool includeInDesigner() const
Include this class in the designer plugin.
Definition: newTacticalGraphicEntryWidget.h:224
virtual std::string className() const
Definition: newTacticalGraphicEntryWidget.h:209
virtual void initializeForQtDesignerExtension(makVrv::DtDe &de, QDesignerFormEditorInterface *core)
Called when initializing widget for potential Qt Designer plugin usage.
Definition: newTacticalGraphicEntryWidget.h:236
Extension interface for contents for definition of variables in the scripted task meta data variable ...
Definition: taskSetVariableWidget.h:80
Extension widget which allows the entity type of the tactical graphic to be created.
Definition: newTacticalGraphicEntryWidget.h:155
static void initializeForQtDesignerExtension(makVrv::DtDe &, QDesignerFormEditorInterface *)
Add custom menu item to task menu to be able to edit the entity type created by this object...

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)