[Interest] problem when inheriting from QQuickItem

VStevenP vstevenpavao at yahoo.com
Fri May 10 23:55:13 CEST 2013


Hi Preet,

No, it did not.  So, I set that in my constructor now, but it still doesn't work.

There must be more things that happen when the QML Engine constructs and initializes an Item which causes the Item to be able to display nested components.

Thanks for your idea, and if you have any more ideas, thanks in advance for any.   I am really hoping I can use my own custom Item and have it be able to display nested components.

- VStevenP



>________________________________
> From: Preet <prismatic.project at gmail.com>
>To: interest <interest at qt-project.org> 
>Sent: Friday, May 10, 2013 3:49 PM
>Subject: Re: [Interest] problem when inheriting from QQuickItem
> 
>
>
>Does your item have the QQuickItem::ItemHasContents flag set?
>http://qt-project.org/doc/qt-5.0/qtquick/qquickitem.html#Flag-enum
>
>
>
>
>On Fri, May 10, 2013 at 3:10 PM, VStevenP <vstevenpavao at yahoo.com> wrote:
>
>One minor correction, the import commands should say MyItem, not KItem.
>>
>>
>>I adjusted the code below accordingly.
>>
>>
>>I am trying to figure out why my class which inherits from QQuickItem won't allow display of other embedded elements in my QML documents.
>>
>>
>>- VStevenP
>>
>>
>>--
>>
>>The following QML document results in the display of the png:
>>
>>import QtQuick 2.0
>>import MyItem 1.0
>>
>>
>>Item{
>>    Image{
>>        source:"knob.png"
>>    }
>>}
>>
>>
>>The
 following QML document results in the png NOT being displayed:
>>
>>import QtQuick 2.0
>>import MyItem 1.0
>>
>>MyItem{
>>    Image{
>>        source:"knob.png"
>>    }
>>}
>>
>>
>>
>>
>>_______________________________________________
>>Interest mailing list
>>Interest at qt-project.org
>>http://lists.qt-project.org/mailman/listinfo/interest
>>
>>
>
>_______________________________________________
>Interest mailing list
>Interest at qt-project.org
>http://lists.qt-project.org/mailman/listinfo/interest
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130510/9888a3a7/attachment.html>


More information about the Interest mailing list