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 QFileDevice::Permissions permissions);
72 void directory(const QString &file, const QStringList &entries,
73 QFileDevice::Permissions permissions);
74 void load(const QUrl &url);
75 void drop(const QUrl &url);
76 void rerun();
77 void clearCache();
78 void zoom(qreal factor);
79 void animationSpeed(qreal factor);
80
81private:
82 void switchToInPlaceHandler();
83
84 QScopedPointer<QQmlPreviewFileEngineHandler> m_fileEngine;
85 QScopedPointer<QQmlPreviewFileLoader> m_loader;
86 std::unique_ptr<QQmlPreviewHandler> m_handler;
87 QUrl m_currentUrl;
88 QSet<QUrl> m_servedUrls;
89};
90
91QT_END_NAMESPACE
92
93#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 forwardHotReloadFailure(const QString &reason)
void directory(const QString &file, const QStringList &entries, QFileDevice::Permissions permissions)
void engineAboutToBeAdded(QJSEngine *engine) override
void forwardFps(const QQmlPreviewHandler::FpsInfo &frames)
void zoom(qreal factor)
void file(const QString &file, const QByteArray &contents, QFileDevice::Permissions permissions)
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()