[Interest] Rotating objects in QML are killing performance
Michael Andersen
michael at steelcode.com
Thu Apr 11 18:45:54 CEST 2013
I just ran the code with QtQuick 1.1 as well, and it works fine with no
lag. So this must be a QtQuick2 problem...
Cheers
Michael
On 11 April 2013 18:40, preeteesh kakkar <preeteesh.kakkar at gmail.com> wrote:
> Hi,
>
> I checked your code with QtQuick 1.1 (which is what I have as of now) and
> it seems to be working perfectly fine. I ran 10 instance of application.
>
> The logic seems correct in your code.
>
>
> On Thu, Apr 11, 2013 at 11:31 AM, Michael Andersen <michael at steelcode.com>wrote:
>
>> Hi list,
>>
>> I have a loading throbber in my application that is completely killing
>> the performance. If it is rotating then the application does not repaint
>> while it is being dragged and if more than two or three copies of the
>> application are running then it starts lagging Unity. I'm on Ubuntu 12.04
>> with Qt 5.0.1 64-bit. I was going to wait until 5.2 was out and check
>> again, but it's taking a little longer than I expected for a stable version
>> to be released.
>>
>> Here is a simple reproducer of the problem, I create a QtQuick2
>> application in Qt Creator 2.7. I adjust the QML to look like this:
>>
>> import QtQuick 2.0
>>
>> Rectangle {
>> width: 400
>> height: 400
>> Rectangle {
>> id: redsquare
>> color: "red"
>> width: 50
>> height: 50
>> x: 50
>> y: 50
>> }
>> RotationAnimation {
>> loops: Animation.Infinite
>> target: redsquare
>> properties: "rotation"
>> from: 0
>> to: 360
>> duration: 300*5
>> direction: RotationAnimation.Clockwise
>> running: true
>> }
>> }
>>
>> My main.cpp is the default, but that looks like this:
>>
>> #include <QtGui/QGuiApplication>
>> #include "qtquick2applicationviewer.h"
>>
>> int main(int argc, char *argv[])
>> {
>> QGuiApplication app(argc, argv);
>>
>> QtQuick2ApplicationViewer viewer;
>> viewer.setMainQmlFile(QStringLiteral("qml/SimpleRotator/main.qml"));
>> viewer.showExpanded();
>>
>> return app.exec();
>> }
>>
>> I am new to Qt, so perhaps I am doing something wrong with my animation,
>> but I have tried a couple other methods of animating and they all lag
>> equally badly. The PC I develop on is quite a monster, so if it is lagging
>> on this, I hate to think what it's going to do on my clients' laptops.
>>
>> Anyone have any ideas?
>>
>> Regards
>> Michael
>>
>> _______________________________________________
>> 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/20130411/2099eb07/attachment.html>
More information about the Interest
mailing list