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