[Qt-qml] QDeclarativeItem subclasses and mouse events

Jan Ekholm jan.ekholm at smultron.net
Wed Aug 4 12:17:03 CEST 2010


On Wednesday 04 August 2010 05:53:13 michael.brasser at nokia.com wrote:
> Hi,
> 
> On 03/08/2010, at 4:55 AM, ext Jan Ekholm wrote:
> > I was recommended to make a C++ QDeclarativeItem subclass for my game map
> > tiles to get better performance. This worked well
> 
> Given the simplicity of the QML tile (from http://gitorious.org/tactics),
> I'm a bit surprised that using a C++ item made a difference in
> performance. What sort of performance issues were you seeing, and on what
> platform(s)?

The most noticeable difference is when creating the scene, i.e. when the QML 
file is loaded. A base based on the old Image item that I used instead of a 
C++ Hex took a lot longer to set up. I tried to get rid of the slow sounding 
Repeater too, but that can not be done with QML just yet. But that simple 
change made scenes much faster to load and the panning is a bit smoother too.

I never really had any panning issues, not even on an N900, but setup time was 
not exactly fast. As there is a fair deal of QML used the time just seemed to 
get longer and longer. On a fast desktop PC it took 3-10 to load the initial 
game QML file that also sets up the map. Now it's much faster.

-- 
           "Right, you bastards, you're... you're geography"
                                         -- Terry Pratchett, Guards! Guards!




More information about the Qt-qml mailing list