10#include <QCoreApplication>
113 void setEditedConnection(
Connection *connection);
114 void deleteEditedConnection();
116 void setHoverPort(
Port *port);
117 void releaseHoverPort();
118 [[nodiscard]]
Port *hoverPort();
121 [[nodiscard]] static QList<
Port *> connectedPeers(
Port *port);
124 void clearHoverLabels();
126 Scene *m_scene =
nullptr;
129 int m_editedConnectionId = 0;
132 int m_hoverPortElmId = 0;
133 int m_hoverPortNumber = 0;
143 QList<QPair<
int,
int>> m_highlightedPeers;
void clearHover()
Clears the current hover state (unhighlights the port, resets cursor).
void detach(InputPort *endPort)
Detaches the existing wire on endPort and starts a new one from the same output.
bool hasEditedConnection() const
Returns true if a wire is currently being drawn.
void tryComplete(const QPointF &scenePos)
Attempts to complete the in-progress wire at the port under scenePos.
void startFromOutput(OutputPort *startPort)
Begins a new in-progress wire anchored at startPort (output port).
Connection * editedConnection() const
Returns the in-progress wire, or nullptr.
static bool isConnectionAllowed(OutputPort *startPort, InputPort *endPort)
Returns true if a wire from startPort to endPort is permitted.
void showHoverLabels(Port *port)
Shows in-situ label chips for port itself and every port connected to it.
void updateHover(const QPointF &scenePos)
Updates the hover state for the port under scenePos.
friend class TestConnectionManager
ConnectionManager(Scene *scene)
void updateEditedEnd(const QPointF &scenePos)
Updates the free end of the in-progress wire to follow scenePos.
void cancel()
Cancels and deletes the in-progress wire, if any.
static QString connectionRejectionReason(OutputPort *startPort, InputPort *endPort)
void startFromInput(InputPort *endPort)
Begins a new in-progress wire anchored at endPort (input port).
A bezier-curve wire connecting an output port to an input port in the scene.
Abstract base class for all graphical circuit elements in wiRedPanda.
A port that drives a signal (the source end of a wire).
A small floating label drawn next to a port while a connected port is hovered.
Abstract base class for circuit element ports (connection endpoints).
Main circuit editing scene.