QmlPreview: A dedicated class for the QmlPreviewRunWorkerFactory

Change-Id: I994f339ac1ca35e9b1dc7e2572682c4bcdb485ea
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-01-05 13:53:41 +01:00
parent c151835834
commit 4a21700175
4 changed files with 131 additions and 126 deletions

View File

@@ -15,15 +15,18 @@
namespace Core { class IEditor; }
namespace ProjectExplorer { class RunControl; }
namespace QmlDebug { class QmlDebugConnection; }
namespace QmlPreview {
typedef bool (*QmlPreviewFileClassifier) (const QString &);
typedef QByteArray (*QmlPreviewFileLoader)(const QString &, bool *);
typedef void (*QmlPreviewFpsHandler)(quint16[8]);
typedef QList<ProjectExplorer::RunControl *> QmlPreviewRunControlList;
typedef std::function<std::unique_ptr<QmlDebugTranslationClient>(QmlDebug::QmlDebugConnection *)> QmlDebugTranslationClientCreator;
using QmlPreviewFileClassifier = bool (*)(const QString &);
using QmlPreviewFileLoader = QByteArray (*)(const QString &, bool *);
using QmlPreviewFpsHandler = void (*)(quint16[8]);
using QmlPreviewRunControlList = QList<ProjectExplorer::RunControl *>;
using QmlDebugTranslationClientCreator =
std::function<std::unique_ptr<QmlDebugTranslationClient>(QmlDebug::QmlDebugConnection *)>;
class QMLPREVIEW_EXPORT QmlPreviewPlugin : public ExtensionSystem::IPlugin
{
@@ -70,6 +73,10 @@ public:
void setQmlDebugTranslationClientCreator(QmlDebugTranslationClientCreator creator);
void previewCurrentFile();
void addPreview(ProjectExplorer::RunControl *preview);
void removePreview(ProjectExplorer::RunControl *preview);
signals:
void checkDocument(const QString &name, const QByteArray &contents,
QmlJS::Dialect::Enum dialect);