MX Linux PySide Qt Designer

MX Linux環境にて、PySide6をインストールし、Qt Designerを起動させる方法について解説します。

PySide6のインストール

ターミナルを開いて、以下のコマンドを実行してください。

pip install PySide6

Qt Designerの起動

ターミナルを開いて、以下のコマンドを実行してください。

pyside6-designer

Qt Designerがエラーで起動できない時の対処方法

エラー内容

qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: offscreen, wayland-egl, vnc, wayland, eglfs, minimal, xcb, minimalegl, linuxfb, vkkhrdisplay.

エラーの原因

Qtのプラットフォームプラグイン「xcb」をロードできない問題が発生しています。

特に、xcb-cursor0 または libxcb-cursor0 というパッケージが必要となっています。

これは、X Window SystemのXCBライブラリに関連するパッケージで、グラフィカルなアプリケーションがXサーバーと通信するために必要です。

この問題を解決するためには、不足しているパッケージをインストールする必要があります。

MX Linuxは、Debianベースのディストリビューションなので、APTパッケージマネージャを使用してインストールできます。

ターミナルを開いて、以下のコマンドを実行してください。

sudo apt install libxcb-cursor0

これで「pyside6-designer」コマンドでQt Designerが起動できるようになります。