Change Qt5 application style with qt5ct

Qt is one of the most used toolkit to create cross platform GUI applications. It runs on wide range of hardware platform from embedded devices to modern PC without significant change in the main code.

Qt5 is the latest Qt version, now Qt5 is the de facto standard of  Qt based application development, so many Qt4 based applications also ported to Qt5.Qt5ct qt5 configuration tool

Qt4 based application style could be changed easily by qtconfig-qt4 tool, even by editing the Trolltech.conf file, but there is no such utility to change Qt5 theme, change qt5 widget style or fonts style.

It’s easy to manage Qt5 application style in Qt integrated desktop like KDE, LXQt or Razor-Qt. But a little harder in other desktop like GNOME, Cinnamon, MATE, XFCE or LXDE.

So qt5ct is here to solve the problem, you could use qt5ct to change Qt5 based application style, Qt5 icon theme, Qt5 font style. Even customize the whole widget style with custom Qt style sheet, the qss files.

Qt5ct could use qt5 gtk theme, KDE breeze theme, the fusion theme, QtCurve theme and many more. Each style could be customized further by changing the color schema.


Installing qt5ct

Qt5ct is not available as official binary package in mainline GNU/Linux distributions, but archlinux have a AUR package for it and Ubuntu have a PPA for qt5ct. So if you are running Ubuntu or any Ubuntu derivative like Linux Mint etc. etc. you could install it from the PPA.

It’s possible to compile it from source, the qt5ct latest source code is available at sourceforge, grab the letest release from there.

I’m here going to install it from source on a Debian testing system. So this compilation guide will be almost same for any Debian derivative including Ubuntu, Linux Mint, Kali Linux etc. etc.

  1. Installing build time dependencies and header files
    sudo apt-get install build-essential qt5-qmake qtchooser qtbase5-dev libqt5svg5-dev libpng12-dev qtbase5-dev-tools qttools5-dev-tools qtbase5-private-dev 
  2. Download the qt5ct source code from the above sorceforge, your download mirror could be different.
    wget -c 
  3. Now extract the archive and start building it.
    tar -xf qt5ct-0.21.tar.bz2
    cd qt5ct-0.21/ 
     QT_SELECT=5 qmake 
    make -j 4 
    sudo make install 

Now installation is finished, give qt5ct a test run,

cd ~/qt5ct-0.21/


Qt5ct appearance settings >

qt5 change theme widget styleQt5ct Icon theme settnigs >

qt5 change icon theme


Testing and setting up qt5ct

To test some Qt5 application with qt5ct rub the application from the command line with the QT_QPA_PLATFORMTHEME environment variable. First run qt5ct and then start the Qt5 application of your choice

 QT_QPA_PLATFORMTHEME=qt5ct easypaint 

qt5 change theme icon with qt5ct

EasyPaint is a simple Qt5 based image editor. Now change widget style, font style, icon theme etc. etc. by the qt5ct tool. If it is working make it permanent by exporting the correct environment variable when starting a X11 session.

Crete a file 100-qt5ct under the /etc/X11/Xsession.d/ folder with your favorite text editor

 sudo nano /etc/X11/Xsession.d/101-qt 

and put the configuration bellow there.


Now log out and log in again to take the changes effect.

I tested it on Debian stretch(testing), running standalone openbox, compton X11 compositor and some Qt only apps, qt5ct working very fine.


It’s straight forward to change Qt5 widget style, font style, icon theme with qt5ct. Hope very soon qt5ct will be available in the software repository of all mainline GNU/Linux distributions.

If you have any suggestion or question, just leave a comment, also don’t forget to share this with friends.

4 Responses

  1. ania says:

    it works ~/.xinitrc
    export QT_QPA_PLATFORMTHEME=qt5ct

  2. Arnab says:

    Yeah, you can export the environment variable from wherever you want 🙂

  3. John Griessen says:

    [email protected] [~]sudo apt-get install build-essential qt5-qmake qtchooser qtbase5-dev libqt5svg5-dev libpng12-dev qtbase5-dev-tools qttools5-dev-tools qtbase5-private-dev
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    libpng12-dev : Depends: libpng12-0 (= 1.2.50-2+deb8u2) but 1.2.54-4 is to be installed
    E: Unable to correct problems, you have held broken packages.

    • Arnab says:

      Hi John, thanks for pointing me out, yes I’m running Debian testing, and all packages are meaningful, also tested on Ubuntu 16.04 with qt5ct 0.24 .

      I’m done with Debian stable and it’s confusing dependency problem.

Leave a Reply

Your email address will not be published. Required fields are marked *