gui: Introduce IPCPreviewClient
这个提交包含在:
36
gui/ipcpreviewclient.h
普通文件
36
gui/ipcpreviewclient.h
普通文件
@@ -0,0 +1,36 @@
|
||||
#ifndef IPCPREVIEWCLIENT_H
|
||||
#define IPCPREVIEWCLIENT_H
|
||||
#include <QObject>
|
||||
#include <QLocalSocket>
|
||||
#include "previewresult.h"
|
||||
#include "renderconfig.h"
|
||||
#include "rendertarget.h"
|
||||
|
||||
class IPCPreviewClient : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
unsigned int currentPreviewGeneration = 1;
|
||||
QLocalSocket *socket;
|
||||
QString socketPath;
|
||||
|
||||
bool connect();
|
||||
QSharedPointer<PreviewResult> deserialize(QByteArray &array);
|
||||
|
||||
public:
|
||||
IPCPreviewClient();
|
||||
~IPCPreviewClient()
|
||||
{
|
||||
delete socket;
|
||||
}
|
||||
void setSocketPath(QString socketPath);
|
||||
public slots:
|
||||
void start(RenderConfig config, const QVector<RenderTarget> &targets);
|
||||
void startGeneration(RenderConfig config, const QVector<RenderTarget> &targets);
|
||||
void stopGeneration();
|
||||
signals:
|
||||
void previewReceived(QSharedPointer<PreviewResult> previewResult, unsigned int currentPreviewGeneration);
|
||||
void finished();
|
||||
};
|
||||
|
||||
#endif // IPCPREVIEWCLIENT_H
|
||||
在新工单中引用
屏蔽一个用户