Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

QQmlExtensionPlugin : C++ constructor called but no QML component created

$
0
0
Hi, I’m trying to figure out how QQmlExtensionPlugin works. I created a plugin which derives from this class (called Button) which I import with QQmlEngine::importPlugin(); The uri is now registered and I can instantiate it in other QML documents. If I do, the C++ constructor is called, but no QML component is created. If I understand correctly, I need to specify this in the qmldir file. But I’m confused where exactly this needs to point to. Ideally this would refer to a resource, since I would like to keep everything within the plugin. This is my resource file: <RCC>     <qresource prefix="/button">         <file alias="Button">Button.qml</file>     </qresource> </RCC> And this is my qmldir file module Button Button 1.0 /button/Button.qml but to no avail. Thanks for reading

Viewing all articles
Browse latest Browse all 4972

Trending Articles