December 17, 2010

strekazoid strekazoid
Lab Rat
151 posts

Cannot use QML designer with custom components

 

I’m trying to design a UI with QML graphical designer. Trouble is, when I’m using my custom QML components, it fails to recognize those. It just displays note saying “Type … unavailable”, and doesn’t display the whole UI at all! Is it a bug or something? Can’t find any excuse why this wouldn’t work.

13 replies

December 17, 2010

Alexander Kuchumov Alexander Kuchumov
Lab Rat
380 posts

You can write qml plugin for your custom components and it’ll work.

December 17, 2010

Alexander Kuchumov Alexander Kuchumov
Lab Rat
380 posts

Of course, sometimes it’s not convenient:(

December 17, 2010

strekazoid strekazoid
Lab Rat
151 posts

Come on, just bounding box around the custom component would be enough. I don’t even need much the actual content.

December 17, 2010

Alexander Kuchumov Alexander Kuchumov
Lab Rat
380 posts

But what size of bounding box must be?

December 17, 2010

strekazoid strekazoid
Lab Rat
151 posts

Width, height, x and y are specified inside the custom component.

December 17, 2010

Alexander Kuchumov Alexander Kuchumov
Lab Rat
380 posts

I also thought about this, but I think this approach has some pitfalls:(

December 17, 2010

strekazoid strekazoid
Lab Rat
151 posts

But I mean, qmlviewer is able to interpret everything right. Why can’t Qt creator?

December 17, 2010

Alexander Kuchumov Alexander Kuchumov
Lab Rat
380 posts

You use own qml plugins? QDeclarativeExtensionPlugin

September 6, 2011

EDIS EDIS
Lab Rat
11 posts

In my case, it runs, but displays ‘Package not found’

 Signature 


EDIS Interactive
http://edis.mx
http://vimeo.com/edis

September 15, 2011

diro diro
Lab Rat
39 posts

It may cause by qmldump.exe
The QtCreator will call qmldump to get the plugin information. And sometimes it cannot output the info by pipe.
You can try this:
qmldump.exe COMPONENT 1.0
and you will see some information, but if you try
qmldump.exe COMPONENT 1.0 >> info.txt
the info.txt may be empty, and it is why QtCreator cannot get the plugin information!

How to fix:
edit the source code of qmldump, add this statement fflush(stdout); after std::cout << bytes.constData(); (about line 578)

September 17, 2011

Alicemirror Alicemirror
Lab Rat
825 posts

This discussion is interesting, but please I need a clarification on the means of the terms. For custom components you mean a totally new component of a non-standard qml object?

Then does someone knows if there is a method to create designs using components that are defined using the Loader element?

Thank you.

 Signature 

Enrico Miglino (aka Alicemirror)
Tech Consulting
Islas Baleares, Ibiza (Spain)
http://www.contesti.eu

February 3, 2012

EDIS EDIS
Lab Rat
11 posts

With Qt Creator 2.4 it works fine most of the time!

 Signature 


EDIS Interactive
http://edis.mx
http://vimeo.com/edis

March 1, 2012

EDIS EDIS
Lab Rat
11 posts

In fact, this is still a problem.

Any custom component is rendered with a blank box. While this makes it possible to use the designer to “design” it. In fact it is almost useless.

The example:
http://doc.qt.nokia.com/4.7-snapshot/declarative-tutorials-extending-chapter1-basics.html

Will render fine in the running app, but QtCreator’s designer will render a blank box making it impossible for designers to design anything.

How can we create a new C++ element that will render in both cases?

 Signature 


EDIS Interactive
http://edis.mx
http://vimeo.com/edis

 
  ‹‹ Behavior element has no ’parent’ property      QML Video not working on N900 PR1.3 ››

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