My thoughts on Slackware, life and everything

Tag: qt4

New package for qbittorrent, now based on Qt5

Not related per se to the fall-out of last weekend’s update to the icu4c and poppler packages, my qbittorrent package for slackware-current had stopped working sometime ago – caused by an update in -current of the boost package on which the torrent library depends.

I needed to update qbittorrent too therefore, after having taken care of the icu4c/poppler breakage. The thing is, I had tried to delay the switch in qbittorrent from Qt4 to Qt5 for as long as possible. The ‘new’ 4.x series of qbittorrent have a hard dependency on Qt5, and Qt4 is no longer supported. So I bit the bullet and made packages for bittorrent-4.0.4 and its dependency, libtorrent-rasterbar-1.1.6.
Since the program uses Qt5 now, the dependencies have changed. If you were running qbittorrent 3.x on slackware-current previously then you have to ensure that you have libxkbcommon, qt5 and qt5-webkit packages installed now.

For good times’ sake, I have kept the old SlackBuild scripts and sources but I renamed them to libtorrent-rasterbar10.SlackBuild and qbittorrent3.SlackBuild. If you want the old Qt4 based interface back, then compile the two packages using these SlackBuild scripts (first libtorrent-rasterbar, then qbittorrent). You can install either the new, or the old versions. They can not be co-installed.

Running VLC in XFCE

As you may know I am using KDE for my daily work. However, I use XFCE from time to time – for example when I have to run a remote X session over XDMCP and want to keep a fluid feel to the desktop.

When I was working in XFCE yesterday I wanted to use VLC to check a video file on my computer, and I was in for a surprise when clicking “Media > Open file” made my VLC hang indefinitely!

I remembered a discussion about this phenomenon on LinuxQuestions.org and indeed the solution as pointed out in that thread works for me.

What happens here?

The core of the issue, is that Qt4 makes an incorrect assumption about which GTK+ theme engine to use. A GTK+ theme engine makes a Qt4 application blend in nicely with a GTK+ based desktop environment such as XFCE, by using GTK+ instead of Qt4 to render all graphical components.

There are a few GTK+ theme engines available – one of them is QGtkStyle which is part of Qt4 in Slackware. However, Qt4 libraries look at the environment variable “GTK2_RC_FILES” in order to find out how to configure the GTK theme engine.

If this environment variable is not (or incorrectly) set, then Qt4 assumes that GTK+ is using GTK-QT-Engine which is not part of Slackware (GTK-QT-Engine is used to give GTK appplications a Qt feel when they are running in KDE) and it will not correctly apply the QGtkStyle engine. It sets QGtkStyle to use the GTK style Clearlooks, and outputs an error message which you will sometimes be able to see if you started a Qt-based application from a terminal:

QGtkStyle cannot be used together with the GTK_Qt engine.

This can be solved by explicitly telling Qt4 where Slackware keeps its GTK+ configuration files, and then making sure a GTK+ theme is configured there.

  • Define the environment variable “GTK2_RC_FILES” in one of these files: ${HOME}/.xinitrc (applies to just you) or in /etc/profile.d/qt4.sh (applies system-wide) by adding the follwing two lines to that file (assuming you are using bash as your default shell):
    GTK2_RC_FILES="$HOME/.gtkrc-2.0:/etc/gtk-2.0/gtkrc"
    export GTK2_RC_FILES
  • Create a new file (or edit the existing) ${HOME}/.gtkrc-2.0 (so that the GTK theme applies to just you) or /etc/gtk-2.0/gtkrc (so that it applies system-wide) and add the following line to it:
    gtk-theme-name="GTK+"

That should fix VLC’s “Media > File Open” dialog which will now appear instantly.

Note: You can choose a GTK+ theme for all your QT4 based applications if you want by running “qtconfig” and in the tab “Appearance” set the “Select GUI Style” to “GTK+” instead of “Desktop Settings (default)“.

Eric

GTK2_RC_FILES

© 2024 Alien Pastures

Theme by Anders NorenUp ↑