2015-09-08 21:52:34 +00:00
|
|
|
#ifndef INTPROPERTYBIND_H
|
|
|
|
#define INTPROPERTYBIND_H
|
|
|
|
|
|
|
|
#include "modeler_global.h"
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include "DefinitionWatcher.h"
|
|
|
|
|
|
|
|
namespace paysages {
|
|
|
|
namespace modeler {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Bind an int Qml property to an IntNode.
|
|
|
|
*
|
|
|
|
* The IntNode must exist through this object lifetime.
|
|
|
|
*/
|
2015-11-09 21:30:46 +00:00
|
|
|
class IntPropertyBind : public QObject, public DefinitionWatcher {
|
2015-09-08 21:52:34 +00:00
|
|
|
Q_OBJECT
|
2015-11-09 21:30:46 +00:00
|
|
|
public:
|
2015-09-08 21:52:34 +00:00
|
|
|
IntPropertyBind(MainModelerWindow *window, const QString &object_name, const QString &property_name, IntNode *node);
|
|
|
|
|
|
|
|
virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff) override;
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
private slots:
|
2015-09-08 21:52:34 +00:00
|
|
|
void propertyChanged(int value);
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
private:
|
2015-09-08 21:52:34 +00:00
|
|
|
IntNode *node;
|
|
|
|
QString property;
|
|
|
|
QObject *item;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif // INTPROPERTYBIND_H
|