I use Qt 4.8.7. I have enum Color {red, green, blue} and QSet<Color>. How should I (de)serialize QSet<Color> using QDataStream? Deserialization fails with custom type. Should I manually create serialization (loop over QSet elements) besides deserialization? I mean that internal serialization implementation for QSet in theory can be changed by Qt developers, so I have to write two loops for serialization/deserialization by myself.
(De)serialization QSet with enum using QDataStream
371 Views Asked by ilya At
1
There are 1 best solutions below
Related Questions in QT
- qt c++ fonction converting adress to coordinates (longitude, latitude)
- Qml table and chart using python
- Qt: running callback in the main thread from the worker thread
- i have installed qt version 6.0.3 and this error QMYSQL driver not loaded displaying again and again
- Frameless Qt + WinAPI maximized window size is bigger than the availableGeometry()
- new window with c++ qt
- How to get scaling from transformation matrix
- How to build just Qt core libraries from Qt sources
- doxyqml not documenting qml files properly
- Incorrect assignment from a QStringList to a char * array
- How to make QT Chart size larger than widget size?
- Queued async operations with QtConcurrent interfere QImage from freed
- Questions about qt5 dynamic link library
- how to document QML files inside C++ project?
- How do I keep my screen contents centered and also have a scrollbar in QT?
Related Questions in ENUMS
- How to solve unchecked cast
- Approaches to persist enum in java
- how to convert varchar variable to enum without first declaring the enum type?
- Why does Enum require to implement toEnum and fromEnum, if that's not enough for types larger than Int?
- Put enum in tuple and return tuple from C++ function
- Retrieving text value from ENUM by using int number that doesn't exist in said ENUM returns that int number in C#?
- match a partially moved enum Rust
- Separate big Enum list in different file in C#
- for loop is not printing all defined enum
- SwiftUI @Observable class ViewModel gets initialized twice when setting an enum variable, but not class ViewModel: ObservableObject
- Generate Custom Enum using NSWag cli
- Few enums have constants values in common, causing OpenAPI Generator to fail. How to put some of the model classes, types in different packages?
- Get int value from Enum in Visual Scripting (Unity)
- Blazor custom dropdown with HTML select and sorting by text, not value for enums
- How to use php8 enum types in Laravel where conditions?
Related Questions in QDATASTREAM
- How to read QVector with QDataStream using PyQt5
- Where can i find how CArchive serialized MFC C++
- Reading CString from the CArchive datastream into QString (QDataSteam)
- Default byte order of QDataStream
- QTCP/IP Reception Issue
- Parse stream in x length chunks based on uint32 id
- QBtyeArray QDataStream qCompress to file adding extra leading bytes
- Converting littleEndian via QDataStream
- Can't define friend functions without namespace conflict
- Serialize / Deserialize QVariantMap with QDataStream between PyQt >> Qt-C++
- QDataStream readQString() How to read utf8 String
- Convert Union to QByteArray and vice-versa using QUdpSocket in Qt
- QDataStream reads and writes more bytes than QFile::length() reports to have
- QDataStream read to QVector
- Converting QImage to QByteArray using QDataStream
Related Questions in QSET
- Why does std::prev() applied to a QSet<int*> iterator give me a segfault?
- Insertion into QSet vs QHash
- For Loop Misbehavior in C++ and Qt 6.2
- QSet append custom Object
- (De)serialization QSet with enum using QDataStream
- QT container, with specified order and no repetitions
- How to use QSet as value in QMap?
- QSet: error with qHash and custom class
- How to modify elements of a QSet?
- QMap insertMulti vs QMap<int, QSet<QString> >
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can use the following cast for deserialization in order to avoid creating manual loops: