5

My long lasting previous installation somehow tied up VLC and gtk file dialog. I didn't even do anything special, except installing VLC.

After update to VLC 2.2.1 the file dialog was replaced to Qt and I don't see any obvious way how to get back with gtk. When I mark "vlc-qt" for deinstallation, entire vlc is marked for removal as well.

openSUSE 13.2

0
8

VLC media player has been using Qt interface for quite long time. VLC however, has an option to override window style, which will also change the file dialog as well.

In VLC media player, do the following steps:

  1. Go to Tools > Preferences (or press Ctrl+P)

  2. In the first tab, under Interface Settings - Look and feel, look for "Force window style:" with the drop-down menu and change selection from System's default to GTK+

  3. Finally, click Save to apply the changes.

Then, go to Media > Open File... (or press Ctrl+O) to confirm that the file dialog has been applied with GTK+ window style. That's all.

Tested with VLC 2.2.1 in Debian 8 Xfce (Xfce 4.10).

Force style for Qt5 in Debian/Ubuntu

Previously, for Debian 9 (testing) and Ubuntu 16.04 (xenial) and older, user had to additionally install libqt5libqgtk2 package from the repository. For newer releases, that is now provided by qt5-gtk-platformtheme or qt5-gtk2-platformtheme and either one will be installed automatically by recommends.

Tested with VLC 2.2.2 in Xubuntu 16.04 (Xfce 4.12). I did not test in Debian, but reportedly works according to this post on Ask Ubuntu. Later, I had observed that qt5-gtk-platformtheme package was installed by default for VLC 3.0.9 in Xubuntu 20.04.

Force style for Qt5 in other distributions

The package above is not available in repositories of other distributions, including openSUSE, according to this search result from software.opensuse.org. As an alternative, this Arch Wiki noted that QT_STYLE_OVERRIDE environment variable will force specific style to Qt applications.

Therefore, the line QT_STYLE_OVERRIDE=gtk2 or QT_STYLE_OVERRIDE=GTK+ may be added in one of the following locations:

Without installing the Qt5 package, I have tried export the line to each of above configuration files one at a time, except for the last one. However, none of these worked for VLC in Xubuntu 16.04.

At the moment, I can't verify whether the environment variable actually works or not.

6
  • 1
    Thank you, I already have such settings, but despite it VLC still uses Qt open dialog. Jun 14 '16 at 6:04
  • 1
    @greenoldman Updated my answer. I couldn't find what will actually work in other distributions to force style in Qt5 applications.
    – user125388
    Jun 18 '16 at 5:55
  • 2
    THANK YOU! Your last solution is setting the environment settings, so fast and dirty way to check it is to run QT_STYLE_OVERRIDE=GTK+ vlc and... it worked. So thank you very much for your help, I wish I could give you more points :-) Jun 18 '16 at 6:26
  • 1
    @greenoldman I tried again but failed to work in Xubuntu 16.04. I guess other distributions handle Qt5 differently from Debian/Ubuntu.
    – user125388
    Jun 18 '16 at 6:31
  • Thanks, man. I have installed libqt5libqgtk2 via Synaptic in Linux Mint Serena and after that the file open dialog in VLC looks really native. The old one didn't even allow to open media files from hard drives that were not mounted yet (but plugged) and it wasn't quite intuitive. Dec 29 '16 at 10:07
3

I would like to amend the accepted answer on how to get Qt to use the GTK+ theme (VLC now (2018) uses Qt5, so go by the second item).

  • Qt4 can use the current GTK2 theme. To activate this, simply choose GTK+ as the style for Qt4 in its configuration file ~/.config/Trolltech.conf (or using any graphical tool for configuring Qt4):

    [Qt]
    style=GTK+
    
  • Qt5 had support for GTK+ theming moved from the main package to a separate one. On ArchLinux, it is called qt5-styleplugins. Moreover, selecting the theme apparently goes by setting an environment variable, either QT_STYLE_OVERRIDE or QT_QAP_PLATFORMTHEME (both work for me), to gtk2 (notice this is gtk2, not GTK+). Adding this setting to any of the script files listed by the accepted answer will do the trick. I would personally argue in favor of ~/.xinitrc or similar, as this is related to the graphical environment.

    To sum up: on ArchLinux, install the package qt5-styleplugins, then launch your Qt5 application (VLC here) with QT_STYLE_OVERRIDE=gtk2 set in the environment.

Links: Arch Wiki on “Qt”, Arch Wiki on “Uniform look for Qt and GTK applications”.

0

Yes, things have changed, wrt the accepted answer "Force style for Qt5 in Debian/Ubuntu"

Initially I did not have a gtk option in the Force window style dropdown so tried to install libqt5libqgtk2 which reported:

Package libqt5libqgtk2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  qt5-gtk2-platformtheme

So install qt5-gtk2-platformtheme:

sudo apt-get update
sudo apt-get install qt5-gtk2-platformtheme

This gives you the gtk2 option in the Force window style dropdown. Select this and the VLC UI will change immediately. Tested the open file dialog too - looks much nicer

0

When you are using a recent VLC version (with Qt5) in an GTK+ environment, you can install qt5-styleplugins, and then edit the Exec line in

/usr/share/applications/vlc.desktop

to

Exec=env QT_QPA_PLATFORMTHEME=gtk2 /usr/bin/vlc --started-from-file %U

This way you don't need to look for a missing option in VLC. Other suggested solutions didn't help for me.

If you also want that VLC to use the GTK open file dialog when starting vlc on the command line, add the following to .bashrc:

export QT_QPA_PLATFORMTHEME=gtk2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.