VR-Forces Development_Version Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
appsrc
vrfOpdEditor
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
>
11
#include <
vrfGuiCoreQt/treeWidget.h
>
12
#include <vlutil/vlString.h>
13
14
class
DtPropertyItem
;
15
class
DtPropertyCreationDialog
;
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
37
class
DtPropertySheet
:
public
makVrf::DtTreeWidget
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
58
virtual
DtPropertyItem
*
itemWithReaderWriterVariable
(
DtReaderWriter
*);
59
virtual
DtPropertyItem
*
lastChild
();
60
61
virtual
QString
selectedPath
()
const
;
62
63
DtPropertyItem
*
selectedItem
()
const
;
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:
80
void
propertyItemUpdated
(
DtPropertyItem
*);
81
void
propertyItemRestored
(
DtPropertyItem
*);
82
void
propertyItemAdded
(
DtPropertyItem
*,
DtPropertyItem
*);
83
void
propertyValueRemoved
(
DtPropertyItem
*);
84
void
propertyValueRemovedFrom
(
DtPropertyItem
*,
DtPropertyItem
*);
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
98
bool
mySupportsVariables
;
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
122
inline
void
DtPropertySheet::setSupportsVariables
(
bool
b)
123
{
124
mySupportsVariables
= b;
125
}
126
127
inline
bool
DtPropertySheet::supportsVariables
()
const
128
{
129
return
mySupportsVariables
;
130
}
Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (
www.mak.com
)