Recent

Author Topic: Lazarus app cannot see the changed global Qt5 colors  (Read 786 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 1961
    • UVviewsoft
Lazarus app cannot see the changed global Qt5 colors
« on: September 02, 2022, 04:16:48 pm »
User wrote:

Quote
>I ran qt5ct (Qt5 Configuration Utility) and changed to a dark theme and applied. Restarted CudaText. It had no effect on the menu and task bar color selection.
>Since I'm not running a Qt based Window/Desktop manager I'm not really sure where else to change the Qt5 system wide settings.

Using XFCE4 on the following Linux distros:

    AlmaLinux 8
    AlmaLinux 9
    Fedora 36
    Archlinux
    Ubuntu 22.04

Here the 'menu' (TMainMenu) is mentioned, which is painted by Qt5 entirely. Why Lazarus app cannot use colors from Qt5ct?
« Last Edit: September 02, 2022, 04:20:53 pm by AlexTP »

zeljko

  • Hero Member
  • *****
  • Posts: 1340
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Lazarus app cannot see the changed global Qt5 colors
« Reply #1 on: September 02, 2022, 07:19:04 pm »
Maybe theme problem ?

AlexTP

  • Hero Member
  • *****
  • Posts: 1961
    • UVviewsoft
Re: Lazarus app cannot see the changed global Qt5 colors
« Reply #2 on: September 03, 2022, 10:16:05 am »
I tried and reproduced the problem on Ubuntu 20.04.
qt5ct suggests me to set env variable, I did it. On next start qt5ct did not complain anymore..

MarkMLl

  • Hero Member
  • *****
  • Posts: 5574
Re: Lazarus app cannot see the changed global Qt5 colors
« Reply #3 on: September 03, 2022, 10:27:50 am »
I tried and reproduced the problem on Ubuntu 20.04.
qt5ct suggests me to set env variable, I did it. On next start qt5ct did not complain anymore..

For the record, /what/ variable?

I've previously had problems with a Qt-based app on a Raspberry Pi which similarly turned out to be missing metrics and/or variables which should have been set by the Window Manager. It looks as though Qt is rather sensitive to this sort of thing.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

AlexTP

  • Hero Member
  • *****
  • Posts: 1961
    • UVviewsoft
Re: Lazarus app cannot see the changed global Qt5 colors
« Reply #4 on: September 03, 2022, 10:42:56 am »
Qt5ct complained about this variable, I set it to .bashrc
Code: Bash  [Select][+][-]
  1. QT_QPA_PLATFORMTHEME=qt5ct
  2. export QT_QPA_PLATFORMTHEME

zeljko

  • Hero Member
  • *****
  • Posts: 1340
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Lazarus app cannot see the changed global Qt5 colors
« Reply #5 on: September 03, 2022, 12:11:05 pm »
Does QT_QPA_PLATFORMTHEME fix problem with colors ? Also, you can try to start your app with -style qt5ct without setting env variable. That should work equally.

AlexTP

  • Hero Member
  • *****
  • Posts: 1961
    • UVviewsoft
Re: Lazarus app cannot see the changed global Qt5 colors
« Reply #6 on: September 03, 2022, 01:58:37 pm »
zeljko,
Running './cudatext -style qt5ct' shows correct dark menu! Cool.

Next start of CudaText w/o params also shows correct dark menu. It's OK now.

zeljko

  • Hero Member
  • *****
  • Posts: 1340
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Lazarus app cannot see the changed global Qt5 colors
« Reply #7 on: September 03, 2022, 03:39:53 pm »
Please try -style qt5ct without exported QT_QPA_PLATFORMTHEME

AlexTP

  • Hero Member
  • *****
  • Posts: 1961
    • UVviewsoft
Re: Lazarus app cannot see the changed global Qt5 colors
« Reply #8 on: September 03, 2022, 03:52:03 pm »
Removed 'export' of this var.

Code: [Select]
user@PC:~$ echo $QT_QPA_PLATFORMTHEME
appmenu-qt5

Now menubar lost dark theme. With and without '-style' param.

zeljko

  • Hero Member
  • *****
  • Posts: 1340
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Lazarus app cannot see the changed global Qt5 colors
« Reply #9 on: September 03, 2022, 08:45:41 pm »
Ok, so -style param is not solution, only env var export

zeljko

  • Hero Member
  • *****
  • Posts: 1340
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Lazarus app cannot see the changed global Qt5 colors
« Reply #10 on: September 04, 2022, 09:10:00 pm »
Instead of env variable QT_QPA_PLATFORMTHEME you can use -platformtheme qt5ct with Qt5 widgetset if it's better solution.

AlexTP

  • Hero Member
  • *****
  • Posts: 1961
    • UVviewsoft
Re: Lazarus app cannot see the changed global Qt5 colors
« Reply #11 on: September 04, 2022, 09:12:37 pm »
Ok, thanks for your help. no problem.

 

TinyPortal © 2005-2018