
KCM Qt Graphics System
Source (link to git-repo or to original if based on someone elses unmodified work):
Please note that this requires Qt 4.7.0 or greater to work.
- 1.3 -
Fix script creation if $KDEHOME/env directory does not exist
- 1.2 -
Improve backend handling in non-X11 default cases by triggering a file write only if necessary and remove it if not
More internal documentation
Typo fixes by Alessandro Ghersi
- 1.1 -
Detect standard backend if Qt was compiled with anything but X11
Add helper application (build with -DBUILD_PROBER=ON) to check what the current backend is
- 1.0 -
Initial release
Ratings & Comments
32 Comments
https://apachelog.wordpress.com/2010/09/05/qt-graphics-system-kcm/#comment-467 real homepage with docu 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).
i'd like to install kcm but im clueless about howto compile/install the module. can someone please tell me or point to a resource where i can get it ? thanks. oh, btw i've kubuntu 10.10 64-bit
There is repos for OpenSUSE 11.2, 11.3, Factory and SLE 11-SP1: http://download.opensuse.org/repositories/home:/ZaWertun:/kde4/ (those, prefixed with "KDE_Distro_Factory_")
Sorry for wrong url: http://download.opensuse.org/repositories/home:/ZaWertun:/kde4/
Tested it on Slack-current and on a custom LFS install with Qt 4.7 rc compiled with OpenGL as the default backend. It works the best, despite its experimental status, in fact brilliantly. Love it! Thanks, Harald.
I installed 1.1 the way I installed 1.0, but I cannot see it in system settings... What's wrong?
Works just fine here, what does the output of your make install look like?
It looks like this: [ 0%] Built target kcm_qt_graphicssystem_automoc [ 41%] Built target kcm_qt_graphicssystem [100%] Built target qt-graphicssystem-prober Install the project... -- Install configuration: "RelWithDebInfo" -- Installing: /usr/local/lib/kde4/kcm_qt_graphicssystem.so -- Set runtime path of "/usr/local/lib/kde4/kcm_qt_graphicssystem.so" to "/usr/local/lib:/opt/qt-devel/lib" -- Installing: /usr/local/share/kde4/services/qt-graphicssystem.desktop -- Installing: /usr/local/bin/qt-graphicssystem-prober -- Set runtime path of "/usr/local/bin/qt-graphicssystem-prober" to "/usr/local/lib:/opt/qt-devel/lib"
/usr/local will almost certainly not be the right directory. You will need to install to the KDE search path (usually /usr), otherwise the desktop file will not be found and hence not show up anywhere.
OK, installed it to /usr, thanks. So let me get it straight. I have KDE 4.5.1 installed from Arch Linux repos which is built against Qt 4.6.3 I guess. As a result any selection I make in your app won't have any result at all with the applications from Arch Linux repos? A program must be built against 4.7.0 to have these settings applied to it?
Well, that depends partially on how the application was linked to the library. If dynamic, which is most likely for arch, then it only depends on whether Qt 4.7 is in the library search path and with higher priority than 4.6. Say you have a Qt 4.7 installation in /opt/qt47 and your regular Qt 4.6 in /usr. Then you export LD_LIBRARY_PATH to include /opt/qt47/lib and hence override the standard search path /usr/lib, then every dynamically linked Qt application started with that setup will use Qt 4.7 and the option will have effect. So it is more a question of runtime library loading rather than what an application was built against.
So, you say that if I export LD_LIBRARY_PATH=/opt/qt-devel/lib/$LD_LIBRARY_PATH in console, every new started application will be dynamically linked to qt-devel, hence using openGL as Qt Graphics System? Or I should override /usr/lib with another way? How can I do it so it will be permanent and all my applications use Qt 4.7? Thanks for your help and sorry for the many questions!
a) You would have to use : as seperator when exporting LD_LIBRARY_PATH b) Yes, generally when you do that all applications should load Qt 4.7 rather than the system one (that is: all apps that are not statically linked or have an rpath, I think rpath takes higher importance). c) You do not want to do this globally since it can hurt stability (if/where) Qt 4.7 is incompatible with 4.6 (e.g. apps that are linked against QtMultimedia would still load that from 4.6 since 4.7 doesnt have it anymore and in the end you would have an application that overall runs on 4.7 but som parts are 4.7 due to QtMultimedia -> that can cause serious trouble).
For me openGL works. Can you please explain what this does exactly? What are the benefits of using either of the three options provided?
Simply put: it will use another backend to render your applications. The backend basically is how widgets (i.e. buttons and textfields and icons etc.) are painted. And that how can either be a native toolkit choice, for example on Linux it will default to use the X11 API for that kind of stuff which will then take care of the actual processing. The raster engine is an own implementation of software rendering (which should be the same as X11 except that it is not as it mostly performs better). And OpenGL will, as the name suggests, directy all painting to the GPU. So, say you use OpenGL then every button, textfield, icon... in a Qt application will be painted via OpenGL in the GPU. GPUs being specifically tweaked for graphics of course will calculate that usually super fast. How the raster backend works is descirbed here: http://labs.trolltech.com/blogs/2009/12/18/qt-graphics-and-performance-the-raster-engine More information on OpenGL here: http://labs.trolltech.com/blogs/2010/01/06/qt-graphics-and-performance-opengl/ So, while the OpenGL backend is probably the least working one (with Linux graphics drivers not being that much piece of awesome) it ought to be the fastest one if working, since the GPU will almost always out-perform the CPU when it comes to graphics.
Thanks for the replies! So I have OpenGL chosen, does that mean that it works perfectly on my system with the openGL chosen? Is tehre a chance that it failed and is using a fallback even if it shows openGL enabled? My graphics card is nVidia GeForce 9500M GS and my graphics driver is nvidia 256.53-1. I'm using Arch Linux 64. What's the difference I should notice in performance? Faster drawing for example?
Generally apps should feel snappier. I think the best way to test i by adding a lot of plasma widgets and then draging them around wildly, resizing them etc. On a netbook for example the plasma-netbook application launcher ought to perform super fast with OpenGL. As far as I know there is no way to check what backend is in use. I do not think Qt will use a fallback though, if it breaks, it breaks. So as long as you have a recent enough Qt version (which ought to be 4.7 beta2 or above if I am not mistaken) it should be usign OpenGL if that is selected.
I have qt 4.6.3 installed but I have also qt-devel installed (which is alfready version 4.7 beta2) so I compiled your program by setting the environment variable to : PATH=/opt/qt-devel/bin/:$PATH . Is this right? Is it working this way?
You can probably build on Qt 4.5 even, but its setting will only have effect on Qt 4.7 applications.
Can someone please explain me how to install it? I never downloaded source files... :)
Ok, you should not choose OpenGL, its not a good idea ^^
yep... OpenGL makes kwin crash I think... and f*** all text rendering etc. up... not a good idea for the whole environment... some specific apps MAY SOMEDAY improve when using it... but not atm I think...
I don't know a stable distro that provides Qt 4.7.0.
mhm... openSUSE buildservice coming to my mind... they for sure have packages.. and on ArchLinux (rolling distro) you can build yourself a qt-git snapshot from the Arch user repository...