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
This entry was posted in kde, kubuntu, opensuse, qt, ubuntu. Bookmark the permalink.

47 Responses to Qt Graphics System KCM

  1. spacejunky says:

    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. Bender says:

    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. Jason says:

    I compile qt with raster as the default. The kcm should detect this and not declare X11 to be the default.

  4. friesoft says:

    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?

  5. d2kx says:

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

    <3

    • Andreas says:

      > 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.

  6. Thiago Maciiera says:

    Everything works on Raster. The above comment is just non-sense.

  7. telespallabob says:

    ok, sorry to ask, I’m a noob – literally: how do I install this? thanks!

    • apachelogger says:

      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

      • telespallabob says:

        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.

      • apachelogger says:

        You could use the search filed in system settings ;) (upper right corner, enter something like “qt graphics” … it should grey out everything but that KCM)

      • apachelogger says:

        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 :) )

      • Devrieze says:

        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?

        • Devrieze says:

          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.

  8. Fabien says:

    Sorry this is off-topic, but what’s your desktop wallpaper? it looks great :-)

  9. Andrew M says:

    This is cool. I have to use nvidia cards at work and (at least for my 7300) raster seems to work better.

  10. Clemens Eisserer says:

    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.

  11. Znurre says:

    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.

  12. Fri13 says:

    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?

    • apachelogger says:

      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.

  13. renoX says:

    Very nice, I think that once Qt 4.7 will be deployed, users with buggy OpenGL drivers will like a lot this feature!

  14. Beat Wolf says:

    Not totaly true for all GPUs, but in general.. sadly true.

  15. Jake says:

    I really like your colorful desktop wallpaper. Could you tell me, where you got it from? Thx.

  16. Stimpson J. Cat says:

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

    • friesoft says:

      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

      • Stimpson J. Cat says:

        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

  17. Dirk says:

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

    Awesome, thanks!

  18. 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.

  19. lelamal says:

    > 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!

  20. 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 )

Connecting to %s