Results 1 to 5 of 5

Thread: Huge performance hit using QPainter in QGLWidget on N900's Maemo

  1. #1
    Join Date
    May 2010
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Huge performance hit using QPainter in QGLWidget on N900's Maemo

    I have a huge performance problem when I'm using QPainter's drawRect function in a QGLWidget on Maemo on the Nokia N900. The FPS drops to ~2-3 and the device is completely unusable. The performance hit is quite strange, as it does not appear all the time, but just most of the times I run the application on the device. Other times it runs fine, with an FPS of ~40-50.

    The error is directly connected to the QPainter class, as I have a button in my application to activate the QPainter drawing of rectangles (used for menus and windows). Also, if I comment out the drawRect functions, but leave everything else as-is, it runs smoothly. QPainter's drawText function does run smoothly, however.

    Running the application in Ubuntu or on Windows does not show a performance hit at all (not even slightly), so this is strictly related to the Maemo device. The device is running the libqt4-maemo5-* libraries.

    Do you guys happen to know how I could try to debug this? I'm kind of stuck between wondering if there is something wrong with my mobile or Qt's drawRect-function - or my own code, of course.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Huge performance hit using QPainter in QGLWidget on N900's Maemo

    Could you post a minimal compilable example reproducing the problem?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    May 2010
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Huge performance hit using QPainter in QGLWidget on N900's Maemo

    I don't have a small example, but you could of course try to download the full source of our project and compile it yourself. There should be no other dependencies but Qt's.

    The project is hosted here:
    http://github.com/dragly/loose_cannon
    And here is a direct link to a zip-ball:
    http://github.com/dragly/loose_cannon/zipball/master

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Huge performance hit using QPainter in QGLWidget on N900's Maemo

    So where is the slowdown? The application runs for me at ~50fps all the time.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    May 2010
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Huge performance hit using QPainter in QGLWidget on N900's Maemo

    Quote Originally Posted by wysota View Post
    So where is the slowdown? The application runs for me at ~50fps all the time.
    Sorry, I forgot to mention that you have to remove
    Qt Code:
    1. #ifndef Q_WS_MAEMO_5
    To copy to clipboard, switch view to plain text mode 
    from glwidget.cpp's paintGL function to run it with the code that slows down the device. It was commented out so we could continue testing while trying to work out the UI problem. The ifndef is found here:
    http://github.com/dragly/loose_canno...t.cpp#L660-689

    The device should slow down if you hit the "Unit" or "Radar" keys to the right, but if it doesn't it might be something faulty with my device.

Similar Threads

  1. Improve performance QPainter
    By Programm3r in forum Qt Programming
    Replies: 2
    Last Post: 12th November 2009, 07:23
  2. Increase QPainter performance
    By travelan in forum Qt Programming
    Replies: 3
    Last Post: 3rd July 2009, 11:52
  3. Replies: 4
    Last Post: 7th May 2008, 00:01
  4. QGLWidget 2d painting performance
    By amnesiac in forum Qt Programming
    Replies: 15
    Last Post: 28th January 2008, 14:09
  5. Huge tableview low performance
    By semoser in forum Qt Programming
    Replies: 9
    Last Post: 9th November 2006, 17:58

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.