VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
propertySheet.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 // Note that some code has been lifted from the propertySheet.cpp file of
7 // the Qt Designer application
8 #pragma once
9 
10 #include <vrvUtil/signalslib.h>
12 #include <vlutil/vlString.h>
13 
14 class DtPropertyItem;
16 class DtReaderWriter;
17 
18 // The typeid function returns the name of the class in slightly different
19 // formats depending on the compiler. This function will take typeid input
20 // and return the name of the class for windows (msvc) and linux (gcc).
21 inline DtString DtTypeId(const char* input)
22 {
23  DtString name(input);
24 #ifdef WIN32
25  name.snipFront(' ');
26 #elif __linux__
27  if (name.size() > 2)
28  {
29  const char* newPtr = &input[2];
30  name = newPtr;
31  }
32 #endif
33 
34  return name;
35 }
36 
38 {
39  Q_OBJECT
40 
41 public:
42  DtPropertySheet(makVrv::DtDe&,QWidget* parent = NULL);
43  virtual ~DtPropertySheet();
44 
45  virtual void valueUpdated(DtPropertyItem*);
46  virtual void valueAdded(DtPropertyItem* newItem, DtPropertyItem* parent, DtPropertyCreationDialog*, bool isNew = false);
47  virtual void valueRestored(DtPropertyItem*);
48  virtual void valueRemoved(DtPropertyItem*);
49  virtual void valueRemovedFrom(DtPropertyItem* item, DtPropertyItem* parent);
50 
51  virtual bool canCreateItem() const;
52  virtual bool canDeleteItem() const;
53  virtual bool canRestoreItem() const;
54  virtual void deleteEntry(QTreeWidgetItem*);
55  virtual void restoreEntry(QTreeWidgetItem*);
56  virtual void createEntry(QTreeWidgetItem*);
57 
59  virtual DtPropertyItem* lastChild();
60 
61  virtual QString selectedPath() const;
62 
64 
65  virtual void sizeColumn(int);
66 
67  void setPropertyFileName(const QString&);
68  const QString& propertyFileName() const;
69 
70  void setSourceFileName(const QString&);
71  const QString& sourceFileName() const;
72 
73  void setSupportsVariables(bool);
74  bool supportsVariables() const;
75 
76 public slots:
77  virtual void selectionChanged(const QItemSelection&, const QItemSelection&);
78 
79 signals:
85 
86 protected:
87  virtual void resizeEvent(QResizeEvent *e);
88  virtual bool eventFilter(QObject*, QEvent*);
89  virtual QString pathOfText(QTreeWidgetItem*) const;
90 
91 public slots:
92  virtual void updateEditorSize();
93  virtual void columnSizeChange(int, int, int);
94 
95 protected:
96  QString myPropertyFileName; // .opd file
97  QString mySourceFileName; // .ope file
99 };
100 
101 inline void DtPropertySheet::setPropertyFileName(const QString& s)
102 {
103  myPropertyFileName = s;
104 }
105 
106 inline const QString& DtPropertySheet::propertyFileName() const
107 {
108  return myPropertyFileName;
109 }
110 
111 
112 inline void DtPropertySheet::setSourceFileName(const QString& s)
113 {
114  mySourceFileName = s;
115 }
116 
117 inline const QString& DtPropertySheet::sourceFileName() const
118 {
119  return mySourceFileName;
120 }
121 
123 {
125 }
126 
128 {
129  return mySupportsVariables;
130 }

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)