[Qt-qml] QDeclarativeItem subclasses and mouse events

michael.brasser at nokia.com michael.brasser at nokia.com
Tue Aug 3 08:51:13 CEST 2010


Hi,

On 03/08/2010, at 4:27 PM, ext Jan Ekholm wrote:
> On Tuesday 03 August 2010 04:55:46 Gregory Schlomoff wrote:
>> Hello !
>> 
>> You may want to have a look at our code for drag and drop, it's working
>> well:
>> 
>> http://bitbucket.org/gregschlom/qml-drag-drop
>> 
>> (and more specifically
>> http://bitbucket.org/gregschlom/qml-drag-drop/src/tip/DeclarativeDragArea.c
>> pp )
> 
> You seem to do nothing magical with your item either. Strange. But you also 
> have no implementation of:
> 
>    virtual QPainterPath shape () const;
>    virtual QRectF boundingRect () const;

Note that QDeclarativeItem has a default implementation of boundingRect() based on the width/height of the item.

> If I comment out my versions then I get lots of painting errors, the Flickable 
> that contains the items is behaving very strangely etc. Your item seems to be 
> non visual, perhaps that's why you don't need those methods?
> 
> As I see shape() getting called but nothing else happen I suspect that there's 
> something fishy going on in QDI regarding this.

Any chance you can share the code for you class so we can have a look into what's going on?

Regards,
Michael



More information about the Qt-qml mailing list