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
qqmltypeloaderqmldircontent_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 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 QQMLTYPELOADERQMLDIRCONTENT_P_H
6#define QQMLTYPELOADERQMLDIRCONTENT_P_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
19#include <private/qqmldirparser_p.h>
20
21QT_BEGIN_NAMESPACE
22
23class QQmlError;
25{
26private:
27 friend class QQmlTypeLoader;
28
29 void setContent(const QString &location, const QString &content);
30 void setError(const QQmlError &);
31
32public:
36
37 bool hasContent() const { return m_hasContent; }
38 bool hasError() const { return m_parser.hasError(); }
39 QList<QQmlError> errors(const QString &uri, const QUrl &url) const;
40
41 bool hasTypeNamespace() const { return m_parser.hasTypeNamespace(); }
42 QString typeNamespace() const { return m_parser.typeNamespace(); }
43
44 QQmlDirComponents components() const { return m_parser.components(); }
45 QQmlDirScripts scripts() const { return m_parser.scripts(); }
46 QQmlDirPlugins plugins() const { return m_parser.plugins(); }
47 QQmlDirImports imports() const { return m_parser.imports(); }
48 QQmlDirExports exports() const { return m_parser.exports(); }
49
50 QString qmldirLocation() const { return m_location; }
51 QString preferredPath() const { return m_parser.preferredPath(); }
52 QString linkTarget() const { return m_parser.linkTarget(); }
53
54 bool hasRedirection() const
55 {
56 const QString preferred = preferredPath();
57 return !preferred.isEmpty()
58 && preferred != QStringView(m_location).chopped(strlen("qmldir"));
59 }
60
61 bool designerSupported() const { return m_parser.designerSupported(); }
62 bool hasTypeInfo() const { return !m_parser.typeInfos().isEmpty(); }
63
64private:
65 QQmlDirParser m_parser;
66 QString m_location;
67 bool m_hasContent = false;
68};
69
70QT_END_NAMESPACE
71
72#endif // QQMLTYPELOADERQMLDIRCONTENT_P_H
QList< QQmlError > errors(const QString &uri, const QUrl &url) const
QQmlTypeLoaderQmldirContent & operator=(const QQmlTypeLoaderQmldirContent &)=default
QQmlTypeLoaderQmldirContent(const QQmlTypeLoaderQmldirContent &)=default