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. [Solved] QGraphicsView very fast on Mac and XP, glacially slow on Linux
Qt 6.11 is out! See what's new in the release blog

[Solved] QGraphicsView very fast on Mac and XP, glacially slow on Linux

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 5.1k Views 1 Watching
  • 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
    tickranch
    wrote on last edited by
    #1

    I've developed an application using QGraphicsView, which renders map elements, using QGraphics[Ellipse,Polygon,Line]Item. There are 7500 items in the scene.

    On OS X and XP, the graphics application is very responsive. Scaling and zooming are quite snappy. However, on Linux the response is glacial. It can take a full minute after changing the scale to see the update. This has been verified on three separate Linux machines. All installations are using Qt 4.6.2.

    Any suggestions on why there would be such a discrepancy between platforms?

    Thanks,
    Charlie

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on last edited by
      #2

      Which graphics system are you using? X11 by any chance? If so then try using the raster graphics system. To do so start your app from the command line and pass in the the -graphicssystem raster option. e.g.:

      @
      ./myapp -graphicssystem raster
      @

      Does that help matters?

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 Reply Last reply
      0
      • D Offline
        D Offline
        danilocesar
        wrote on last edited by
        #3

        If ZapB's suggestion works, you can set the QGraphicsSystem on code by calling "this method":http://doc.trolltech.com/4.6/qapplication.html#setGraphicsSystem before instantiate your QApplication.

        <a href="http://www.danilocesar.com">Danilo Cesar Lemes de Paula</a>
        Software Engineer

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          ZapB
          wrote on last edited by
          #4

          Yep. You can also compile Qt such that raster is the default by configuring Qt with:

          @
          ./configure -graphicssystem raster <other options>
          @

          Nokia Certified Qt Specialist
          Interested in hearing about Qt related work

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tickranch
            wrote on last edited by
            #5

            Thanks for the tip! -graphicssytem raster did the trick. It really improved the performance.

            These are systems without direct rendering (one of them is a VMWare Fusion guest). When I do run on a system with dri supported, will I still want to use the raster graphics system?

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              ZapB
              wrote on last edited by
              #6

              It depends. Raster will give performance that mainly scales with CPU since it is entirely software based. The raster paint engine is still actively developed whereas the older X11 paint engine is not (and also has several bugs).

              If you are running on a system with hardware accelerated OpenGL support then you may be able to get even better performance by using a QGLWidget as the viewport for your QGraphicsView:

              @
              myView->setViewPort( new QGLWidget() );
              @

              Nokia Certified Qt Specialist
              Interested in hearing about Qt related work

              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