1// qqmlcomponent.sip generated by MetaSIP 2// 3// This file is part of the QtQml Python extension module. 4// 5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> 6// 7// This file is part of PyQt5. 8// 9// This file may be used under the terms of the GNU General Public License 10// version 3.0 as published by the Free Software Foundation and appearing in 11// the file LICENSE included in the packaging of this file. Please review the 12// following information to ensure the GNU General Public License version 3.0 13// requirements will be met: http://www.gnu.org/copyleft/gpl.html. 14// 15// If you do not wish to use this file under the terms of the GPL version 3.0 16// then you may purchase a commercial license. For more information contact 17// info@riverbankcomputing.com. 18// 19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 21 22 23class QQmlComponent : QObject 24{ 25%TypeHeaderCode 26#include <qqmlcomponent.h> 27%End 28 29public: 30 enum CompilationMode 31 { 32 PreferSynchronous, 33 Asynchronous, 34 }; 35 36 QQmlComponent(QQmlEngine *, QObject *parent /TransferThis/ = 0); 37 QQmlComponent(QQmlEngine *, const QString &fileName, QObject *parent /TransferThis/ = 0) /ReleaseGIL/; 38 QQmlComponent(QQmlEngine *, const QString &fileName, QQmlComponent::CompilationMode mode, QObject *parent /TransferThis/ = 0) /ReleaseGIL/; 39 QQmlComponent(QQmlEngine *, const QUrl &url, QObject *parent /TransferThis/ = 0) /ReleaseGIL/; 40 QQmlComponent(QQmlEngine *, const QUrl &url, QQmlComponent::CompilationMode mode, QObject *parent /TransferThis/ = 0) /ReleaseGIL/; 41 QQmlComponent(QObject *parent /TransferThis/ = 0); 42 virtual ~QQmlComponent(); 43 44 enum Status 45 { 46 Null, 47 Ready, 48 Loading, 49 Error, 50 }; 51 52 QQmlComponent::Status status() const; 53 bool isNull() const; 54 bool isReady() const; 55 bool isError() const; 56 bool isLoading() const; 57 QList<QQmlError> errors() const; 58 qreal progress() const; 59 QUrl url() const; 60 virtual QObject *create(QQmlContext *context = 0) /TransferBack/; 61%If (Qt_5_14_0 -) 62 QObject *createWithInitialProperties(const QVariantMap &initialProperties, QQmlContext *context = 0) /TransferBack/; 63%End 64 virtual QObject *beginCreate(QQmlContext *) /TransferBack/; 65 virtual void completeCreate(); 66 void create(QQmlIncubator &, QQmlContext *context = 0, QQmlContext *forContext = 0); 67 QQmlContext *creationContext() const; 68 69public slots: 70 void loadUrl(const QUrl &url) /ReleaseGIL/; 71 void loadUrl(const QUrl &url, QQmlComponent::CompilationMode mode) /ReleaseGIL/; 72 void setData(const QByteArray &, const QUrl &baseUrl); 73 74signals: 75 void statusChanged(QQmlComponent::Status); 76 void progressChanged(qreal); 77 78public: 79%If (Qt_5_12_0 -) 80 QQmlEngine *engine() const; 81%End 82%If (Qt_5_14_0 -) 83 void setInitialProperties(QObject *component, const QVariantMap &properties); 84%End 85}; 86