Qt Graphics System KCM

Long we have waited for it. A way to set the Qt graphics system backend without recompiling Qt. In Qt 4.7 this is finally available.

You can configure the backend using the environment variable QT_GRAPHICSSYSTEM.

Now, since the topic of switching graphics backend in Qt is coming up now and then, I thought it would be a good idea to create a nice graphical interface. Actually I wanted something nicer to use for me personally :P

So I created a really simple KCM. You have 3 switches, of which two will write a .sh file to $HOME/.kde/env/. The content of this folder gets loaded at startup (via startkde), and that way you will globally end up with another graphics backend. That said, since the environment variable has lowest priority, it is still possible to override this on a per-application level (e.g. kolourpaint has problems with the raster backend I have been told).

Have fun!

About these ads

47 thoughts on “Qt Graphics System KCM”

  1. Usability-wise it would be good to have a bit more explanations what the (supposed) implications of the different settings are. Otherwise quite useful for some users I suppose.

  2. I am wondering, which backend is best? I once read that OpenGL is still considered experimental and that surprisingly raster (which is a software solution) is best. I haven’t read anything about X11/render performance, any thoughts?

  3. Nice work :) could come in handy for testing purposes…

    do you know of a way to explicitly set kwin to still use the default backend when setting for example OpenGL as backend?

    1. KWin already does that since a year or so. It uses QApplication::setGraphicsSystem(“native”) which has higher priority than the QT_GRAPHICSSYSTEM environment variable.

  4. Raster = uses the CPU, some advanced stuff won’t work
    X11 = slow, leads to unjustified “KDE is sluggish” opinions
    OpenGL = buggy
    <3

    1. > Raster = uses the CPU, some advanced stuff won’t work
      That is simply wrong. Raster is basically the “reference implementation”.
      Applications that require native on X11 all do things with other windows. Qt graphicssystems are of course not made for grabbing the contents of other windows and such things.

    1. download
      tar -xf kcm-qt-graphicssystem-1.0.tar.xz
      cd kcm-qt-graphicssystem-1.0
      mkdir build
      cd build
      cmake .. -DCMAKE_INSTALL_DIR=`kde4-config –prefix`
      make
      sudo make install

      1. Thanks! I had to install a bunch of dependencies, but in the end I managed in installing it without errors, it was quite instructive. I see from your screenshot it is supposed to be found in System Settings, but I swear I can’t find it there. Apart from keeping on clicking on each icon again and again, is there a quicker way to make it appear :)? Thanks in advance!

        P.S. Double dash before “prefix” turned into a single one.

      2. Oh, and as for having a quicker way to make it appear.

        You can start any KCM from konsole using the kcmshell4 tool.

        e.g.
        kcmshell4 qt-graphicssystem

        kcmshell4 –list spits out a list of all known kcms (that also got two dashes, just in case :))

      3. Hey, Thanks for the install instructions, but I am stuck at:
        cmake .. -DCMAKE_INSTALL_DIR=`kde4-config –prefix`
        This is the remark I get in my terminal:

        [devrieze@localhost build]$ cmake .. -DCMAKE_INSTALL_DIR=`kde4-config –prefix`
        kde4-config: Unexpected argument ‘–prefix’.
        kde4-config: Use –help to get a list of available command line options.
        bash: cmake: command not found

        Can you help me out?

        1. Hey, I tried it and it still doesn’t work for me:

          [devrieze@localhost build]$ cmake .. -DCMAKE_INSTALL_DIR=`kde4-config –prefix`
          bash: cmake: command not found
          [devrieze@localhost build]$ cmake .. -DCMAKE_INSTALL_DIR=`kde4-config ––prefix`
          kde4-config: Unexpected argument ‘––prefix’.

          I am truly a beginner, maybe I am doing something really basic wrong?

          I use PClinuxOS 2010.7 btw,

          Thanks for your reply.

  5. d2kx: However the X11 backend slowness is not X11′s fault, QT really tortures any hw accelerating 2D driver by doing things in a quite stupid way.

  6. Really cool. I’ll have to try this out later today.
    Could the raster backend give me better performance than the X11 one?
    Especially choppy resizing is a problem currently.

  7. I did not get for what we need this? Is this someway different than selecting from desktop effects does it use XRender or OpenGL?

    I have OpenGL software running at desktop and it works fine even when I dont have compositing enabled but 3D drivers enabled.

    Please explain for what features this will bring?

    1. Desktop effects are desktop effects, this is about the application content (i.e. the objects that make up an application, the buttons and labels and textfields…).
      Those objects can be “painted” using different backend technologies (just like with desktop effects you have opengl and xrender). Also as with desktop effects sometimes the defaults do not work perfectly on every system and some people desire to use an alternative backend. And those backends can be selected with that KCM.

  8. installed but the option dont appears anywhere, might be missing something after the installation (didnt got any error)

    1. you need to run kbuildsycoca4 after install to have it show up in systemsettings – or wait until it’s executed by some other occasion :P

      1. ok, the thing was that it is installed on /usr/local/ , had to move qt-graphicssystem.desktop and kcm_qt_graphicssystem.so from /usr/local/ to the /usr/ directory

        thx

  9. Thanks to this little feature, my computer now runs significantly faster. You could even call it ‘snappy’ :)

    Awesome, thanks!

  10. Is it possible for you to list the .sh script? Seems like it is easier just to add the .sh script than to go through all the hoops of compiling this little configuration programs.

      1. What should the name of the file be?

        I assume that the line above should be followed by the kind of graphics system you want to use and that this would be one of the following:

        native
        raster
        opengl

        Then just reboot and everything should work?

  11. > since the environment variable has lowest priority, it is still possible to override this on a per-application level

    Hi, what would be the proper command to start an application with default (X11), once switched to Raster? Many thanks in advance!

  12. Nice. Now plasma runs fast! I have a problematic ATI board, and with this tweak now bespin theme works faster and plasma no longer complains :-)

    Here OpenGL backend is bugged. There are any advantage in use OpenGL with Qt? Why not use something like XRender? Does Qt support XRender?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s