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. #5
    Join Date
    Jul 2020
    Posts
    3
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

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

    Quote Originally Posted by ChrisW67 View Post
    The mouse move event handler may be called hundreds or thousands of times during a finger drag. The mouse handler should inspect the event and record the rectangle you intend to draw in a member variable. Call update() only if it changes materially. The mouse move event handler should not draw anything: that is the exclusive domain of the paintEvent()/paintGL().

    If you want specific advice then post actual code that behaves poorly.

    Do any of the Qt demo/example OpenGL programs behave poorly?
    Thanks. Everything is correct. I don't draw anything in the mouse handler and I don't need a static image on screen. I plan to draw a jog wheel for my synth app. My jog is simple rect lines (about 46 lines width: 70px, height: 2px) When moving my finger on a iPad screen this lines should move behind the finger with great precision + = 0.5f by the Y coordinate.

    So in the mouse handler, I tell the graphics context to redraw this lines. Because the position of rect/line changes each time user drag the finger. So YES I need it to be called hundreds or thousands of times. If the calling "update" from mouse handler is bad way, then how to tell graphic card to redraw my code from paintEvent method? The position of all lines is depend on the position of the finger on the screen.

    And yes, unfortunately in the DEMO I see the same CPU/GPU load. And in the xcode profiler this load is critical. Especially on the graphics card. BTW I don't see this critical load with Flutter framework or with native Apple's CALayer.

    But as I said above, I have not written any line of code. A regular timer that refreshes the context every 60frames/per second, on an empty widget, again... without a single line of code, shows a heavy load on the processor and video card. It's empty widget, why such a load?
    Last edited by vitaliynet; 20th July 2020 at 20:45.

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.