@BTSTOnline said in [QML Quick2 Form\.ui\.qml & Connections](/post/604707):
I have a AnimatedImage in Page1Form.ui.qml form.
I want to add a Connections link to catch the onFrameChanged signal.

If I add this to the ui.form, I get "invalidPropertyName" and cannot use the designer to finish working on the Form...

If I add it to the Page1.qml, I get the same error... and the signal is not activated.

What am I doing wrong?

Page1Form.ui.qml:

Qt Code:
  1. import QtQuick 2.14
  2. import QtQuick.Controls 2.14
  3. import QtQml 2.12
  4.  
  5. Page {
  6. id: splashPage
  7.  
  8. signal splashed(bool splashDone)
  9.  
  10. property alias splashPage: splashPage
  11. property alias animatedImage: animatedImage
  12.  
  13. Rectangle {
  14. id: rectangle
  15. anchors.fill: parent
  16. color: "#000000"
  17. }
  18.  
  19. AnimatedImage {
  20. id: animatedImage
  21. x: 0
  22. y: 0
  23. width: parent.width
  24. height: parent.height
  25. anchors.horizontalCenter: parent.horizontalCenter
  26. playing: true
  27. fillMode: Image.PreserveAspectFit
  28. source: "img/myAnimation.gif"
  29.  
  30. Text {
  31. id: loadingText
  32. x: 276
  33. y: 344
  34. color: "#ffffff"
  35. text: qsTr("...loading...")
  36. visible: false
  37. anchors.horizontalCenter: parent.horizontalCenter
  38. horizontalAlignment: Text.AlignHCenter
  39. font.pixelSize: 18
  40. }
  41. Connections {
  42. target: animatedImage
  43. onFrameChanged: {
  44. console.log("Frame: " + animatedImage.currentFrame)
  45. }
  46. }
  47. }
  48. }
  49.  
  50. /*##^##
  51.  Designer {
  52.   D{i:0;autoSize:true;height:480;width:640}
  53.  }
  54.  ##^##*/
To copy to clipboard, switch view to plain text mode 

Page1.qml:

Qt Code:
  1. import QtQuick 2.14
  2. import QtQuick.Controls 2.14
  3. import QtQml 2.12
  4.  
  5. Page1Form {
  6. Timer {
  7. id: splashTimer
  8. interval: 500
  9. running: false
  10. repeat: false
  11. onTriggered: {
  12. mainWin.showLoginOptions();
  13. }
  14. }
  15. // Connections {
  16. // target: animatedImage
  17. // onFrameChanged: {
  18. // //console.log("Frame: " + animatedImage.currentFrame)
  19. // if (animatedImage.currentFrame === animatedImage.frameCount - 1) {
  20. // animatedImage.playing = false
  21.  
  22. // animatedImage.width = animatedImage.width * .5
  23. // animatedImage.height = animatedImage.height * .5
  24. // animatedImage.top = splashPage.top
  25.  
  26. // splashTimer.start()
  27. // //splashed(true)
  28. // }
  29. // }
  30. // }
  31. }
To copy to clipboard, switch view to plain text mode