Results 1 to 5 of 5

Thread: [iOS] Why empty QOpenGLWidget update/repaint() uses about 20%-50% cpu?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2020
    Posts
    3
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Question [iOS] Why empty QOpenGLWidget update/repaint() uses about 20%-50% cpu?

    Hello
    I am new and just touch a the framework.

    Now in the QT I see the same thing but load is about 20%-50%.
    On iPhone 10 - 15-20% cpu load
    On iPad 13 inch Pro - 30-50% cpu load.

    Yes it's better with -O3. About 28-34% but wait.. it's just empty screen. Perhaps I'm doing something wrong? Or not called something before the initialisation? And the difference between repaint() and update() I not noticed at all. I want about 6-7% cpu, like the native iOS's setNeedDisplay() does it. But not sure what to do. Thanks.

    This is my code. BTW, about 6-8% uses mouseMoveEvent when I move the finger.


    Moreover, energy use is HIGH in the Xcode profiler avr: 83.4% GPU. It's really strange. I never saw this in any project. Always just: Low.


    Thank you!

    Qt Code:
    1. #include "mainwidget.h"
    2.  
    3. MainWidget::MainWidget(QOpenGLWidget *parent) : QOpenGLWidget(parent)
    4. {
    5.  
    6. }
    7.  
    8. MainWidget::~MainWidget() {
    9.  
    10. }
    11.  
    12.  
    13. void MainWidget::resizeEvent(QResizeEvent *e) {
    14. QOpenGLWidget::resizeEvent(e);
    15. }
    16.  
    17.  
    18. void MainWidget::mouseMoveEvent(QMouseEvent *e) {
    19. update();
    20. }
    21.  
    22. void MainWidget::paintGL()
    23. {
    24.  
    25. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by vitaliynet; 13th July 2020 at 22:28.

Similar Threads

  1. Replies: 3
    Last Post: 18th March 2014, 23:47
  2. repaint/update stops updating GUI
    By gokceng in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 28th November 2011, 14:35
  3. Replies: 4
    Last Post: 17th October 2010, 22:30
  4. Replies: 4
    Last Post: 10th June 2010, 21:25
  5. Use of repaint/update
    By Placido Currò in forum Qt Programming
    Replies: 3
    Last Post: 3rd April 2007, 19:24

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.