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 <memory>
24
26
30{
32
33public:
49
50 static const QString s_key;
51
52 QQmlPreviewServiceImpl(QObject *parent = nullptr);
53 virtual ~QQmlPreviewServiceImpl();
54
55 void messageReceived(const QByteArray &message) override;
56 void engineAboutToBeAdded(QJSEngine *engine) override;
57 void engineAboutToBeRemoved(QJSEngine *engine) override;
58 void stateChanged(State state) override;
59
60 void forwardRequest(const QString &file);
61 void forwardError(const QString &error);
62 void forwardFps(const QQmlPreviewHandler::FpsInfo &frames);
63 void forwardHotReloadFailure(const QString &reason);
64
65 QQuickItem *currentRootItem();
66
68 void error(const QString &file);
69 void file(const QString &file, const QByteArray &contents);
70 void directory(const QString &file, const QStringList &entries);
71 void load(const QUrl &url);
72 void drop(const QUrl &url);
73 void rerun();
74 void clearCache();
75 void zoom(qreal factor);
76 void animationSpeed(qreal factor);
77
78private:
79 void switchToInPlaceHandler();
80
81 QScopedPointer<QQmlPreviewFileEngineHandler> m_fileEngine;
82 QScopedPointer<QQmlPreviewFileLoader> m_loader;
83 std::unique_ptr<QQmlPreviewHandler> m_handler;
84 QUrl m_currentUrl;
85};
86
87QT_END_NAMESPACE
88
89#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)
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)
static const QString s_key
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()