[Interest] what are the requirements for QMetaType::metaObjectForType(QMetaType::type("QQuickLayout*")) to work?

NIkolai Marchenko enmarantispam at gmail.com
Tue May 7 02:48:30 CEST 2024


I don't think it works, adding `import QtQuick.Layouts 1.15` to qmldir of
that module produces an error  "import requires 2 arguments, but 2 were
provided"

On Mon, May 6, 2024 at 9:13 PM Ulf Hermann via Interest <
interest at qt-project.org> wrote:

> On 5/6/24 18:12, NIkolai Marchenko wrote:
> > Is there a way to automatically import qtquick.layouts while importing a
> > custom module inside of qml file?
>
> If you control the custom module and are OK with anyone importing the
> custom module always also importing QtQuick.Layouts, then yes. There is
> IMPORTS in qt_add_qml_module(), see
> https://doc.qt.io/qt-6/qt-add-qml-module.html#declaring-module-dependencies
>
> If you are using Qt5, you are probably writing your qmldir files
> manually. In that case, there is the "import" declaration:
> https://doc.qt.io/qt-6/qtqml-modules-qmldir.html#module-import-declaration
>
> The latter also exists in Qt 5.15 even though it's only documented for Qt6.
>
> best regards,
> Ulf
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240507/476236e4/attachment.htm>


More information about the Interest mailing list