[Solved] QT5 | QT6 - Wayland Scaling (DPI)

Hello, always me :sweat_smile:

After setting up the whole system I still have open an issue that I can't figure out how to solve. It is about the scaling factor of the applications (telegram, qBitTorrent) that are based on QT.

The only 'similiar' thread I have found is this: Qt error block application running

My goal is to get those application follow the GTK rules, theme and scaling factor. Do you have any tip?!

Is there something I am missing? Or could the QT setting's theme broken? In the case, how could I reset it?

/etc/environment :

# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#
_JAVA_AWT_WM_NONREPARENTING=1
MOZ_ENABLE_WAYLAND=1 
XDG_SESSION_TYPE=wayland
EDITOR=/usr/bin/micro
BROWSER=firefox
TERM=alacritty
MAIL=thunderbird

QT_QPA_PLATFORM=wayland
QT_QPA_PLATFORMTHEME=qt6ct
QT_WAYLAND_FORCE_DPI=96
QT_QPA_PLATFORM=wayland
QT_SCALE_FACTOR=1
QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1

inxi :

System:
  Kernel: 5.16.13-zen1-1-zen x86_64 bits: 64 compiler: gcc v: 11.2.0
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=14d91570-f762-4106-889d-9a851d6dc02c rw [email protected]
    quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
    systemd.unified_cgroup_hierarchy=1
    resume=UUID=f1d4967a-02c4-4be4-be76-96ec8d6adaf1 loglevel=3
  Desktop: GNOME 41.4 tk: GTK 3.24.33 wm: gnome-shell dm: GDM 41.3
    Distro: Garuda Linux base: Arch Linux
Machine:
  Type: Desktop System: ASUS product: N/A v: N/A serial: <superuser required>
  Mobo: ASUSTeK model: PRIME Z690-A v: Rev 1.xx
    serial: <superuser required> UEFI: American Megatrends v: 1003
    date: 01/19/2022
Battery:
  Device-1: hidpp_battery_0 model: Logitech Wireless Mouse MX Master 3
    serial: <filter> charge: 10% (should be ignored) rechargeable: yes
    status: Discharging
