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
qqmlpreviewfileloader.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
4#ifndef QQMLPREVIEWFILELOADER_H
5#define QQMLPREVIEWFILELOADER_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
19
20#include <QtCore/qobject.h>
21#include <QtCore/qthread.h>
22#include <QtCore/qmutex.h>
23#include <QtCore/qwaitcondition.h>
24#include <QtCore/qvector.h>
25#include <QtCore/qurl.h>
26#include <QtCore/qpointer.h>
27#include <QtCore/qset.h>
28
30
33{
35public:
42
45
46 QMutex *loadMutex() { return &m_loadMutex; }
47 Result load(const QString &file);
48
51
52 void whitelist(const QUrl &url);
53 bool isBlacklisted(const QString &file);
54
56 void request(const QString &file);
57
58private:
59 QMutex m_loadMutex;
60 QMutex m_contentMutex;
61 QWaitCondition m_waitCondition;
62
63 QThread m_thread;
64 QPointer<QQmlPreviewServiceImpl> m_service;
65
66 QString m_path;
67 QByteArray m_contents;
68 QStringList m_entries;
69 Result m_result;
70
71 QQmlPreviewBlacklist m_blacklist;
72 QHash<QString, QByteArray> m_fileCache;
73 QHash<QString, QStringList> m_directoryCache;
74
75 void file(const QString &file, const QByteArray &contents);
76 void directory(const QString &file, const QStringList &entries);
77 void error(const QString &file);
78 void clearCache();
79};
80
81QT_END_NAMESPACE
82
83#endif // QQMLPREVIEWFILELOADER_H
void messageReceived(const QByteArray &message) override
void foundTranslationBinding(const TranslationBindingInformation &translationBindingInformation) override
void engineAboutToBeAdded(QJSEngine *engine) override
void state(const QString &stateName)
void engineAboutToBeRemoved(QJSEngine *engine) override
QMultiMap< QObject *, TranslationBindingInformation > objectTranslationBindingMultiMap
QList< QPointer< QQuickItem > > translatableTextOccurrences
std::unique_ptr< QAbstractFileEngine > create(const QString &fileName) const override
If this file handler can handle fileName, this method creates a file engine and returns it wrapped in...
QQmlPreviewFileLoader(QQmlPreviewServiceImpl *service)
Result load(const QString &file)
bool isBlacklisted(const QString &file)
void whitelist(const QUrl &url)
void dropCU(const QUrl &url)
void zoom(qreal newFactor)
QQuickItem * currentRootItem()
bool eventFilter(QObject *obj, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
void fps(const FpsInfo &info)
void removeEngine(QQmlEngine *engine)
void addEngine(QQmlEngine *engine)
void loadUrl(const QUrl &url)
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 engineAboutToBeRemoved(QJSEngine *engine) override
QQmlPreviewServiceImpl(QObject *parent=nullptr)
void file(const QString &file, const QByteArray &contents)
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
QDebug operator<<(QDebug dbg, const QFileInfo &fi)
static QString translationIdString(const QQmlTranslation::QsTrData &data)