7#include <QtQml/qqmlfile.h>
9#include <QtCore/qlibraryinfo.h>
10#include <QtCore/qstandardpaths.h>
18 m_blacklist.
blacklist(
":/qt-project.org");
19 m_blacklist.
blacklist(
":/QtQuick/Controls/Styles");
20 m_blacklist.
blacklist(
":/ExtrasImports/QtQuick/Controls/Styles");
41 for (
auto locationType : blackListLocations) {
70 if (fileIterator != m_fileCache.
constEnd()) {
72 m_contents = *fileIterator;
78 if (dirIterator != m_directoryCache.
constEnd()) {
81 m_entries = *dirIterator;
89 m_waitCondition.
wait(&m_contentMutex);
108 if (!
path.isEmpty()) {
125 if (
path == m_path) {
137 if (
path == m_path) {
144void QQmlPreviewFileLoader::error(
const QString &
path)
148 if (
path == m_path) {
154void QQmlPreviewFileLoader::clearCache()
158 m_directoryCache.
clear();
163#include "moc_qqmlpreviewfileloader.cpp"
void clear()
Clears the contents of the byte array and makes it null.
const_iterator constFind(const Key &key) const noexcept
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
void clear() noexcept(std::is_nothrow_destructible< Node >::value)
Removes all items from the hash and frees up all memory used by it.
static QString path(LibraryPath p)
LibraryPath
\keyword library location
void moveToThread(QThread *thread)
Changes the thread affinity for this object and its children.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
static QString urlToLocalFileOrQrc(const QString &)
If url is a local file returns a path suitable for passing to QFile.
void blacklist(const QString &path)
void whitelist(const QString &path)
bool isBlacklisted(const QString &path) const
QQmlPreviewFileLoader(QQmlPreviewServiceImpl *service)
Result load(const QString &file)
bool isBlacklisted(const QString &file)
void whitelist(const QUrl &url)
void request(const QString &file)
void forwardRequest(const QString &file)
void file(const QString &file, const QByteArray &contents)
void directory(const QString &file, const QStringList &entries)
void error(const QString &file)
static QStringList standardLocations(StandardLocation type)
StandardLocation
This enum describes the different locations that can be queried using methods such as QStandardPaths:...
\macro QT_RESTRICTED_CAST_FROM_ASCII
void start(Priority=InheritPriority)
bool wait(QDeadlineTimer deadline=QDeadlineTimer(QDeadlineTimer::Forever))
bool wait(QMutex *, QDeadlineTimer=QDeadlineTimer(QDeadlineTimer::Forever))
Combined button and popup list for selecting options.
GLsizei const GLchar *const * path
GLuint const GLint * locations
QUrl url("example.com")
[constructor-url-reference]