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 π
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!
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.
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?
I recommend
http://labs.trolltech.com/blogs/2008/10/22/so-long-and-thanks-for-the-blit/
and
http://labs.trolltech.com/blogs/2009/03/13/using-hardware-acceleration-for-graphics/
And in general Trolltech/Nokia blogs on the graphics system matter.
Simply put: usually raster is faster than X11 and OpenGL faster than raster. (OpenGL however requires appropriate driver support, and that is not always the case as we can see from desktop effects :S)
I compile qt with raster as the default. The kcm should detect this and not declare X11 to be the default.
Yes it should, the internal graphics system identifier is however not exposed by any public class, so currently that is impossible.
Should be detected properly in version 1.1.
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?
KWin’s desktop effects surely not use the Qt graphics system I’d expect.
KWin already does that since a year or so. It uses QApplication::setGraphicsSystem(“native”) which has higher priority than the QT_GRAPHICSSYSTEM environment variable.
Raster = uses the CPU, some advanced stuff won’t work
X11 = slow, leads to unjustified “KDE is sluggish” opinions
OpenGL = buggy
β€
> 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.
Everything works on Raster. The above comment is just non-sense.
ok, sorry to ask, I’m a noob – literally: how do I install this? thanks!
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
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.
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)
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 :))
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, please note the P.S. on https://apachelog.wordpress.com/2010/09/05/qt-graphics-system-kcm/#comment-467
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.
Sorry this is off-topic, but what’s your desktop wallpaper? it looks great π
http://kde-look.org/content/show.php/Light+and+line+Red+Blue?content=129669
This is cool. I have to use nvidia cards at work and (at least for my 7300) raster seems to work better.
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.
any concrete examples?
“fredrikh” might have some if you can find him on IRC.
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.
That depends on why the resizing is choppy π
It is certainly worth a try though.
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?
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.
Very nice, I think that once Qt 4.7 will be deployed, users with buggy OpenGL drivers will like a lot this feature!
Qt does not use OpenGL by default, so there is no gain from this unless your distribution compiled Qt with OpenGL as default backend π
Not totaly true for all GPUs, but in general.. sadly true.
I really like your colorful desktop wallpaper. Could you tell me, where you got it from? Thx.
please have a look at https://apachelog.wordpress.com/2010/09/05/qt-graphics-system-kcm/#comment-462
installed but the option dont appears anywhere, might be missing something after the installation (didnt got any error)
you need to run kbuildsycoca4 after install to have it show up in systemsettings – or wait until it’s executed by some other occasion π
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
Thanks to this little feature, my computer now runs significantly faster. You could even call it ‘snappy’ π
Awesome, thanks!
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.
export QT_GRAPHICSSYSTEM=
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?
Yep, wordpress ate my markup unfortunatelly ^^
> 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!
http://paste.ubuntu.com/490013/
Either you prefix the executable with ‘QT_GRAPHICSSYSTEM=native’ or you use ‘-graphicssystem native’ for Qt only applications, for KDE just use 2 instead of one dash.
Cool, thanks also for the examples! π
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?