Skip to content
  • QTimer is very inaccurate

    Unsolved Qt for MCUs
    31
    0 Votes
    31 Posts
    3k Views
    P

    @jsulm, @JonB
    Hello Both,

    I found the reason for high CPU load.

    Background:
    We have our own devices and I'm working on creating user Interfaces on the display of our device. We have many qml files to create some objects which needs to displayed on the device.

    We have a Software Tool which draws the objects on the PC using qml Files as per the user settings(like the size, position of the object on the display etc..). Then the objects are downloaded into our device.

    Root cause for High Cpu Load, Inaccuracy of QTimer:
    As a part of the objects that are created and downloaded from PC to the device, there is a ".gif(AnimatedImage)" object also.
    We are setting the "playing" property of this qml object to "true". So, this object is causing high CPU load even though the page in which this object is present is made invisible(i.e "visible" property is changed to false). This is the reason also for the inaccuracy of the QTimer as AnimatedImage is consuming lot of CPU time and Qtimer is not triggered at the right time.

    When I binded the "playing" property of "AnimatedImage" object with its "visible" property, the cpu load is very much reduced(from around 100% to around 15%). Only when I open the page which has "AnimatedImage" object, the cpu load is increasing back to around 100%.

    Questions:

    Any idea why "AnimatedImage" is causing such a high cpu load. Any CPU intensive operations are done by QT which are specific to AnimatedImages? The "cache" property of the "AnimatedImage" is false in high CPU load scenario. But if I change "cache" to true and open the page with "AnimatedImage", cpu usage is around 35%( but it was more than 100% when "cache" is false). How "cache" property is affecting the cpu usage of "AnimatedImage"?

    Thanks in Advance.

  • 0 Votes
    2 Posts
    646 Views
    M

    I just saw that a QNetworkReply::TimeoutError code exists. Shouldn't this code be set when a timeout occurred ? Is this a bug or did I misunderstand something ?

  • 0 Votes
    5 Posts
    557 Views
    WilliamJW

    Thank you Christian!

    https://bugreports.qt.io/browse/QTBUG-88063 describes exactly what I've been seeing.

  • 0 Votes
    3 Posts
    756 Views
    T

    @JonB Thank you!

  • 0 Votes
    5 Posts
    1k Views
    BartoszPajB

    Process still block, when I lost connection.

  • QWebSocket open timeout

    Unsolved General and Desktop
    2
    0 Votes
    2 Posts
    3k Views
    Ni.SumiN

    @mistralegna

    AFAIK,

    You can set bool QAbstractSocket::isValid() const on the given address provided. you can also get error signal from the websocket, if it is not valid address. void QAbstractSocket::error(QAbstractSocket::SocketError socketError). check here .

    But , the isvlaid() is not very efficient like in your case WS:// instead of WSS://. Because to my knowledge isValid() says true to any address , if it is inform of address/standard way of address. In your cases, I prefer to use Regular Expression before connection to socket.

  • 0 Votes
    5 Posts
    5k Views
    S

    mysql_options called with MYSQL_OPT_CONNECT_TIMEOUT returns 0 (success) both for mysql and mariadb libraries.