Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Reset a QML property from Javascript
Forum Updated to NodeBB v4.3 + New Features

Reset a QML property from Javascript

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 3 Posters 510 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    EddieC
    wrote on last edited by EddieC
    #1

    Is there a way to reset a property in QML from Javascript? Apparently the way to reset a property in QML is to assign undefined to it, but attempting to do it from Javascript is resulting in type errors ("can't assign undefined to int", "can't assign undefined to double"). I've also tried null with the same results.

    raven-worxR 1 Reply Last reply
    0
    • MarkkyboyM Offline
      MarkkyboyM Offline
      Markkyboy
      wrote on last edited by
      #2

      @EddieC said in Reset a QML property from Javascript:

      reset a property in QML

      https://doc.qt.io/archives/qt-5.9/qml-qtquick-propertychanges.html

      Don't just sit there standing around, pick up a shovel and sweep up!

      I live by the sea, not in it.

      E 1 Reply Last reply
      0
      • MarkkyboyM Markkyboy

        @EddieC said in Reset a QML property from Javascript:

        reset a property in QML

        https://doc.qt.io/archives/qt-5.9/qml-qtquick-propertychanges.html

        E Offline
        E Offline
        EddieC
        wrote on last edited by
        #3

        @Markkyboy said in Reset a QML property from Javascript:

        https://doc.qt.io/archives/qt-5.9/qml-qtquick-propertychanges.html

        So, the only way would be to create a dummy state with the PropertyChange and to activate the state? No way to act directly on the property?

        1 Reply Last reply
        0
        • E EddieC

          Is there a way to reset a property in QML from Javascript? Apparently the way to reset a property in QML is to assign undefined to it, but attempting to do it from Javascript is resulting in type errors ("can't assign undefined to int", "can't assign undefined to double"). I've also tried null with the same results.

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @EddieC
          on what properties did you try it exactly?
          maybe the property does not have a reset method defined?

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved