[Qt-qml] Any one knows how to write a qmldesigner plugin?

Kai Koehne kai.koehne at nokia.com
Wed Jul 21 09:55:33 CEST 2010


On 7/21/2010 9:04 AM, ext Chen, Zhang Z wrote:
> Kai,
>
> I found that only sub class of QDelarativeItem can be added to the item library of Quick Designer. Is that by design? QML runtime plugin can register any QObject type, why shouldn't QuickDesigner? If I want to import QLabel to the designer, should I create a class which inherits both QDelarativeItem and QLabel?

Hi,

the idea of QuickDesigner is obviously to lay out stuff visually. To do 
this, the things you drag&drop have to implement an interface. 
QuickDesigner needs a way to e.g. set a width, height, position, and 
tell the thingy to paint itself. That's why we cannot handle 'arbitrary' 
QObject based classes (at least QuickDesigner is not able to do anything 
interesting with it).

You're right in that QuickDesigner only supports items inheriting from 
QDeclarativeItem. It would be indeed possible to also add support for 
QWidget based stuff, but it would be a major effort, and given the fact 
that we don't support QWidget bindings for Qml, and there is already a 
visual editor for QWidgets (QtDesigner), it's unlikely that we look into 
this any time soon.

Kai

> Best regard,
>
> John Chen
>
> -----Original Message-----
> From: qt-qml-bounces at trolltech.com [mailto:qt-qml-bounces at trolltech.com] On Behalf Of Kai Koehne
> Sent: Wednesday, July 21, 2010 1:51 PM
> To: qt-qml at trolltech.com
> Subject: Re: [Qt-qml] Any one knows how to write a qmldesigner plugin?
>
> On 7/20/2010 11:17 AM, ext Chen, Zhang Z wrote:
>> Hi All,
>> I'm trying to make a customized type to be "designable" with QML
>> designer. I tried to write a plugin using fxplugin as a template. But as
>> long as I use types instead of those in fx.metainfo, I can't have them
>> displayed on QML designer. Anyone can give me a rough idea on what is
>> the problem?
>
> Hi,
>
> we haven't really spend much time on enabling support for external C++
> plugins in QuickDesigner, so consider this experimental for now (like
> the whole plugin). Anyhow, maybe it's a small issue easy to fix. Can you
> file a more detailed report (e.g. what does 'can't have them displayed'
> mean?) to bugreports.qt.nokia.com, ideally with some example code?
>
> Thanks,
>
> Kai
>
>


-- 
--
Kai Koehne
Software Engineer
Nokia, Qt Development Frameworks

Nokia gate5 GmbH
Firmensitz: Invalidenstr. 117, 10115 Berlin, Germany
Registergericht: Amtsgericht Charlottenburg, Berlin: HRB 106443 B
Umsatzsteueridentifikationsnummer: DE 812 845 193
Geschäftsführer: Dr. Michael Halbherr, Karim Tähtivuori



More information about the Qt-qml mailing list