-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPropertyBrowser.h
70 lines (56 loc) · 2.11 KB
/
PropertyBrowser.h
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// MapMaker (c) 2016 Andrey Fidrya. MIT license. See LICENSE for more information.
#ifndef PROPERTYBROWSER_H
#define PROPERTYBROWSER_H
#include "ThirdParty/qtpropertybrowser/src/QtTreePropertyBrowser"
class QtProperty;
class QtGroupPropertyManager;
class QtStringPropertyManager;
class QtIntPropertyManager;
class QtBoolPropertyManager;
class QtProperty;
class LevelObject;
class PropertyBrowser : public QtTreePropertyBrowser
{
Q_OBJECT
public:
explicit PropertyBrowser(QWidget *parent = 0);
LevelObject *levelObject() const { return levelObject_; }
signals:
void hasLevelObject(bool has);
public slots:
void setLevelObject(LevelObject *object);
void resetLevelObject();
protected slots:
void onAddProperty();
void onIntValueChanged(QtProperty *property, int val);
void onBoolValueChanged(QtProperty *property, bool val);
void onStringValueChanged(QtProperty *property, const QString &val);
void onCustomPropertyValueChanged(QtProperty *property, const QString &val);
void updateName(const QString &name);
void updatePosition(const QPointF &pos);
void updatePosition(LevelObject *levelObject, const QPointF &pos);
void updateSize(const QSizeF &size);
void updateFlipX(bool flipX);
void updateFlipY(bool flipY);
void onCustomPropertyChanged(const QString &key, const QString &value);
protected:
void connectToPropertiesOf(LevelObject *object);
void disconnectFromPropertiesOf(LevelObject *object);
protected:
QtGroupPropertyManager *groupManager_ = nullptr;
QtIntPropertyManager *intManager_ = nullptr;
QtBoolPropertyManager *boolManager_ = nullptr;
QtStringPropertyManager *stringManager_ = nullptr;
QtStringPropertyManager *customPropertyManager_ = nullptr;
QtProperty *standardGroup_ = nullptr;
QtProperty *name_ = nullptr;
QtProperty *x_ = nullptr;
QtProperty *y_ = nullptr;
QtProperty *width_ = nullptr;
QtProperty *height_ = nullptr;
QtProperty *flipX_ = nullptr;
QtProperty *flipY_ = nullptr;
QtProperty *customGroup_ = nullptr;
LevelObject *levelObject_ = nullptr;
};
#endif // PROPERTYBROWSER_H