-
-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathpropertyedit.cpp
More file actions
50 lines (38 loc) · 1.18 KB
/
propertyedit.cpp
File metadata and controls
50 lines (38 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "editor/propertyedit.h"
std::list<PropertyEdit::UserTypeCallback> PropertyEdit::m_userCallbacks;
PropertyEdit::PropertyEdit(QWidget *parent) :
QWidget(parent),
m_object(nullptr) {
}
PropertyEdit::~PropertyEdit() {
}
Variant PropertyEdit::data() const {
return Variant();
}
void PropertyEdit::setData(const Variant &data) {
A_UNUSED(data);
}
void PropertyEdit::setEditorHint(const TString &hint) {
A_UNUSED(hint);
}
void PropertyEdit::setObject(Object *object, const TString &property) {
A_UNUSED(property);
m_object = object;
}
void PropertyEdit::registerEditorFactory(UserTypeCallback callback) {
m_userCallbacks.push_back(callback);
}
void PropertyEdit::unregisterEditorFactory(UserTypeCallback callback) {
m_userCallbacks.remove(callback);
}
PropertyEdit *PropertyEdit::constructEditor(int userType, QWidget *parent, const TString &editor) {
PropertyEdit *result = nullptr;
if(!m_userCallbacks.empty()) {
auto iter = m_userCallbacks.begin();
while(result == nullptr && iter != m_userCallbacks.end() ) {
result = (*iter)(userType, parent, editor);
++iter;
}
}
return result;
}