|
wiRedPanda
Logic Circuit Simulator
|
The beWavedDolphin clipboard layer: cell ↔ stream mapping plus the system clipboard transport (MIME wrapping and the versioned data header). More...
Functions | |
| void | copy (const SignalModel &model, const QItemSelection &ranges, QDataStream &stream) |
| void | copyToClipboard (const SignalModel &model, const QItemSelection &ranges) |
| int | firstColumn (const SignalModel &model, const QItemSelection &ranges) |
| Returns the leftmost column index in ranges (clamped to the model's columns). | |
| int | firstRow (const SignalModel &model, const QItemSelection &ranges) |
| Returns the topmost row index in ranges (clamped to the model's rows). | |
| void | paste (SignalModel &model, const QItemSelection &ranges, QDataStream &stream) |
| bool | pasteFromClipboard (SignalModel &model, const QItemSelection &ranges) |
The beWavedDolphin clipboard layer: cell ↔ stream mapping plus the system clipboard transport (MIME wrapping and the versioned data header).
copy()/paste() are the pure data mapping between a SignalModel and a QDataStream (no simulation — the controller's slots own that). copyToClipboard()/ pasteFromClipboard() add the transport: the application MIME type, the legacy MIME type accepted on paste, and the versioned Serialization header. Cell values are stored relative to the selection's top-left so they can be re-anchored on paste.
| void DolphinClipboard::copy | ( | const SignalModel & | model, |
| const QItemSelection & | ranges, | ||
| QDataStream & | stream ) |
Serializes the values of the cells in ranges to stream (offsets relative to the selection's top-left).
Definition at line 48 of file DolphinClipboard.cpp.
References firstColumn(), firstRow(), and SignalModel::value().
Referenced by copyToClipboard().
| void DolphinClipboard::copyToClipboard | ( | const SignalModel & | model, |
| const QItemSelection & | ranges ) |
Serializes the cells in ranges (with the versioned header) and places them on the system clipboard under the beWavedDolphin MIME type. ranges must be non-empty.
Definition at line 102 of file DolphinClipboard.cpp.
References copy(), and Serialization::writeDolphinHeader().
| int DolphinClipboard::firstColumn | ( | const SignalModel & | model, |
| const QItemSelection & | ranges ) |
Returns the leftmost column index in ranges (clamped to the model's columns).
Definition at line 38 of file DolphinClipboard.cpp.
| int DolphinClipboard::firstRow | ( | const SignalModel & | model, |
| const QItemSelection & | ranges ) |
Returns the topmost row index in ranges (clamped to the model's rows).
Definition at line 43 of file DolphinClipboard.cpp.
| void DolphinClipboard::paste | ( | SignalModel & | model, |
| const QItemSelection & | ranges, | ||
| QDataStream & | stream ) |
Deserializes cells from stream into model, anchored at the top-left of ranges. Cells landing outside the input rows or past the last column are silently dropped.
Definition at line 66 of file DolphinClipboard.cpp.
References firstColumn(), firstRow(), SignalModel::inputRows(), and SignalModel::setValue().
Referenced by pasteFromClipboard().
| bool DolphinClipboard::pasteFromClipboard | ( | SignalModel & | model, |
| const QItemSelection & | ranges ) |
Reads beWavedDolphin waveform data from the system clipboard (current or legacy MIME type) and pastes it into model anchored at the top-left of ranges. Returns true iff the clipboard held waveform data that was applied.
Definition at line 115 of file DolphinClipboard.cpp.
References paste(), and Serialization::readDolphinHeader().