Since I haven’t found any proper debs of qgtkstyle around, I’m just going to tell how to compile it from source.
If you don’t know what Qgtkstyle is, Qgtkstyle is a Qt theme engine that uses your GTK theme directly.
First thing to do is to enable the Backports repository since you need Qt 4.4 which is in the Backports in Hardy. You can do this by going System→Administration→Software Sources, then going to the Updates tab and enabling the “Unsupported updates (hardy-backports)” repository.
Click Close and then click the Reload button when prompted. Now to install all the development packages needed to compile Qgtkstyle.
sudo apt-get install build-essential libqt4-dev libgtk2.0-dev subversion qt4-qtconfig
This is optional if you want to install with Checkinstall
sudo apt-get install checkinstall
Now to get the code
svn co svn://labs.trolltech.com/svn/styles/gtkstyle
There should be a folder in your home directory called gtkstyle. Now enter that directory
cd gtkstyle/
Now compile it
qmake qgtkstyle.pro
Now here you have a choice. You can either just install it directly with
sudo make install
Or you may like to build a deb out of it for easy removal later if need be. In that case do
sudo checkinstall
and follow the instructions. They’re pretty self explanitory.
Now if you go under System→Preferences→Qt 4 Settings you can choose GTK from the drop down menu.
Then do a File→Save and enjoy Qt applications with a nice GTK integration. 🙂
Also if you want to see a little Easter Egg move that preview window around. Yes you can actually move that. I won’t spoile the surprise. It gave me a little laugh when I first found it. 😉
Whenever I try
qmake qgtkstyle.pro
I getqgtkstyle.pro:10: Unknown replace function: qtLibraryTarget
Do you know how to fix this?
Hmm. I just check to see and it worked fine here. Are you sure you have all the development packages installed and the Backports enabled? If so then maybe try deleting the gtkstyle directory and re-check out the code again.
zmjjmz: you are using qmake from qt-3. Make sure you have Qt 4.4 installed. You might have to call “qmake-qt4” instead of just “qmake”.
Ok, using qmake-qt4 worked, but it when I try to compile it either through make or sudo make install, I get a load of errors.
In file included from main.cpp:24:
qgtkstyle.h:35: error: expected constructor, destructor, or type conversion before ‘typedef’
In file included from /usr/include/qt4/QtCore/qplugin.h:48,
from /usr/include/qt4/QtGui/qstyleplugin.h:47,
from /usr/include/qt4/QtGui/QStylePlugin:1,
from main.cpp:25:
/usr/include/qt4/QtCore/qpointer.h:51: error: expected constructor, destructor, or type conversion before ‘typedef’
make: *** [main.o] Error 1
Should I edit the source code in order to prevent this from happening? Is there anything I can do?
My best guess is that you are using Qt 4.3 at the moment. Try to run “qmake-qt4 –version” and see what that returns.
Yeah, it’s 4.3.4, in the Ubuntu repos.
I don’t think this is worth compiling Qt, but I understand that I won’t be able to do it until an update rolls along.
The Qt that comes with Hardy is too old. However 4.4 is in the Backports.
libqt4-core:
Installed: 4.4.0-1ubuntu5~hardy1
Candidate: 4.4.0-1ubuntu5~hardy1
Version table:
*** 4.4.0-1ubuntu5~hardy1 0
500 http://us.archive.ubuntu.com hardy-backports/main Packages
100 /var/lib/dpkg/status
4.3.4-0ubuntu3 0
500 http://us.archive.ubuntu.com hardy/main Packages
So I assume it will be there in Intrepid?
I can wait.
Martin Espinoza’s PPA has packages for both hardy and intrepid; it was last updated in July, though.
Hi, great tip! Thanks for share it 🙂
I installed it, all fine, but when i turn to GTK on QT4 Config, it gets a strange font with weird symbols, someone know how to fix it please?
Hi again, i solved the problem.
It was just a problem of compatibility with the Dingbats font i was using, i switched it to Bitstream Vera Sans on the system fonts and QT4 Config and all works fine now.
This is genius! Thanks for the guide!
Thanks for the guide 🙂
It also exists at PPAs:
https://launchpad.net/~soc-krg-nw/+archive
https://launchpad.net/~martin-espinoza/+archive
Is not there a replacement for Qt3 ?