RenderConfig: Add serialization, basically for IPC
Tento commit je obsažen v:
rodič
6a5cb69e27
revize
830226ae59
17
gui/renderconfig.cpp
Normální soubor
17
gui/renderconfig.cpp
Normální soubor
@ -0,0 +1,17 @@
|
|||||||
|
#include "renderconfig.h"
|
||||||
|
|
||||||
|
QDataStream &operator<<(QDataStream &out, const RenderConfig &rc)
|
||||||
|
{
|
||||||
|
out << rc.scaleX;
|
||||||
|
out << rc.scaleY;
|
||||||
|
out << rc.wordsToHighlight;
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDataStream &operator>>(QDataStream &in, RenderConfig &rc)
|
||||||
|
{
|
||||||
|
in >> rc.scaleX;
|
||||||
|
in >> rc.scaleY;
|
||||||
|
in >> rc.wordsToHighlight;
|
||||||
|
return in;
|
||||||
|
}
|
@ -1,12 +1,17 @@
|
|||||||
#ifndef RENDERCONFIG_H
|
#ifndef RENDERCONFIG_H
|
||||||
#define RENDERCONFIG_H
|
#define RENDERCONFIG_H
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
#include <QDataStream>
|
||||||
|
|
||||||
struct RenderConfig
|
struct RenderConfig
|
||||||
{
|
{
|
||||||
double scaleX = 50 / 100.;
|
double scaleX = 50 / 100.;
|
||||||
double scaleY = scaleX;
|
double scaleY = scaleX;
|
||||||
QVector<QString> wordsToHighlight;
|
QVector<QString> wordsToHighlight;
|
||||||
|
friend QDataStream &operator<<(QDataStream &out, const RenderConfig &rc);
|
||||||
|
friend QDataStream &operator>>(QDataStream &in, RenderConfig &rc);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
QDataStream &operator<<(QDataStream &out, const RenderConfig &rc);
|
||||||
|
QDataStream &operator>>(QDataStream &in, RenderConfig &rc);
|
||||||
#endif // RENDERCONFIG_H
|
#endif // RENDERCONFIG_H
|
||||||
|
Načítá se…
Odkázat v novém úkolu
Zablokovat Uživatele