Results 1 to 2 of 2

Thread: PropertyAnimation : change property in each object individually

  1. #1
    Join Date
    Sep 2016
    Posts
    1
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Windows Android

    Default PropertyAnimation : change property in each object individually

    Hi,

    I'm trying to increase the y property in each object from the "targets" list:

    Qt Code:
    1. ParallelAnimation{
    2.  
    3. PropertyAnimation
    4. {
    5. target: 0.children[0];
    6. properties: "height";
    7. to:0.children[0].implicitHeight ;
    8. duration: 300
    9. }
    10. PropertyAnimation
    11. {
    12. targets: [1,2];
    13. properties: "y";
    14. to: y + 0.children[0].implicitHeight; //here I want to add the height of the gray square to 1.y and 2.y individually but it returns 0, button 1 and 2 overlap.
    15. duration: 300;
    16. }
    To copy to clipboard, switch view to plain text mode 

    This image shows what I want to achieve.

    232.jpg

    When I click on the button 0 the gray square shows up and in the same time button 1 and 2 go down.
    What is the best way to achieve this without adding new PropertyAnimation for each target button?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: PropertyAnimation : change property in each object individually

    You can simply animate a property that you add to some object and bind both targets' "y" to that property.

Similar Threads

  1. QML PropertyAnimation & StackView
    By scgrant327 in forum Qt Quick
    Replies: 8
    Last Post: 16th May 2016, 15:06
  2. Replies: 7
    Last Post: 11th January 2016, 13:01
  3. Access object property in JS
    By folibis in forum Qt Quick
    Replies: 1
    Last Post: 18th January 2014, 14:23
  4. change each separator's property
    By cic in forum Qt Programming
    Replies: 2
    Last Post: 3rd December 2013, 10:24
  5. Getting object's property...
    By gilamran in forum Newbie
    Replies: 1
    Last Post: 18th February 2011, 18:07

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.