Well ... maybe you want to read
https://doc.qt.io/qt-6/qtqml-writing-a-module.html
Actually, I like https://www.qt.io/blog/qml-modules-in-qt-6.2 better
because it contains some history and motivation for why QML modules are
what they are. For the actual examples, better refer to doc.qt.io, tho
The first argument to the `qt_add_qml_module()` function is *not* a new
target to be defined by the call.
You can also give it an existing target. See all our examples that first
create an executable target and then attach a QML module to it.
Furthermore, the `SOURCES` argument isn't a list o
Hi,
allow me to follow up on my own mail. I have made some progress through
exploring (and reverse-engineering), and I would like to refine my
questions to refocus the discussion. But perhaps it's best if I briefly
describe my misunderstandings first, as that may help others as well.
The first ar
Hi Nils,
thanks a lot for your elaborate answer. That's very helpful indeed. I still
have a couple of fundamental questions (see my reply to Ulf), but this
gives some good hints.
In fact I think the best way forward might be to set up a little toy
project that has the desired structure, and which
On Tue, Oct 24, 2023 at 10:47 AM Ulf Hermann wrote:
> > In our existing code we call `qmlRegisterType<...>(...)` in our regular
> > C++ code (e.g., some shared libraries that the main application links
> to).
> > I thought that, to be able to use those types in stand-alone QML code,
> > I'd need
Hi,
On Tue, Oct 24, 2023 at 4:35 PM Stefan Seefeld wrote:
> So it sounds like I still don't understand what `qt_add_qml_module` is doing.
AFAIK it builds a bunch of cmake custom commands that use moc for c++
and some other tooling for qml files to extract all the type
information. This then is t
In our existing code we call `qmlRegisterType<...>(...)` in our regular
C++ code (e.g., some shared libraries that the main application links to).
I thought that, to be able to use those types in stand-alone QML code,
I'd need to move these calls into plugins, or at least have some QML
extension
On Tue, Oct 24, 2023 at 10:11 AM Ulf Hermann wrote:
> > Most of the context would be injected into the QML runtime from C++ via
> > calls to `setContextProperty()`, as well as by defining additional QML
> > modules from C++ (via `qmlRegister...()`).
>
> This is where your architecture fails. By u
Most of the context would be injected into the QML runtime from C++ via
calls to `setContextProperty()`, as well as by defining additional QML
modules from C++ (via `qmlRegister...()`).
This is where your architecture fails. By using setContextProperty() and
procedurally registering types, you
Hi Ulf,
thank you for following up !
Yes, it's entirely possible I'm missing something fundamental, trying to
approach a problem from the wrong side, so let me give some context:
We are developing an application that's written mostly in C++ with a GUI
done in QML. The application architecture is
I'm trying to create a QML extension module using CMake, and I've run
into some road blocks.
I want to create a QML module including a "plugin", based on my own code
rather than an auto-generated plugin stub.
My first question is why? The most important part of a QML module is
generally a back
Hello,
I'm trying to create a QML extension module using CMake, and I've run into
some road blocks.
I want to create a QML module including a "plugin", based on my own code
rather than an auto-generated plugin stub.
I assume I'll have to define my own plugin target and then use
`target_include_di
12 matches
Mail list logo