Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmlpreviewservice.h
Go to the documentation of this file.
1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant
4
5#ifndef QQMLPREVIEWSERVICE_H
6#define QQMLPREVIEWSERVICE_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
21#include <private/qqmldebugserviceinterfaces_p.h>
22
23#include <QtCore/qset.h>
24#include <memory>
25
27
31{
33
34public:
50
51 static const QString s_key;
52
53 QQmlPreviewServiceImpl(QObject *parent = nullptr);
54 virtual ~QQmlPreviewServiceImpl();
55
56 void messageReceived(const QByteArray &message) override;
57 void engineAboutToBeAdded(QJSEngine *engine) override;
58 void engineAboutToBeRemoved(QJSEngine *engine) override;
59 void stateChanged(State state) override;
60
61 void forwardRequest(const QString &file);
62 void forwardError(const QString &error);
63 void forwardFps(const QQmlPreviewHandler::FpsInfo &frames);
64 void forwardHotReloadFailure(const QString &reason);
65
66 QQuickItem *currentRootItem();
67
69 void error(const QString &file);
70 void file(const QString &file, const QByteArray &contents);
71 void directory(const QString &file, const QStringList &entries);
72 void load(const QUrl &url);
73 void drop(const QUrl &url);
74 void rerun();
75 void clearCache();
76 void zoom(qreal factor);
77 void animationSpeed(qreal factor);
78
79private:
80 void switchToInPlaceHandler();
81
82 QScopedPointer<QQmlPreviewFileEngineHandler> m_fileEngine;
83 QScopedPointer<QQmlPreviewFileLoader> m_loader;
84 std::unique_ptr<QQmlPreviewHandler> m_handler;
85 QUrl m_currentUrl;
86 QSet<QUrl> m_servedUrls;
87};
88
89QT_END_NAMESPACE
90
91#endif // QQMLPREVIEWSERVICE_H
void load(const QUrl &url) final
void removeEngine(QQmlEngine *engine) final
void connectToService(QQmlPreviewServiceImpl *service) final
bool eventFilter(QObject *obj, QEvent *event) final
Filters events if this object has been installed as an event filter for the watched object.
void disconnectWindow(QQuickWindow *window)
void fps(const QQmlPreviewHandler::FpsInfo &info)
void setCurrentRootItem(QQuickItem *item)
QList< QQmlEngine * > engines() const
void zoomWindow(QQuickWindow *window, qreal zoomFactor, QQmlPreviewPosition *position)
QQuickItem * currentRootItem() const
void setCurrentWindow(QQuickWindow *window)
void connectWindow(QQuickWindow *window)
void setAnimationSpeed(qreal newFactor)
virtual void removeEngine(QQmlEngine *engine)
virtual void load(const QUrl &url)=0
QQmlPreviewHandler(QObject *parent=nullptr)
virtual void addEngine(QQmlEngine *engine)
QQuickWindow * currentWindow() const
virtual void connectToService(QQmlPreviewServiceImpl *service)
bool operator==(const QQmlPreviewPosition::ScreenData &other) const
void loadWindowPositionSettings(const QUrl &url)
void takePosition(QWindow *window, InitializeState state=PositionInitialized)
void initLastSavedWindowPosition(QWindow *window)
void forwardRequest(const QString &file)
void drop(const QUrl &url)
void animationSpeed(qreal factor)
static const QString s_key
void engineAboutToBeRemoved(QJSEngine *engine) override
QQmlPreviewServiceImpl(QObject *parent=nullptr)
void file(const QString &file, const QByteArray &contents)
void forwardHotReloadFailure(const QString &reason)
void directory(const QString &file, const QStringList &entries)
void engineAboutToBeAdded(QJSEngine *engine) override
void forwardFps(const QQmlPreviewHandler::FpsInfo &frames)
void zoom(qreal factor)
void load(const QUrl &url)
void stateChanged(State state) override
void forwardError(const QString &error)
void messageReceived(const QByteArray &message) override
Combined button and popup list for selecting options.
static Qt::WindowFlags fixFlags(Qt::WindowFlags flags)
static void closeAllWindows()