15 QObject::connect(scene, &QtNodes::FlowScene::nodeCreated, cb);
20 QObject::connect(scene, &QtNodes::FlowScene::nodeDeleted, cb);
25 QObject::connect(scene, &QtNodes::FlowScene::nodeDoubleClicked, cb);
30 QObject::connect(scene, &QtNodes::FlowScene::nodeContextMenu, cb);
40 auto& component = getComponent(node);
41 auto conf = component.getQConfig();
42 conf->setProperty(
"name", node.nodeDataModel()->caption());
45 if (e.exec() == QDialog::Accepted) {
46 auto& iface = getComponentModel(node);
48 auto nodeCaption = conf->property(
"name");
49 if (nodeCaption.isValid()) {
50 iface.setCaption(nodeCaption.toString());
51 node.nodeGraphicsObject().update();
54 component.setConfig(*conf);
55 component.configChanged();
64 pos1.setX(pos1.x() + 32);
65 pos1.setY(pos1.y() + 10);
74 auto& iface = getComponentModel(node);
75 auto& component = iface.getComponent();
81 auto dataModel = node.nodeDataModel();
82 assert(
nullptr != dataModel);
virtual void setNodeCreatedCallback(QtNodes::FlowScene *scene, const node_t &cb) override
Definition pcimpl.h:13
virtual void setNodeDeletedCallback(QtNodes::FlowScene *scene, const node_t &cb) override
Definition pcimpl.h:18
virtual void setNodeDoubleClickedCallback(QtNodes::FlowScene *scene, const node_t &cb) override
Definition pcimpl.h:23
virtual void setConfigChangedCbk(const node_t cb) override
Definition pcimpl.h:33
virtual void openProperties(QtNodes::Node &node) override
Definition pcimpl.h:38
virtual void showContextMenu(QMenu &menu, const QPoint &pos) override
Definition pcimpl.h:61
virtual void setNodeContextMenuCallback(QtNodes::FlowScene *scene, const menu_t &cb) override
Definition pcimpl.h:28
Definition propertyeditordialog.h:18
std::shared_ptr< QWidget > properties()
Definition propertyeditordialog.cpp:25
Interface to be implemented by every component.
Definition componentinterface.h:15
Definition componentmodel.h:15
Definition pcinterface.h:16
std::function< void(QtNodes::Node &)> node_t
Definition pcinterface.h:21
std::function< void(QtNodes::Node &, const QPointF &)> menu_t
Definition pcinterface.h:22