Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] XFCE4 and font setup for Qt5 application
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
leonid
n00b
n00b


Joined: 23 May 2003
Posts: 15
Location: Moscow Russia

PostPosted: Sun Oct 25, 2015 5:51 pm    Post subject: [SOLVED] XFCE4 and font setup for Qt5 application Reply with quote

Hello!

After upgrade my qt-creator was up to 3.x, so it is build with Qt5. But fonts in it (menus and dialogs) is differ than in other apps (Qt4 and gtk for example). QtConfig program does not work with Qt5.

How could I setup fonts for Qt5?
_________________
Leonid Kolesnik


Last edited by leonid on Fri Jun 23, 2017 7:27 am; edited 3 times in total
Back to top
View user's profile Send private message
SpaceToast
n00b
n00b


Joined: 16 Oct 2015
Posts: 19

PostPosted: Tue Nov 17, 2015 12:08 pm    Post subject: Reply with quote

Qt5 does not ship with qtconfig, and rather decides what to do based on the desktop environment you are using.

This is the behavior:

  • Under Plasma 5: use selected Qt style (systemsettings5)
  • Under KDE4: Oxygen (if available), then Fusion
  • Cinnamon, Gnome, MATE, LXDE, Xfce: GTK+ (QGtkStyle)
  • Other: Fusion


You can change what it detects by exporting QT_QPA_PLATFORMTHEME in your profile.
You could add USE=gtkstyle to qtgui, rebuild it, export QT_QPA_PLATFORMTHEME to gtk, and it'll then mimic your GTK config.

There is also apparently a tool named qt5ct which mimics qtconfig, but for qt5 (required to export QT_QPA_PLATFORMTHEME to qt5ct). This is however not in-tree, but you are free to experiment with it.
Back to top
View user's profile Send private message
leonid
n00b
n00b


Joined: 23 May 2003
Posts: 15
Location: Moscow Russia

PostPosted: Thu Nov 24, 2016 1:37 pm    Post subject: Reply with quote

I reopen this topic as no decision found for one year.

It was acceptable while there was not many apps with qt5. But now its count increases.

So, one more time:

I use XFCE 4.12
I have some apps using qt (qt-creator (uses qt5), clementine (uses qt4) and others) and some apps from KDE (okular, for example).

qtgui installed with gtkstyle flag enabled.
QT_QPA_PLATFORMTHEME=gtk (in /etc/inveronment)

BUT:

1. Fonts in XFCE apps is ok
2. Fonts in qt4 and KDE apps is ok and the same as in XFCE apps
3. Fonts in qt5 apps is different and ugly.

No working answers in net found.

My example at screenshot:
https://www.modbus4qt.ru/download/external/img.png

Qt creator is one qt5 apps.
_________________
Leonid Kolesnik
Back to top
View user's profile Send private message
leonid
n00b
n00b


Joined: 23 May 2003
Posts: 15
Location: Moscow Russia

PostPosted: Thu Nov 24, 2016 1:52 pm    Post subject: Reply with quote

Discovering...

When I changed font in XFCE control panel it was changed and in qt5 apps.

So it is different rendering only

PS And qt5ct has no effect for me. Or I do something wrong.
_________________
Leonid Kolesnik
Back to top
View user's profile Send private message
mir3x
Guru
Guru


Joined: 02 Jun 2012
Posts: 455

PostPosted: Sat Nov 26, 2016 10:05 pm    Post subject: Reply with quote

You could in theory install lxqt, configure fonts, theme and rest.

Then export environment variable QT_QPA_PLATFORMTHEME=lxqt in your xfce.
( then u might remove all lxqt packages except lxqt-qtplugin)
EIDT: u sure its export QT_QPA_PLATFORMTHEME=gtk
and not export QT_QPA_PLATFORMTHEME=gtk2 ??
_________________
Sent from Windows
Back to top
View user's profile Send private message
leonid
n00b
n00b


Joined: 23 May 2003
Posts: 15
Location: Moscow Russia

PostPosted: Mon Nov 28, 2016 3:24 pm    Post subject: Reply with quote

Sure.

I'll try use lxqt
_________________
Leonid Kolesnik
Back to top
View user's profile Send private message
leonid
n00b
n00b


Joined: 23 May 2003
Posts: 15
Location: Moscow Russia

PostPosted: Thu Dec 01, 2016 6:22 am    Post subject: Reply with quote

It uses gtk style. But it looks like is does not use fontconfig.
_________________
Leonid Kolesnik
Back to top
View user's profile Send private message
leonid
n00b
n00b


Joined: 23 May 2003
Posts: 15
Location: Moscow Russia

PostPosted: Fri Jun 23, 2017 7:30 am    Post subject: Reply with quote

The problem was in droid fonts. When I've selected any other fonts all became good.

For now for result:

1. USE flag for qtqui & qtwidgets: gtkstyle
2. QT_QPA_PKATFORMTHEME=gtk in /etc/invironment
3. Set up ubuntu font for default in XFCE settings

Fot Qt4 apps setup ubuntu font in Qt4 configuration tool

Thats all.
_________________
Leonid Kolesnik
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum