[MEDIUM] The static activeDocument() method introduces global state, which can complicate testing and future extensions (e.g., multi-document support). Consider using dependency injection instead of a static accessor.
[LOW] The lambda functions in the m_node_factories map are repetitive. To improve maintainability, consider creating a template helper function to generate these factories and reduce boilerplate code.
[LOW] For an empty virtual destructor, prefer = default over an empty body {} to be more expressive and align with modern C++ practices.
[HIGH] Using MEMBER with a WRITE function will cause the NOTIFY signal to be emitted twice for a single property change. Remove MEMBER m_widget from the Q_PROPERTY declaration.
[LOW] Using relative paths with .. is fragile. It's better to configure include paths in the build system and use project-relative paths (e.g., node/node.h).
[LOW] As this method is a member of a QMenu subclass, it's unclear why it takes a QMenu* argument. It should likely operate on this instead.
[LOW] The 'program' path is a placeholder. This should be updated to point to the actual build output or a configurable variable to make it usable out-of-the-box.
[LOW] Add a newline at the end of the file to adhere to POSIX standards and common convention.
[HIGH] The type compatibility check (this->typeId() != target_interface->typeId()) was removed. This could allow routing between incompatible interface types, potentially leading to runtime errors.
[MEDIUM] The static instance_counter is modified without synchronization. This is not thread-safe and can lead to race conditions if nodes are created concurrently from multiple threads. Consider using a QMutex to protect access.
[MEDIUM] Classes inheriting from QObject are non-copyable and non-movable. It's best practice to explicitly disable these operations by adding Q_DISABLE_COPY_MOVE(SerialSend) in the private section of your class.
[LOW] With the removal of setPanel, the paintWidget method appears to be orphaned. Consider removing it if it's no longer used.
[HIGH] This line adds the 'Add Node' menu a second time. The preceding addMenu("Add Node") already adds it and returns it. This line should be removed.
[MEDIUM] The 'identifier' parameter should be passed by const reference (const QString&) to avoid an unnecessary copy.