paysages3d/src/interface/modeler/FloatPropertyBind.h
2016-07-23 22:58:32 +02:00

35 lines
768 B
C++

#pragma once
#include "modeler_global.h"
#include "DefinitionWatcher.h"
#include <QObject>
namespace paysages {
namespace modeler {
/**
* Bind a float Qml property to a FloatNode.
*
* The FloatNode must exist through this object lifetime.
*/
class FloatPropertyBind : public QObject, public DefinitionWatcher {
Q_OBJECT
public:
FloatPropertyBind(MainModelerWindow *window, const string &object_name, const string &property_name,
FloatNode *node);
virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff,
const DefinitionNode *parent) override;
private slots:
void propertyChanged();
private:
FloatNode *node;
string property;
QObject *item;
};
}
}