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. [Solved]QML Var
Forum Updated to NodeBB v4.3 + New Features

[Solved]QML Var

Scheduled Pinned Locked Moved QML and Qt Quick
8 Posts 3 Posters 2.5k Views 1 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.
  • O Offline
    O Offline
    onek24
    wrote on last edited by
    #1

    I havn't found a good documentation about vars yet. Is there any documentation that describes functions like push(), reduce() and so on... ?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Yes. Just search for "QML basic types".

      Variant exists in QtQuick 1 ("link":http://qt-project.org/doc/qt-4.8/qml-variant.html).

      QtQuick 2 introduces a better equivalent called var ("link":http://qt-project.org/doc/qt-5.0/qtqml/qml-var.html).

      (Z(:^

      1 Reply Last reply
      0
      • O Offline
        O Offline
        onek24
        wrote on last edited by
        #3

        Yes but i can't see any documentation about it's functions, that's what i am searching. For example push(), .reduce(), ... .

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          There are no functions. It is a JS variable: it can contain any objects.

          (Z(:^

          1 Reply Last reply
          0
          • V Offline
            V Offline
            Vincent007
            wrote on last edited by
            #5

            Note that, you should use "var" instead of "variant".

            "QML Basic Type: var":http://qt-project.org/doc/qt-5/qml-var.html

            (sorry, I hadn't seen sierdzio's replies when I replied)

            1 Reply Last reply
            0
            • O Offline
              O Offline
              onek24
              wrote on last edited by
              #6

              Well i am using it as an array and it looks like it has some methods.
              @property var test: []
              function testFunction(){
              test.concat()
              test.filter()
              test.splice()
              }@

              1 Reply Last reply
              0
              • sierdzioS Offline
                sierdzioS Offline
                sierdzio
                Moderators
                wrote on last edited by
                #7

                Then you should search for JavaScript array documentation, not "var" docs. "Link":http://www.w3schools.com/jsref/jsref_obj_array.asp.

                (Z(:^

                1 Reply Last reply
                0
                • O Offline
                  O Offline
                  onek24
                  wrote on last edited by
                  #8

                  Yes that is what i was searching for, thank you.

                  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