I had to slightly change the structure:
typedef enum t_timeloopsStatus
{
NOTHING = 0,
UPDATED,
UPLOADED,
CHANGED
} t_timeloopsStatus;
typedef enum t_timeloopsTime
{
KEY = 0,
PAD
} t_timeloopsTime;
typedef struct t_keyParam
{
t_timeloopsStatus status;
t_timeloopsTime select;
} t_keyParam;
typedef struct t_timeloops
{
QMap<QString, t_keyParam> key;
} t_timeloops;
QMap<QString, t_timeloops> _timeLoops;
typedef enum t_timeloopsStatus
{
NOTHING = 0,
UPDATED,
UPLOADED,
CHANGED
} t_timeloopsStatus;
typedef enum t_timeloopsTime
{
KEY = 0,
PAD
} t_timeloopsTime;
typedef struct t_keyParam
{
QString keyTime;
QString padTime;
QString cylinderTime;
t_timeloopsStatus status;
t_timeloopsTime select;
} t_keyParam;
typedef struct t_timeloops
{
QMap<QString, t_keyParam> key;
} t_timeloops;
QMap<QString, t_timeloops> _timeLoops;
To copy to clipboard, switch view to plain text mode
Or maybe, do you have some idea how to save data? My situation is:
Pad#1 - Key#1- key (qstring)
- pad (qstring)
- selected (enum)
...
- Key#2- key (qstring)
- pad (qstring)
- selected (enum)
...
...
Pad#2 - Key#2- key (qstring)
- pad (qstring)
- selected (enum)
...
- Key#3- key (qstring)
- pad (qstring)
- selected (enum)
...
...
...
Pad#1 - Key#1- key (qstring)
- pad (qstring)
- selected (enum)
...
- Key#2- key (qstring)
- pad (qstring)
- selected (enum)
...
...
Pad#2 - Key#2- key (qstring)
- pad (qstring)
- selected (enum)
...
- Key#3- key (qstring)
- pad (qstring)
- selected (enum)
...
...
...
To copy to clipboard, switch view to plain text mode
And back to the main probolem. Probably it's not good solution at all, but:
{
out << static_cast<quint8>(keyParam.select) << static_cast<quint8>(keyParam.status);
return out;
}
{
out << timeLoops.key;
return out;
}
{
in >> static_cast<quint8>(keyParam.select) >> static_cast<quint8>(keyParam.status);
return in;
}
{
in >> timeLoops.key;
return in;
}
QDataStream &operator<<(QDataStream &out, const t_keyParam &keyParam);
QDataStream &operator<<(QDataStream &out, const t_timeloops &timeLoops);
QDataStream &operator>>(QDataStream &in, const t_keyParam &keyParam);
QDataStream &operator>>(QDataStream &in, const t_timeloops &timeLoops);
QDataStream &operator<<(QDataStream &out, const t_keyParam &keyParam)
{
out << static_cast<quint8>(keyParam.select) << static_cast<quint8>(keyParam.status);
return out;
}
QDataStream &operator<<(QDataStream &out, const t_timeloops &timeLoops)
{
out << timeLoops.key;
return out;
}
QDataStream &operator>>(QDataStream &in, const t_keyParam &keyParam)
{
in >> static_cast<quint8>(keyParam.select) >> static_cast<quint8>(keyParam.status);
return in;
}
QDataStream &operator>>(QDataStream &in, const t_timeloops &timeLoops)
{
in >> timeLoops.key;
return in;
}
To copy to clipboard, switch view to plain text mode
So I'm trying write a function just for my typedef and enum.
Bookmarks