Results 1 to 9 of 9

Thread: QML PropertyAnimation & StackView

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: QML PropertyAnimation & StackView

    Aside from your insistance on using hacks to interact with C++ there are two observations:

    1) opacity is a value between 0 and 1, so 100 is a rather weird value
    2) where in the code do you set statusAnimationRunning to false after you had set it to true?

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    scgrant327 (13th May 2016)

  3. #2
    Join Date
    May 2011
    Posts
    81
    Thanks
    6
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Lightbulb Re: QML PropertyAnimation & StackView

    Quote Originally Posted by anda_skoa View Post
    Aside from your insistance on using hacks to interact with C++ there are two observations:
    I'm not using any 'hacks' for interacting with C++... it's all pure property binding now.

    Quote Originally Posted by anda_skoa View Post
    1) opacity is a value between 0 and 1, so 100 is a rather weird value
    Well, that does make some sense... but again... I've ALWAYS used 100 as the initial value, and it worked before StackView. Hmmmm. I'll make sure to use 1 instead of 100 and see if it appears different.

    Quote Originally Posted by anda_skoa View Post
    2) where in the code do you set statusAnimationRunning to false after you had set it to true?
    Ahhhh... you are correct. I never reset the 'running' flag.... Odd thing is, I have NEVER reset that flag to false. And this USED to work before I starting using StackView. I was assuming that the 'running' flag was auto-set to false once the animation was completed.

  4. #3
    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: QML PropertyAnimation & StackView

    Quote Originally Posted by scgrant327 View Post
    I'm not using any 'hacks' for interacting with C++... it's all pure property binding now.
    You wrote "The C++ code updates those variables and calls a function in main.qml", so I assumed you meant calling a QML function from C++.
    If you are no longer doing that hack you should be fine

    Quote Originally Posted by scgrant327 View Post
    Ahhhh... you are correct. I never reset the 'running' flag.... Odd thing is, I have NEVER reset that flag to false. And this USED to work before I starting using StackView. I was assuming that the 'running' flag was auto-set to false once the animation was completed.
    The animation's own state is probably false, but since your property never is false ever again, it never changes when your function sets it to true, so the binding doesn't get reevaluated.

    My suggestion would be to either reset the property in the animation's onStopped handler, or to remove the property and calling start() on the animation instead.

    Cheers,
    _

  5. #4
    Join Date
    May 2011
    Posts
    81
    Thanks
    6
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: QML PropertyAnimation & StackView

    I'll try resetting the property in the onStopped handler... As I'm not sure how to call the 'start' method on an animation that exists on a page loaded by the StackView...

  6. #5
    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: QML PropertyAnimation & StackView

    Quote Originally Posted by scgrant327 View Post
    As I'm not sure how to call the 'start' method on an animation that exists on a page loaded by the StackView...
    Right.
    Your main object could emit a signal and in the page element you could then use a Connection element to react to that.

    Like you most likely already handle the signal from C++ that triggers the call to gpsUpdate2() (assuming you have, as you claim, moved away from the hack of calling QML functions from C++).

    Cheers,
    _

  7. #6
    Join Date
    May 2011
    Posts
    81
    Thanks
    6
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: QML PropertyAnimation & StackView

    Thanks again Anda. Resetting via the onStopped handler worked perfectly.

    --Sam

Similar Threads

  1. interaction StackView / ListView
    By RegMe in forum Qt Quick
    Replies: 11
    Last Post: 18th January 2016, 19:06
  2. StackView get index or views page
    By KeineAhnung in forum Newbie
    Replies: 2
    Last Post: 18th November 2014, 22:03
  3. Any example of StackView?
    By stereoMatching in forum Qt Quick
    Replies: 1
    Last Post: 16th December 2013, 08: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
  •  
Qt is a trademark of The Qt Company.