CPU:
  Info: model: 12th Gen Intel Core i9-12900K bits: 64 type: MST AMCP
    arch: Alder Lake family: 6 model-id: 0x97 (151) stepping: 2 microcode: 0x18
  Topology: cpus: 1x cores: 16 mt: 8 tpc: 2 st: 8 threads: 24 smt: enabled
    cache: L1: 1.4 MiB desc: d-8x32 KiB, 8x48 KiB; i-8x32 KiB, 8x64 KiB
    L2: 14 MiB desc: 8x1.2 MiB, 2x2 MiB L3: 30 MiB desc: 1x30 MiB
  Speed (MHz): avg: 4497 high: 4994 min/max: 800/5200:3900 scaling:
    driver: intel_pstate governor: performance cores: 1: 4951 2: 4994 3: 4791
    4: 4917 5: 4900 6: 4900 7: 4866 8: 4900 9: 4900 10: 4911 11: 4892
    12: 4916 13: 4832 14: 4914 15: 4902 16: 4900 17: 3697 18: 3704 19: 3700
    20: 3705 21: 3698 22: 3689 23: 3666 24: 3698 bogomips: 152985
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2
    mitigation: Enhanced IBRS, IBPB: conditional, RSB filling
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: AMD Navi 24 [Radeon RX 6400 / 6500 XT] vendor: Sapphire PULSE
    driver: amdgpu v: kernel ports: active: DP-1 empty: HDMI-A-1
    bus-ID: 0000:03:00.0 chip-ID: 1002:743f class-ID: 0300
  Device-2: Generalplus GENERAL WEBCAM type: USB
    driver: snd-usb-audio,uvcvideo bus-ID: 1-2.2:4 chip-ID: 1b3f:2247
    class-ID: 0102 serial: <filter>
  Display: wayland server: X.org v: 1.21.1.3 with: Xwayland v: 22.1.0
    compositor: gnome-shell driver: X: loaded: nvidia unloaded: modesetting
    alternate: fbdev,nouveau,nv,vesa gpu: amdgpu display-ID: 0
  Monitor-1: DP-1 model: MSI MAG272CQR serial: <filter> built: 2020
    res: 2560x1440 dpi: 109 gamma: 1.2 size: 598x336mm (23.5x13.2")
    diag: 686mm (27") ratio: 16:9 modes: max: 2560x1440 min: 720x400
  OpenGL:
    renderer: AMD BEIGE_GOBY (DRM 3.44.0 5.16.13-zen1-1-zen LLVM 13.0.1)
    v: 4.6 Mesa 21.3.7 direct render: Yes
Audio:
  Device-1: Intel Alder Lake-S HD Audio vendor: ASUSTeK driver: snd_hda_intel
    v: kernel alternate: snd_sof_pci_intel_tgl bus-ID: 0000:00:1f.3
    chip-ID: 8086:7ad0 class-ID: 0403
  Device-2: AMD Navi 21 HDMI Audio [Radeon RX 6800/6800 XT / 6900 XT]
    driver: snd_hda_intel v: kernel bus-ID: 0000:03:00.1 chip-ID: 1002:ab28
    class-ID: 0403
  Device-3: Generalplus GENERAL WEBCAM type: USB
    driver: snd-usb-audio,uvcvideo bus-ID: 1-2.2:4 chip-ID: 1b3f:2247
    class-ID: 0102 serial: <filter>
  Device-4: Sennheiser USB-ED 01 type: USB
    driver: hid-generic,snd-usb-audio,usbhid bus-ID: 1-7:5 chip-ID: 1395:003c
    class-ID: 0300 serial: <filter>
  Sound Server-1: ALSA v: k5.16.13-zen1-1-zen running: yes
  Sound Server-2: PulseAudio v: 15.0 running: no
  Sound Server-3: PipeWire v: 0.3.48 running: yes
Network:
  Device-1: Intel Ethernet I225-V vendor: ASUSTeK driver: igc v: kernel
    port: N/A bus-ID: 0000:07:00.0 chip-ID: 8086:15f3 class-ID: 0200
  IF: enp7s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IF-ID-1: docker0 state: up speed: 10000 Mbps duplex: unknown
    mac: <filter>
  IF-ID-2: veth46f37f3 state: up speed: 10000 Mbps duplex: full
    mac: <filter>
RAID:
  Hardware-1: Intel Volume Management Device NVMe RAID Controller driver: vmd
    v: 0.6 port: N/A bus-ID: 0000:00:0e.0 chip-ID: 8086:467f rev:
    class-ID: 0104
Drives:
  Local Storage: total: 4.55 TiB used: 2.87 TiB (63.1%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Crucial model: CT1000P1SSD8
    size: 931.51 GiB block-size: physical: 512 B logical: 512 B
    speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter> rev: P3CR013
    temp: 31.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: Western Digital
    model: WD40EFAX-68JH4N0 size: 3.64 TiB block-size: physical: 4096 B
    logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 5400 serial: <filter>
    rev: 0A82 scheme: GPT
Partition:
  ID-1: / raw-size: 896.84 GiB size: 896.84 GiB (100.00%)
    used: 214.67 GiB (23.9%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 576 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 896.84 GiB size: 896.84 GiB (100.00%)
    used: 214.67 GiB (23.9%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-4: /var/log raw-size: 896.84 GiB size: 896.84 GiB (100.00%)
    used: 214.67 GiB (23.9%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-5: /var/tmp raw-size: 896.84 GiB size: 896.84 GiB (100.00%)
    used: 214.67 GiB (23.9%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 34.38 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/nvme0n1p3 maj-min: 259:3
  ID-2: swap-2 type: zram size: 31.1 GiB used: 2.2 MiB (0.0%) priority: 100
    dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 27.8 C mobo: N/A gpu: amdgpu temp: 41.0 C
    mem: 38.0 C
  Fan Speeds (RPM): N/A gpu: amdgpu fan: 0
Info:
  Processes: 482 Uptime: 12m wakeups: 2 Memory: 31.1 GiB
  used: 3.3 GiB (10.6%) Init: systemd v: 250 tool: systemctl Compilers:
  gcc: 11.2.0 clang: 13.0.1 Packages: pacman: 1433 lib: 455 Shell: fish
  v: 3.3.1 default: Bash v: 5.1.16 running-in: gnome-terminal inxi: 3.3.13
Garuda (2.5.5-1):
  System install date:     2021-11-03
  Last full system update: 2022-03-11
  Is partially upgraded:   No
  Relevant software:       NetworkManager
  Windows dual boot:       No/Undetected
  Snapshots:               Snapper
  Failed units:            

EDIT: Found a tricky solution on Manjaro forum

Editing the /etc/environment with those lines everything is back to normal

QT_AUTO_SCREEN_SCALE_FACTOR=1
# This line should make Qt apps use Wayland, according to Arch Wiki.
# Apparently this should be gnome according to Yochanan.
QT_QPA_PLATFORM=xcb
# For use with Kvantum themes
# QT_QPA_PLATFORMTHEME=qt5ct
# Pamac told me to add these:
QT_QPA_PLATFORMTHEME=gnome
QT_STYLE_OVERRIDE=kvantum
QT_AUTO_SCREEN_SCALE_FACTOR=1

Admins, you can close. I hope this post will help other people :slight_smile:

3 Likes