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@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@qt-project.org > https://lists.qt-project.org/listinfo/interest >
_______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest