Qt: Difference between revisions

imported>LinArcX
mNo edit summary
imported>Samueldr
Line 55: Line 55:
Here is a concrete example:  
Here is a concrete example:  


{{File|||
<pre>
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.}}
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
</pre>


One solution is to run a command like
The package will need to be fixed to use [the new https://github.com/NixOS/nixpkgs/issues/65399 <code>wrapQtAppsHook</code>].
{{Commands|<nowiki>env QT_PLUGIN_PATH=/nix/store/d7q3q6wmfccss8gcp09r33xg0wkbz9gb-qtbase-5.11.0-bin/lib/qt-5.11/plugins/ some_qt_app</nowiki>}}
 
Another is to set the variable in a shell.nix file like the following {{File|shell.nix|nix|<nowiki>
with import </nowiki><nixpkgs><nowiki> {};
 
stdenv.mkDerivation {
  name = "qt-somethingorother";
 
  buildInputs = [
    pkgs.somePackage
    ];
  QT_PLUGIN_PATH = qt5.qtbase.bin + "/" + qt5.qtbase.qtPluginPrefix;
  }
</nowiki>}} to be run with {{Commands|nix-shell shell.nix}}


==== Debugging methods ====
==== Debugging methods ====