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. Clear an Array? how to clear array

Clear an Array? how to clear array

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

    i have an array that should be cleared if any number inside is not greater than 300.

    I have a device that sends data continuously to the QT GUI. And the array records them continuously into it.
    And i start my project if any of number greater than 300 comes.

    So array size becomes larger than array limit as time goes by and stopped working appears so i should do force stop.

    so need to clear the array if any number inside the array is not greater than 300.

    (i can not record data into array after number greater than 300 appears by some issue..........do not offer me that.)

    tool++;
    wave12[tool]=ps[0];

    Just i need to know how to clear or resize or reinitialize or any other thing that make it empty or .......

    any example please?

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi,

      What is your array type? If you use QVector, call QVector::clear()

      http://qt-project.org/doc/qt-5/qvector.html#clear (read the whole page to learn how to use QVector)

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sanchir Kartiev
        wrote on last edited by
        #3

        Dynamic array is from STL or Qt?

        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