[Interest] [Qt6] QML automatic type registration in a (shared) library

Ulf Hermann ulf.hermann at qt.io
Fri Jan 14 16:18:33 CET 2022


> I don't know. I have the generated qmldir in 
> the C:\Programming\tsc\build\debug\TscUi directory, which I think should 
> be correct. I haven't messed with the output paths at all.
> The application goes to a neighboring directory 
> in C:\Programming\tsc\build\debug\TscApp

Well, no, that doesn't work. If your module is called Tsc.Ui, then it 
needs to live in a directory called Tsc/Ui/, not TscUi/. That's the 
reason why the explicit file system import path doesn't work either.

> I can see that the .rcc contains a couple of cpp files corresponding to 

There may be multiple generated .rcc files.

> QDirdir(":/Tsc");
> 
> constautolist=dir.entryInfoList();
> 
> for(constauto&entry:list)
> 
> qDebug()<<entry;
> 
> Which produced only:
> QFileInfo(:\Tsc\Core)

I guess your linker ignored the linkage because you don't "use" any 
symbols from the linked library. You need to do the plugin linking trick 
with Q_IMPORT_QML_PLUGIN.

best regards,
Ulf


More information about the Interest mailing list