AppImage / AppImage/docs.appimage.org

Add section on how to make AppImages of Qt apps look native on Gtk

オープン
#50 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
HTML
スター
49
フォーク
45
PR マージ指標
30日以内にマージされた PR はありません

説明

Add section on how to make AppImages of Qt apps look native on Gtk based on

* https://github.com/probonopd/linuxdeployqt/issues/60#issuecomment-456185392
* https://github.com/probonopd/linuxdeployqt/issues/60#issuecomment-456179469

Proposal:

### Making AppImages of Qt apps look native on Gtk

Here is an example of a native-looking Qt application running on a Xubuntu (Xfce-based) distribution in an AppImage:

![image](https://user-images.githubusercontent.com/2480569/88905113-76724c80-d245-11ea-8f28-508504678504.png)

To make AppImages of Qt applications look native on Gtk based systems, you need to bundle `plugins/platformthemes/libqgtk2.so` and `plugins/styles/libqgtk2style.so`. Since they do not come with Qt by default anymore, you need to compile them by hand.

__Example:__

```
apt-get update
apt-get -y install libgtk2.0-dev
git clone http://code.qt.io/qt/qtstyleplugins.git
cd qtstyleplugins
qmake
make -j$(nproc)
make install
cd -

(...)

linuxdeployqt (...) -extra-plugins=platformthemes/libqgtk2.so,styles/libqgtk2style.so
```

At runtime, you need to `export QT_QPA_PLATFORMTHEME=gtk2`, e.g., by adding this line to a custom `AppRun` script. (Xubuntu exports this variable automatically).

**Background information**

According to https://askubuntu.com/a/910143,

> The problem has occurred since Qt5.7. In this release, the GTK2 platform theme and style was removed and replaced with the GTK3 platform theme. I've recently been in discussion with the Qt developers and it appears there isn't a GTK3 style to complement the platform theme and there are currently no plans to implement this in the future.

**References**

* https://askubuntu.com/a/910143
* https://askubuntu.com/a/748186

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。