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