Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Increase in memory when using QMetaObject::invokeMethod with qvarientlist
Forum Updated to NodeBB v4.3 + New Features

Increase in memory when using QMetaObject::invokeMethod with qvarientlist

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 563 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.
  • T Offline
    T Offline
    Tirupathi Korla
    wrote on last edited by
    #1

    Hi,
    I Have an application with table(which is in qml) which is updated every second from cpp file using QMetaObject::invokeMethod(). Each second a new qvarientlist is created and sent to qml file by using QMetaObject::invokeMethod(). I see an increase in memory. It is increasing continously and never decreasing. Could anyone give me a hint what i am missing.

    Thanks & Regards
    Tirupathi

    jsulmJ 1 Reply Last reply
    0
    • T Tirupathi Korla

      Hi,
      I Have an application with table(which is in qml) which is updated every second from cpp file using QMetaObject::invokeMethod(). Each second a new qvarientlist is created and sent to qml file by using QMetaObject::invokeMethod(). I see an increase in memory. It is increasing continously and never decreasing. Could anyone give me a hint what i am missing.

      Thanks & Regards
      Tirupathi

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Tirupathi-Korla Well, without seeing the code it is impossible to say why this happens...
      How do you create the list? Is the list destroyed at some point?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Tirupathi Korla
        wrote on last edited by Tirupathi Korla
        #3

        This is the function in cpp.

           void myClass:: callBack(QByteArray ary){
                    QVariantList reports;
                    reports.append("test:");
                    temp_report * t = ((temp_report*)(ary.data()));
                    QString str = t->value;
                    str.append(" $");
                    reports.append(str);
                    QMetaObject::invokeMethod(qmlRootObject, "callMoneyFunction",
                                              Q_ARG(QVariant, reports));
                    reports.clear();
                    ary.clear();
        }
        

        Below is qml code

                function callMoneyFunction(value){
                    var str = sourceModel.get(0).value;
                    sourceModel.remove(0)
                    sourceModel.insert(0,{"key": "Amount: "  + value[0],"value":str });
                }
        

        SourceModel is listmodel of tableview.

        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