[Qt-qml] Antwort: Re: Custom transform origin point during rotation

Matthias Feldweg matthias.feldweg at e-gits.com
Wed Dec 21 16:07:09 CET 2011


Hi Dietrich,

you can add a NumberAnimation on the "angle" property of the rotation:

Image{

        anchors.centerIn: parent

        source: "qt-logo.png"

        transform: Rotation {

            id: myRot

        }

        SequentialAnimation {

            running: true

            loops: Animation.Infinite

            PropertyAction { target: myRot; property: "origin.x"; value: 0 }

            PropertyAction { target: myRot; property: "origin.y"; value: 0 }

            NumberAnimation { target: myRot; property: "angle"; to: 180; duration: 2000}

            PropertyAction { target: myRot; property: "origin.x"; value: 40 }

            PropertyAction { target: myRot; property: "origin.y"; value: 40 }

            NumberAnimation { target: myRot; property: "angle"; to: 0; duration: 2000}

        }

    }


Mit freundlichen Grüßen / Kind regards 

Matthias Feldweg 
http://www.e-gits.com



Am 21.12.2011 15:42, schrieb Dietrich.Gossen at continental-corporation.com:
> Hi Matthias,
>
> how do I modify the angle in a sequential animation?
> Because this example transforms the image just once.
>
> Mit freundlichen Grüßen
>
> Dietrich Gossen
> Continental Engineering Services
>
> Rechnungsanschrift/Billing Address/Besucheradresse/Visitor Address:
> Continental Engineering Services GmbH
> Osterhofener Straße 17, 93055 Regensburg, Germany
> Postfach 10 09 43, 93009 Regensburg, Germany
>
> Telefon/Phone: +49 941 790-5681
> Telefax: +49 941 79099-6590
> E-Mail: dietrich.gossen at continental-corporation.com
> http://www.conti-engineering.com
> _____________________________________________
> Continental Engineering Services GmbH, Graf-Vollrath-Weg 6, D-60489 
> Frankfurt/Main
> Geschaeftsfuehrer/Managing Director: Bernd Neitzel, Dr. Stefan Stoelzl, 
> Dr. Jochen Weisse
> Sitz der Gesellschaft/Registered Office: Frankfurt 
> Registergericht/Registered Court: Amtsgericht Frankfurt HRB 76752
> _____________________________________________
> Proprietary and confidential. Distribution only by express authority of 
> Continental AG or its subsidiaries.
>
>
>
>
>
> Von:        Matthias Feldweg <matthias.feldweg at e-gits.com>
> An:        qt-qml at qt.nokia.com
> Datum:        21.12.2011 11:35
> Betreff:        Re: [Qt-qml] Custom transform origin point during
> rotation
> Gesendet von:      
>  qt-qml-bounces+dietrich.gossen=continental-corporation.com at qt.nokia.com
> ------------------------------------------------------------------------
>
>
>
> You can add a "QML Rotation Element" to the image transformation list
> see _http://doc.qt.nokia.com/4.7/qml-rotation.html_.
>
> Animate the properties of the rotation.
>
>      _Image_ <http://doc.qt.nokia.com/4.7-snapshot/qml-image.html>{
>         source: "pics/qt.png"
>         transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0;
> y: 1; z: 0 } angle: 18 }
>         smooth: true
>     }
>
>
>
>
>
> Am 21.12.2011 11:04, schrieb
> _Dietrich.Gossen at continental-corporation.com:_
> <mailto:Dietrich.Gossen at continental-corporation.com:>
> Hi,
>
> I am having problems to set a custom transform origin point and rotate
> an image around it.
> That’s how I do it now (without success):
>
> That’s the *definition of the image and the state*
> 1.        Image {
> 2.                       id: image1
> 3.                       smooth: true
> 4.                       source: "image1.png"
> 5.                   }
> 6.         
> 7.                   State {
> 8.                       name: "rotated"
> 9.                       PropertyChanges {
> 10.                           target: image1
> 11.                           transformOriginPoint: _Qt_
> <http://developer.qt.nokia.com/doc/Qt.html>.point(20, 40)
> 12.                       }
> 13.                   }
>
> That’s my *animation*—
> 1.        SequentialAnimation{
> 2.                   loops: Animation.Infinite
> 3.                   running: true
> 4.         
> 5.                   PropertyAction { target: image1; property:
> "transformOriginPoint" }
> 6.                    RotationAnimation { target: image1; to: 180;
> direction: RotationAnimation.Clockwise; duration: 2000}
> 7.         
> 8.                   PropertyAction { target: image1; property:
> "transformOriginPoint" }
> 9.                    RotationAnimation { target: image1; to: 0;
> direction: RotationAnimation.Counterclockwise; duration: 2000
> 10.               }
>
> I couldn’t find any example in the documentation about custom
> transform origin points.
>
> Thanks
>
>
> Mit freundlichen Grüßen
>
> Dietrich Gossen
> Continental Engineering Services
>
> Rechnungsanschrift/Billing Address/Besucheradresse/Visitor Address:
> Continental Engineering Services GmbH
> Osterhofener Straße 17, 93055 Regensburg, Germany
> Postfach 10 09 43, 93009 Regensburg, Germany
>
> Telefon/Phone: +49 941 790-5681
> Telefax: +49 941 79099-6590
> E-Mail: _dietrich.gossen at continental-corporation.com_
> <mailto:dietrich.gossen at continental-corporation.com>
>
> _http://www.conti-engineering.com_ <http://www.conti-engineering.com/>
> _____________________________________________
> Continental Engineering Services GmbH, Graf-Vollrath-Weg 6, D-60489
> Frankfurt/Main
> Geschaeftsfuehrer/Managing Director: Bernd Neitzel, Dr. Stefan Stoelzl,
> Dr. Jochen Weisse
> Sitz der Gesellschaft/Registered Office: Frankfurt
> Registergericht/Registered Court: Amtsgericht Frankfurt HRB 76752
> _____________________________________________
> Proprietary and confidential. Distribution only by express authority of
> Continental AG or its subsidiaries.
>
>
>
>
> _______________________________________________
> Qt-qml mailing list
> _Qt-qml at qt.nokia.com_ <mailto:Qt-qml at qt.nokia.com>
> _http://lists.qt.nokia.com/mailman/listinfo/qt-qml_
>
>
>
> -- 
>
> Mit freundlichen Grüßen / Kind regards
>
> Matthias Feldweg
> Senior Software Engineer
>
> e-GITS GmbH
> Global IT Solutions
> Curiestrasse 2
> 70563 Stuttgart, Germany
>
> Phone +49 (0) 711.67.400.174
> Fax +49 (0) 711.67.400.469
>
> _______________________________________________________________
>
> Sitz der GmbH: Stuttgart, Amtsgericht Stuttgart HRB 23517
> Geschäftsführer: Sven Liess
> _______________________________________________________________
>
>
> Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
> Informationen. Wenn Sie nicht der richtige
> Adressat sind oder diese E-Mail irrtümlich erhalten
> haben, informieren Sie bitte sofort den Absender und vernichten Sie
> diese Mail. Das unerlaubte Kopieren sowie
> die unbefugte Weitergabe dieser Mail ist nicht gestattet.
>
> This e-mail may contain confidential and/or privileged information. If
> you are not the intended recipient (or
> have received this e-mail in error) please notify
> the sender immediately and destroy this e-mail. Any unauthorised
> copying, disclosure or distribution of the
> material in this e-mail is strictly
> forbidden._______________________________________________
> Qt-qml mailing list
> Qt-qml at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-qml
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20111221/b0f09ecd/attachment-0001.html 


More information about the Qt-qml mailing list