Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QT_PLUGIN_PATH is broken, Qt6 applications can't find adwaita-qt #210891

Closed
Tungsten842 opened this issue Jan 15, 2023 · 2 comments · Fixed by #211003
Closed

QT_PLUGIN_PATH is broken, Qt6 applications can't find adwaita-qt #210891

Tungsten842 opened this issue Jan 15, 2023 · 2 comments · Fixed by #211003
Labels
0.kind: bug Something is broken

Comments

@Tungsten842
Copy link
Member

Tungsten842 commented Jan 15, 2023

Describe the bug

After #182580, I have set:

  qt = {
    enable = true;
    style = "adwaita";
    platformTheme = "gnome";
  };

But any qt6 application says: QApplication: invalid style override 'adwaita' passed, ignoring it.
This is definitly related to QT_PLUGIN_PATH, because if I export QT_PLUGIN_PATH like this:

QT_PLUGIN_PATH=/nix/store/v2w2xragrciibdgjkkdjmr0vmmgb34lz-adwaita-qt-1.4.1/lib/qt-6/plugins

Everthing works fine.

Steps To Reproduce

Open any qt6 app

Notify maintainers

@bobby285271 @hedning @jtojnar @dasj19 @maxeaubrey @linsui

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
- system: `"x86_64-linux"`
 - host os: `Linux 6.1.3-xanmod1, NixOS, 23.05 (Stoat), 23.05.20230111.6c8644f`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.12.0`
 - channels(root): `""`
 - channels(quantmint): `""`
 - nixpkgs: `/run/current-system/nixpkgs`
@Tungsten842 Tungsten842 added the 0.kind: bug Something is broken label Jan 15, 2023
@lilyinstarlight
Copy link
Member

I think this may have worked by accident in Qt5. Because I can't find documentation to confirm that this behavior is intentional, but Qt5 searches for plugins in every PATH entry + ../lib/[qt-prefix]/plugins, but Qt6 only searches directly in entries in QT_PLUGIN_PATH (or QT_QPA_PLATFORM_PLUGIN_PATH) and does not make up extra search paths based on PATH

Therefore since /run/current-system/sw/bin is in PATH, Qt5 searches /run/current-system/sw/lib/[qt-5-prefix]/plugins, even though it isn't specified in QT_PLUGIN_PATH

So we should probably be setting QT_PLUGIN_PATH for all versions in nixos/modules/config/qt.nix regardless, unless that behavior in Qt5 is intentional (even then, explicitly adding it to QT_PLUGIN_PATH is clearer)

@lilyinstarlight
Copy link
Member

I've opened #211003 to fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants