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
qqmlfile.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QQMLFILE_H
6#define QQMLFILE_H
7
8#include <QtQml/qtqmlglobal.h>
9
11
12class QUrl;
13class QString;
14class QObject;
15class QQmlEngine;
16class QQmlFilePrivate;
17
18// ### Qt7: Turn this into a namesapce
19class Q_QML_EXPORT QQmlFile
20{
21public:
22
23#if QT_DEPRECATED_SINCE(6, 11)
24 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
25 QQmlFile();
26
27 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
28 QQmlFile(QQmlEngine *engine, const QUrl &url);
29
30 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
31 QQmlFile(QQmlEngine *engine, const QString &url);
32
33 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
34 ~QQmlFile();
35
36 enum Status { Null, Ready, Error, Loading };
37
38 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
39 bool isNull() const;
40
41 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
42 bool isReady() const;
43
44 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
45 bool isError() const;
46
47 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
48 bool isLoading() const;
49
50 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
51 QUrl url() const;
52
53 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
54 Status status() const;
55
56 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
57 QString error() const;
58
59 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
60 qint64 size() const;
61
62 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
63 const char *data() const;
64
65 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
66 QByteArray dataByteArray() const;
67
68 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
69 void load(QQmlEngine *, const QUrl &);
70
71 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
72 void load(QQmlEngine *, const QString &);
73
74 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
75 void clear();
76
77 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
78 void clear(QObject *object);
79
80#if QT_CONFIG(qml_network)
81 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
82 bool connectFinished(QObject *, const char *);
83
84 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
85 bool connectFinished(QObject *, int);
86
87 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
88 bool connectDownloadProgress(QObject *, const char *);
89
90 QT_DEPRECATED_VERSION_X_6_11("Use QQmlComponent or the QML engine for loading files.")
91 bool connectDownloadProgress(QObject *, int);
92#endif // QT_CONFIG(qml_network)
93
94#endif // QT_DEPRECATED_SINCE(6, 11)
95
96 static bool isSynchronous(const QString &url);
97 static bool isSynchronous(const QUrl &url);
98
99 static bool isLocalFile(const QString &url);
100 static bool isLocalFile(const QUrl &url);
101
102 static QString urlToLocalFileOrQrc(const QString &);
103 static QString urlToLocalFileOrQrc(const QUrl &);
104private:
105 Q_DISABLE_COPY(QQmlFile)
106
107#if QT_DEPRECATED_SINCE(6, 11)
108 QQmlFilePrivate *d;
109#else
110 void *d = nullptr;
111#endif
112};
113
114QT_END_NAMESPACE
115
116#endif // QQMLFILE_H
\inmodule QtQml
Definition qqmlfile.h:20
Combined button and popup list for selecting options.