2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2011-05-12 16:22:51 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2011-05-12 16:22:51 +02:00
|
|
|
|
2011-06-09 15:50:48 +02:00
|
|
|
#include "qt5nodeinstanceserver.h"
|
2011-05-12 16:22:51 +02:00
|
|
|
|
|
|
|
|
namespace QmlDesigner {
|
|
|
|
|
|
2011-06-09 15:50:48 +02:00
|
|
|
class Qt5PreviewNodeInstanceServer : public Qt5NodeInstanceServer
|
2011-05-12 16:22:51 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2011-06-09 15:50:48 +02:00
|
|
|
explicit Qt5PreviewNodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient);
|
2011-05-12 16:22:51 +02:00
|
|
|
|
2015-06-03 15:34:34 +02:00
|
|
|
void createScene(const CreateSceneCommand &command) override;
|
|
|
|
|
void changeState(const ChangeStateCommand &command) override;
|
|
|
|
|
void removeSharedMemory(const RemoveSharedMemoryCommand &command) override;
|
2020-05-07 14:13:21 +02:00
|
|
|
void changePreviewImageSize(const ChangePreviewImageSizeCommand &command) override;
|
2022-02-02 17:56:16 +02:00
|
|
|
bool isPreviewServer() const override;
|
2011-06-09 15:50:48 +02:00
|
|
|
|
|
|
|
|
QImage renderPreviewImage();
|
2011-05-12 16:22:51 +02:00
|
|
|
|
|
|
|
|
protected:
|
2015-06-03 15:34:34 +02:00
|
|
|
void collectItemChangesAndSendChangeCommands() override;
|
|
|
|
|
void startRenderTimer() override;
|
2011-05-12 16:22:51 +02:00
|
|
|
|
|
|
|
|
private:
|
2013-07-31 15:19:18 +02:00
|
|
|
ServerNodeInstance m_currentState;
|
2022-03-01 10:22:21 +01:00
|
|
|
QSize m_previewSize{320, 320};
|
2011-05-12 16:22:51 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace QmlDesigner
|