9
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Qt環境の種類(PyQt5/PyQt4/PySide)に依存しないコードを書くためのパッケージqtpy

Posted at

Pythonの主なQt biding パッケージは、PyQt5, PyQt4, PySideがあり、自分の環境のQtにあわせてimport PyQt5などと書いてしまうと、別のQt環境をもつユーザーが使えません。qtpyパッケージはこの問題を解決してくれる抽象レイヤーです。
from PyQt5.QtWidgets import QWidget などと書くところをfrom qtpy.QtWidgets import QWidgetとすれば、PyQt5, PyQt4, PySideのいずれでも動くコードが書けます。
qtpyは、Spyderが内部で使用しており、Spyder IDEプロジェクトの一部で活発にメンテされています。

9
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?