August 8, 2012

selectedOne selectedOne
Lab Rat
8 posts

Custom QML-Components with Designer integration

 

Hi Guys,

i wrote a QtQuick-Plugin for drawing graphical-primitives like a Ellipse or a Line.
It works well, but the Designer doesn’t recognize my custom plugin (C++; Dll).
I want to create a QML Component which is as comfortable to use as the Qt built-in Components e.g. Rectangle, MouseArea, etc.
Is there a way to create such Components in my Custom Dll?

How does it work?
Does anybody have the same problem?

EDIT:
I found somebody having the same problem like me, but there is no solution… :-/
http://qt-project.org/forums/viewthread/2555 [qt-project.org]
Can anybody help?

4 replies

August 8, 2012

sierdzio sierdzio
Area 51 Engineer
2312 posts

Try looking at this [qt-project.org] one, too. Not exactly a solution, but might help.

 Signature 

(Z(:^

August 14, 2012

ThomasHartmann ThomasHartma..
Ant Farmer
37 posts

Hi,

Qt Quick Designer uses an external process called qmlpuppet to render components.
By default a qmlpuppet shipped together with Qt Creator is used. This one does not support
your custom components.

The solution is to build share\qtcreator\qml\qmlpuppet in the Qt Creator source directory with a Qt version that supports the required components. You also have to install your custom components for this Qt version (in the imports directory).

Building qmlpuppet will install an executable for rendering components in the /bin directory of the Qt building it.
Qt Quick Designer checks for the Qt of the current project if a qmlpuppet is in the /bin directory. If yes it takes the qmlpuppet provided by the Qt version instead of the one provided by Qt Creator itself.

August 16, 2012

selectedOne selectedOne
Lab Rat
8 posts

Hi Thomas,

thank you for your advice.
This works fine for the qt-components-desktop, but not for the qt-components-symbian and not for my own QtQuickPlugin.
I’m not sure, but I think there are some things missing in my QtQuickPlugin.

The elements in my Plugin are derived from QDeclarativeItem and they get drawn with the Paint signal.
This works fine in the running mode, but i can’t see anything in the Designer.
Do you know a “HowTo” to create a QtQuickPlugin like the qt-components-desktop is?

Mark

August 17, 2012

diro diro
Lab Rat
38 posts

Hi, after some discussed, I still consider that it is a bug in subcomponentmanager.cpp (yeah, please refer to the link). You may try to compile your own QtCreator to solve this issue temporally.

sierdzio wrote:
Try looking at this [qt-project.org] one, too. Not exactly a solution, but might help.
 
  ‹‹ qml QmlApplicationViewer      Refresh QML Image ››

You must log in to post a reply. Not a member yet? Register here!