mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-19 02:10:28 +08:00
fix: some upgrades to the QNodeEditor
This commit is contained in:
parent
e7b7592dd5
commit
d92979bafc
2
3rdparty/QNodeEditor
vendored
2
3rdparty/QNodeEditor
vendored
@ -1 +1 @@
|
||||
Subproject commit c93f1c1826d46d5d60f118688cd830b39af8b9c6
|
||||
Subproject commit 63af7f3d0db5b52b10c270912b49fd8cf7f250c1
|
@ -66,4 +66,4 @@ qt5_wrap_cpp(QNODEEDITOR_SOURCES
|
||||
OPTIONS --no-notes # Don't display a note for the headers which don't produce a moc_*.cpp
|
||||
)
|
||||
|
||||
set(QNODEEDITOR_QRC_RESOURCES ${QNODEEDITOR_DIR}/resources/QNodeEditor_resources.qrc)
|
||||
set(QNODEEDITOR_QRC_RESOURCES ${QNODEEDITOR_DIR}/resources/resources.qrc)
|
||||
|
@ -1 +1 @@
|
||||
4723
|
||||
4726
|
@ -650,7 +650,8 @@ void RouteEditor::on_enableBalancerCB_stateChanged(int arg1)
|
||||
|
||||
for (auto &&[_, conn] : nodeScene->connections())
|
||||
{
|
||||
if (conn.get()->getNode(PortType::Out) == ruleNode)
|
||||
auto x = conn.get();
|
||||
if (x != nullptr && x->getNode(PortType::Out) == ruleNode)
|
||||
{
|
||||
nodeScene->deleteConnection(*conn);
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ class QvInboundNodeModel : public NodeDataModel
|
||||
return "InboundNode";
|
||||
}
|
||||
|
||||
NodeDataType dataType(PortType portType, PortIndex portIndex) const override
|
||||
std::shared_ptr<NodeDataType> dataType(PortType portType, PortIndex portIndex) const override
|
||||
{
|
||||
Q_UNUSED(portType);
|
||||
Q_UNUSED(portIndex);
|
||||
@ -62,6 +62,10 @@ class QvInboundNodeModel : public NodeDataModel
|
||||
{
|
||||
return _label;
|
||||
}
|
||||
std::unique_ptr<NodeDataModel> clone() const override
|
||||
{
|
||||
return std::make_unique<QvInboundNodeModel>(_in);
|
||||
}
|
||||
|
||||
private:
|
||||
NodeValidationState modelValidationState = NodeValidationState::Warning;
|
||||
|
@ -20,8 +20,8 @@ const int GRAPH_NODE_LABEL_FONTSIZE_INCREMENT = 3;
|
||||
|
||||
namespace Qv2ray::ui::nodemodels
|
||||
{
|
||||
const NodeDataType outboundType = { "outbound", "Outbound Object" };
|
||||
const NodeDataType inboundType = { "inbound", "Inbound Object" };
|
||||
const std::shared_ptr<NodeDataType> outboundType = std::make_shared<NodeDataType>("outbound", "Outbound Object");
|
||||
const std::shared_ptr<NodeDataType> inboundType = std::make_shared<NodeDataType>("inbound", "Inbound Object");
|
||||
/// The class can potentially incapsulate any user data
|
||||
/// need to be transferred within the Node Editor graph
|
||||
class InboundNodeData : public NodeData
|
||||
@ -32,7 +32,7 @@ namespace Qv2ray::ui::nodemodels
|
||||
{
|
||||
}
|
||||
|
||||
NodeDataType type() const override
|
||||
std::shared_ptr<NodeDataType> type() const override
|
||||
{
|
||||
return inboundType;
|
||||
}
|
||||
@ -57,7 +57,7 @@ namespace Qv2ray::ui::nodemodels
|
||||
{
|
||||
}
|
||||
|
||||
NodeDataType type() const override
|
||||
std::shared_ptr<NodeDataType> type() const override
|
||||
{
|
||||
return outboundType;
|
||||
}
|
||||
@ -81,7 +81,7 @@ namespace Qv2ray::ui::nodemodels
|
||||
{
|
||||
}
|
||||
|
||||
NodeDataType type() const override
|
||||
std::shared_ptr<NodeDataType> type() const override
|
||||
{
|
||||
return outboundType;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ class QvOutboundNodeModel : public NodeDataModel
|
||||
return "OutboundNode";
|
||||
}
|
||||
|
||||
NodeDataType dataType(PortType portType, PortIndex portIndex) const override
|
||||
std::shared_ptr<NodeDataType> dataType(PortType portType, PortIndex portIndex) const override
|
||||
{
|
||||
Q_UNUSED(portType);
|
||||
Q_UNUSED(portIndex);
|
||||
@ -70,6 +70,10 @@ class QvOutboundNodeModel : public NodeDataModel
|
||||
{
|
||||
return ConnectionPolicy::Many;
|
||||
}
|
||||
std::unique_ptr<NodeDataModel> clone() const override
|
||||
{
|
||||
return std::make_unique<QvOutboundNodeModel>(_out);
|
||||
}
|
||||
|
||||
private:
|
||||
NodeValidationState modelValidationState = NodeValidationState::Warning;
|
||||
|
@ -47,7 +47,7 @@ class QvRuleNodeDataModel : public NodeDataModel
|
||||
return "RuleNode";
|
||||
}
|
||||
|
||||
NodeDataType dataType(PortType portType, PortIndex portIndex) const override
|
||||
std::shared_ptr<NodeDataType> dataType(PortType portType, PortIndex portIndex) const override
|
||||
{
|
||||
Q_UNUSED(portIndex)
|
||||
|
||||
@ -57,10 +57,8 @@ class QvRuleNodeDataModel : public NodeDataModel
|
||||
|
||||
case PortType::Out: return outboundType;
|
||||
|
||||
case PortType::None: break;
|
||||
default: return {};
|
||||
}
|
||||
|
||||
return NodeDataType();
|
||||
}
|
||||
|
||||
std::shared_ptr<NodeData> outData(PortIndex port) override
|
||||
@ -96,6 +94,10 @@ class QvRuleNodeDataModel : public NodeDataModel
|
||||
{
|
||||
return ConnectionPolicy::One;
|
||||
}
|
||||
std::unique_ptr<NodeDataModel> clone() const override
|
||||
{
|
||||
return std::make_unique<QvRuleNodeDataModel>(_ruleTag);
|
||||
}
|
||||
|
||||
private:
|
||||
NodeValidationState modelValidationState = NodeValidationState::Warning;
|
||||
|
Loading…
Reference in New Issue
Block a user