qqmlcomponent.sip 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // qqmlcomponent.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtQml Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  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. class QQmlComponent : public QObject
  22. {
  23. %TypeHeaderCode
  24. #include <qqmlcomponent.h>
  25. %End
  26. public:
  27. enum CompilationMode
  28. {
  29. PreferSynchronous,
  30. Asynchronous,
  31. };
  32. QQmlComponent(QQmlEngine *, QObject *parent /TransferThis/ = 0);
  33. QQmlComponent(QQmlEngine *, const QString &fileName, QObject *parent /TransferThis/ = 0) /ReleaseGIL/;
  34. QQmlComponent(QQmlEngine *, const QString &fileName, QQmlComponent::CompilationMode mode, QObject *parent /TransferThis/ = 0) /ReleaseGIL/;
  35. QQmlComponent(QQmlEngine *, const QUrl &url, QObject *parent /TransferThis/ = 0) /ReleaseGIL/;
  36. QQmlComponent(QQmlEngine *, const QUrl &url, QQmlComponent::CompilationMode mode, QObject *parent /TransferThis/ = 0) /ReleaseGIL/;
  37. %If (Qt_6_5_0 -)
  38. QQmlComponent(QQmlEngine *engine, QAnyStringView uri, QAnyStringView typeName, QObject *parent /TransferThis/ = 0) /ReleaseGIL/;
  39. %End
  40. %If (Qt_6_5_0 -)
  41. QQmlComponent(QQmlEngine *engine, QAnyStringView uri, QAnyStringView typeName, QQmlComponent::CompilationMode mode, QObject *parent /TransferThis/ = 0) /ReleaseGIL/;
  42. %End
  43. QQmlComponent(QObject *parent /TransferThis/ = 0);
  44. virtual ~QQmlComponent();
  45. enum Status
  46. {
  47. Null,
  48. Ready,
  49. Loading,
  50. Error,
  51. };
  52. QQmlComponent::Status status() const;
  53. %If (Qt_6_5_0 -)
  54. bool isBound() const;
  55. %End
  56. bool isNull() const;
  57. bool isReady() const;
  58. bool isError() const;
  59. bool isLoading() const;
  60. QList<QQmlError> errors() const;
  61. qreal progress() const;
  62. QUrl url() const;
  63. virtual QObject *create(QQmlContext *context = 0) /TransferBack/;
  64. QObject *createWithInitialProperties(const QVariantMap &initialProperties, QQmlContext *context = 0) /TransferBack/;
  65. virtual QObject *beginCreate(QQmlContext *) /TransferBack/;
  66. virtual void completeCreate();
  67. void create(QQmlIncubator &, QQmlContext *context = 0, QQmlContext *forContext = 0);
  68. QQmlContext *creationContext() const;
  69. public 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. %If (Qt_6_5_0 -)
  74. void loadFromModule(QAnyStringView uri, QAnyStringView typeName, QQmlComponent::CompilationMode mode = QQmlComponent::PreferSynchronous);
  75. %End
  76. signals:
  77. void statusChanged(QQmlComponent::Status);
  78. void progressChanged(qreal);
  79. public:
  80. QQmlEngine *engine() const;
  81. void setInitialProperties(QObject *component, const QVariantMap &properties);
  82. };