wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
DragDropPayload.cpp
Go to the documentation of this file.
1// Copyright 2015 - 2026, GIBIS-UNIFESP and the wiRedPanda contributors
2// SPDX-License-Identifier: GPL-3.0-or-later
3
5
6#include <QDataStream>
7
9
11{
12 DragDropPayload payload;
13 stream >> payload.offset;
14 stream >> payload.type;
16 if (!stream.atEnd()) { stream >> payload.isEmbedded; }
17 if (!stream.atEnd()) { payload.blobName = Serialization::readBoundedString(stream); }
18 return payload;
19}
DragDropPayload readDragDropPayload(QDataStream &stream)
Reads a drag-and-drop payload from stream.
Shared reader for wiRedPanda's drag-and-drop MIME payload format.
Circuit and waveform file serialization/deserialization utilities.
static QString readBoundedString(QDataStream &stream)
Reads a QString from stream, refusing to allocate more bytes than remain in the stream (prevents OOM ...
Decoded contents of a wiRedPanda drag-and-drop MIME payload.
QString blobName
Embedded IC blob name (empty if file-based).
bool isEmbedded
True if this references an embedded IC blob.
QString icFileName
File-based IC path (empty if embedded).
QPoint offset
Drag-start offset from the dragged item's origin.
ElementType type
Element type being dragged.