VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
uiResourceEditor.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2024 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
7 #pragma once
8 
11 #include <QtGui/QValidator>
12 
13 class QLabel;
14 class QVBoxLayout;
15 class QHBoxLayout;
16 class QToolButton;
17 class QComboBox;
18 class QTreeWidget;
20 class DtSimResource;
21 class QTreeWidgetItem;
22 
24 
26 {
27  Q_OBJECT
28 
29 public:
30 
33 
35  virtual ~DtUiResourceEditor() override;
36 
38  virtual void setEnabled(bool b) override;
39 
40  virtual bool resourceIsDeleted(QTreeWidgetItem*);
41 
42 protected:
43  virtual void createControls(QWidget*) override;
44  virtual void processUiEvent(const DtUiElementEvent& e) override;
45  virtual void decorateElement() override;
46  virtual void setupResources(const DtSimResourceManager*);
47  virtual void addResource(const DtSimResource&);
48  virtual DtSimResourceManager* resourceList();
49  virtual void addRevertButtonIfNeeded(QTreeWidgetItem*);
50 
51 protected slots:
52  virtual void onCurrentAmountChanged();
53  virtual void onFullAmountChanged();
54  virtual void resetResources();
55  virtual void onItemSelectionChanged();
56  virtual void onRemoveResource();
57  virtual void onAddResource();
58  virtual void revertButtonClicked();
59  virtual void binChanged();
60  virtual void revertResourceItem();
61 
62 protected:
63  virtual void setFromParameters(const std::vector<DtReaderWriter*>& parentRw) override;
64  virtual void setFromParameters(const std::vector<DtComponentSystemDefinition*>& rws) override;
65  virtual void addResourcesFromSystemDefinitions(const DtComponentSystemDefinition* def);
66  virtual QComboBox* setupBins(int bin);
67 
68 public:
69  QWidget* myWidget;
70  QVBoxLayout* myMainLayout;
71  QHBoxLayout* myTitleLayout;
77 
78 protected:
79  QIntValidator myIntValidator;
80  QDoubleValidator myDoubleValidator;
81 };
virtual void createControls(QWidget *parent)
If additional widgets or connections need to be made do it here. The parent is the myWidget member...
QIntValidator myIntValidator
Definition: uiResourceEditor.h:79
virtual void setFromParameters(DtReaderWriter *parentRw)
Calls setFromParameters with std::vector of parameter.
virtual void processUiEvent(const DtUiElementEvent &)
Process ui event. Default does nothing.
Definition: uiElement.h:236
QTreeWidget * myResources
Definition: uiResourceEditor.h:75
class DtSimResourceManager:
Definition: simResourceManager.h:19
boost::function< DtUiElement *(makVrv::DtDe &)> CreatorFunction
Definition: uiElement.h:190
QVBoxLayout * myMainLayout
Definition: uiResourceEditor.h:70
virtual void decorateElement()
Sets element decoration depending on the isModified state of the element. This version changes myLabe...
QDoubleValidator myDoubleValidator
Definition: uiResourceEditor.h:80
DtComponentSystemDefinition.
Definition: componentSystemDefinition.h:27
QWidget * myWidget
Definition: uiResourceEditor.h:69
QToolButton * myRevertToParentButton
Definition: uiResourceEditor.h:76
QToolButton * myRemoveButton
Definition: uiResourceEditor.h:74
QHBoxLayout * myTitleLayout
Definition: uiResourceEditor.h:71
virtual void setEnabled(bool)
If this item is not enabled it cannot be modified.
DtSimResource is a class which will define a SISO Enumeration to use as a resource and the quantity o...
Definition: simResource.h:32
The DtUiElement class is the base for which all UI elements are defined. If you wish to create a new ...
Definition: uiElement.h:97
QToolButton * myAddButton
Definition: uiResourceEditor.h:73
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
Element for managing entity resources.
Definition: uiResourceEditor.h:25
#define DT_DLL_simulationObjectEditorimpl
This file is used to determine how to build.
Definition: simulationObjectEditorImplDefines.h:33
Base class of the ui element class chain. Properties available through designer for all ui elements a...
Definition: uiElement.h:185
QLabel * myTitle
Definition: uiResourceEditor.h:72

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)