wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
GraphicElementSerializer Class Reference

Serializes a GraphicElement to/from a versioned QDataStream. More...

#include <GraphicElementSerializer.h>

Static Public Member Functions

static void load (GraphicElement &element, QDataStream &stream, SerializationContext &context)
 Reads element from stream, dispatching on the format version in context.
static void save (const GraphicElement &element, QDataStream &stream, SerializationOptions options)
 Writes element to stream (current keyed-QMap format).

Detailed Description

Serializes a GraphicElement to/from a versioned QDataStream.

Extracted from GraphicElement so persistence is a collaborator rather than a cluster of methods on the element itself. A friend of GraphicElement, it reaches the element's ports/orientation/appearance/context-directory state through that friendship. The element keeps thin virtual save()/load() entry points that delegate here, so subclasses (e.g. IC) can still extend the load via their override. All methods are static and take the element explicitly; no serializer instance state is needed.

Definition at line 37 of file GraphicElementSerializer.h.

Member Function Documentation

◆ load()

void GraphicElementSerializer::load ( GraphicElement & element,
QDataStream & stream,
SerializationContext & context )
static

Reads element from stream, dispatching on the format version in context.

Definition at line 212 of file GraphicElementSerializer.cpp.

References ElementOrientation::applyLoadedOrientation(), VersionInfo::hasQMapFormat(), qCDebug, GraphicElement::updatePortsProperties(), and SerializationContext::version.

Referenced by GraphicElement::load().

◆ save()


The documentation for this class was generated from the following files: