I can confirm a simple:

    for (const QString &importPath : parser.values(importOption)){
        QByteArray path = qgetenv("PATH");
        QByteArray newPath = importPath.toLocal8Bit() + ";";
        newPath += path;
        qputenv("PATH", newPath);
        qDebug() << "Modified PATH:" << qgetenv("PATH");
        e.addImportPath(importPath);
    }

did the trick. I will see if I will get to setup the tedious contribution process going. Should I create a feature issue for this? Then we could continue the discussion there.

Cheers,

Eli

On 25/10/2023 14:47, Ulf Hermann via Development wrote:
Adding a command line option to add dll search paths via _wpuntenv_s(L"PATH", ...) or SetDLLDirectory(L"...") into qml.exe would also work, right?

I didn't know this exists. You'd have to add a lot of directories, though, since it doesn't want to see the QML import path but the paths to the individual modules I guess.

If you have a solution in mind, feel free to push a change to https://codereview.qt-project.org and add me as reviewer. It would be nice to make this work.
--
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to