python-tooling icon indicating copy to clipboard operation
python-tooling copied to clipboard

Add section to docs on GUI toolkits

Open dstansby opened this issue 10 months ago • 3 comments

Is Your Feature Request Related to a Problem? Please Describe

n/a

Describe the Solution You'd Like

A seciton in the docs on toolkits for making GUIs with Python.

Describe Alternatives You've Considered

No response

Additional Context

No response

dstansby avatar Apr 08 '24 16:04 dstansby

Any thoughts on which toolkits to include / recommend? Some we could include:

Plus more application-specific ones:

  • napari
  • PyVistaQt
  • Trame (a web framework for VTK but can also be used to create apps that run locally in the browser)

And should we include packages for creating applications (perhaps that should be a separate section though):

p-j-smith avatar Apr 12 '24 09:04 p-j-smith

  • PyQt vs PySide vs QtPy

    QtPy is a small abstraction layer that lets you write applications using a single API call to either PyQt or PySide.

    It provides support for PyQt5, PySide2, PyQt6 and PySide6 using the Qt5 layout (where the QtGui module has been split into QtGui and QtWidgets).

samcunliffe avatar Apr 12 '24 09:04 samcunliffe

QtPy is a small abstraction layer that lets you write applications using a single API call to either PyQt or PySide.

It provides support for PyQt5, PySide2, PyQt6 and PySide6 using the Qt5 layout (where the QtGui module has been split into QtGui and QtWidgets).

Yep, QtPy is the way to go you're e.g. developing an app with a plugin system (so other's can choose which Qt bindings to use), or if you're developing a widget that others can use in their apps.

But if you're developing an app that you'll build with PyInstaller/pyapp and distribute as an executable, there might be no need to support multiple bindings and you could choose to use PySide6 directly (or any other bindings). Although I would probably avoid using PyQt over PySide - PyQt has a more restrictive license, PySide is developed by Qt, and the PySide docs are (nowadays) better than the PyQt docs

p-j-smith avatar Apr 12 '24 09:04 p-j-smith