METADATA
8.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
Metadata-Version: 2.1
Name: pyqt5-tools
Version: 5.15.4.3.2
Summary: PyQt Designer and QML plugins
Home-page: https://github.com/altendky/pyqt-tools
Author: Kyle Altendorf
Author-email: sda@fstab.net
License: GPLv3
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development
Classifier: Topic :: Utilities
Requires-Python: >=3.5
Description-Content-Type: text/x-rst
Requires-Dist: click
Requires-Dist: pyqt5 (==5.15.4)
Requires-Dist: pyqt5-plugins (<5.15.4.3,>=5.15.4.2.2)
Requires-Dist: python-dotenv
==========
pyqt-tools
==========
|PyPI| |Pythons| |GitHub|
The PyQt5 wheels do not provide tools such as Qt Designer that were included in
the old binary installers. This package aims to provide those in a separate
package which is useful for developers while the official PyQt5 wheels stay
focused on fulfilling the dependencies of PyQt5 applications.
Both Windows and Linux are supported. Adjust paths etc accordingly if applying
the explanations below in Linux rather than Windows. macOS support is
incomplete but see `issue #12`_ if you want to discuss it.
.. |PyPI| image:: https://img.shields.io/pypi/v/pyqt5-tools.svg
:alt: PyPI version
:target: https://pypi.org/project/pyqt5-tools/
.. |Pythons| image:: https://img.shields.io/pypi/pyversions/pyqt5-tools.svg
:alt: supported Python versions
:target: https://pypi.org/project/pyqt5-tools/
.. |GitHub| image:: https://img.shields.io/github/last-commit/altendky/pyqt-tools/main.svg
:alt: source on GitHub
:target: https://github.com/altendky/pyqt-tools
.. _`issue #12`: https://github.com/altendky/pyqt-tools/issues/12
------------
Installation
------------
.. code-block:: powershell
yourenv/Scripts/pip.exe install pyqt5-tools~=5.15
You will generally install pyqt5-tools using ``pip install``. In most cases
you should be using virtualenv_ or venv_ to create isolated environments to
install your dependencies in. The above command assumes an env in the
directory ``yourenv``. The ``~=5.15`` specifies a `release compatible with`_
5.15 which will be the latest version of pyqt5-tools built for PyQt5_ 5.15. If
you are using a different PyQt5 version, specify it instead of 5.15. PyPI
keeps a list of `all available versions`_.
.. _virtualenv: https://virtualenv.pypa.io/en/stable/
.. _venv: https://docs.python.org/3/library/venv.html
.. _PyQt5: https://pypi.org/project/PyQt5/
.. _`release compatible with`: https://www.python.org/dev/peps/pep-0440/#compatible-release
.. _`all available versions`: https://pypi.org/project/pyqt5-tools/#history
Note:
As of pyqt5-tools v3 the package has been broken down into four pieces.
The wrappers remain here but the plugins are located in pyqt5-plugins_,
some Qt application helpers in qt5-tools_, and the applications are in
qt5-applications_.
.. _pyqt5-plugins: https://github.com/altendky/pyqt-plugins
.. _qt5-tools: https://github.com/altendky/qt-tools
.. _qt5-applications: https://github.com/altendky/qt-applications
-----
Usage
-----
A program is provided available as ``Scripts/pyqt5-tools.exe``. There are
subcommands provided for each of Designer, QML Scene, and the QML Test Runner.
These wrapper commands provide additional functionality related to launching
the underlying programs. A larger set of Qt application are available as
subcommands of the ``Scripts/qt5-tools.exe`` program. In both cases, passing
``--help`` will list the available subcommands.
Additionally, each ``pyqt5-tools`` subcommand listed below includes a parameter
to run a basic example which can be used to see if the plugins are working.
These examples are `not` intended to be used as examples of good code.
Each subcommand searches up the filesystem tree from your current
working directory to find a ``.env`` file and loads it if found. If found, the
environment variable ``DOT_ENV_DIRECTORY`` will be set to the directory
containing the ``.env`` file. With this extra variable you can specify paths
relative to the ``.env`` location.
.. code-block:: powershell
PYQTDESIGNERPATH=${PYQTDESIGNERPATH};${DOT_ENV_DIRECTORY}/path/to/my/widgets
Designer
========
There is a ``Scripts/pyqt5-tools.exe designer.exe`` entry point that will help fill out
``PYQTDESIGNERPATH`` from either command line arguments or a ``.env`` file.
Unknown arguments are passed through to the original Qt Designer program.
.. code-block::
Usage: pyqt5-tools designer [OPTIONS]
Options:
-p, --widget-path DIRECTORY Paths to be combined with PYQTDESIGNERPATH
--example-widget-path Include the path for the pyqt5-tools example
button (c:\users\sda\testenv\lib\site-
packages\pyqt5_plugins)
--designer-help Pass through to get Designer's --help
--test-exception-dialog Raise an exception to check the exception
dialog functionality.
--qt-debug-plugins / --no-qt-debug-plugins
Set QT_DEBUG_PLUGINS=1
--help Show this message and exit.
If you want to view the generated code from within Designer, you can
run ``Scripts/pyqt5-tools.exe installuic`` and it will copy ``pyuic5.exe``
such that Designer will use it and show you generated Python code. Note that
this will enable viewing using the C++ menu item while the Python menu item
will be broken. Without having made this adjustment, the C++ option shows
C++ code while the Python option shows PySide2 code. ``pyqt5`` must already
be installed or this script will be unable to find the original ``pyuic5.exe``
to copy.
In addition to the standard features of the official Designer plugin, this
provides an exception dialog for your widget's Python code. Otherwise Designer
in Windows silently crashes on Python exceptions.
QML Plugin
==========
The QML plugin is also included. In the future a tool may be provided to
handle copying of the plugin to each directory where it is needed. For now
this must be done manually.
``site-packages/pyqt5_tools/Qt/bin/plugins/pyqt5qmlplugin.dll``
QML Scene
=========
.. code-block::
Usage: pyqt5-tools qmlscene [OPTIONS]
Options:
-p, --qml2-import-path DIRECTORY
Paths to be combined with QML2_IMPORT_PATH
--qmlscene-help Pass through to get QML scene's --help
--qt-debug-plugins / --no-qt-debug-plugins
Set QT_DEBUG_PLUGINS=1
--run-qml-example Run the pyqt5-tools QML example
--help Show this message and exit.
QML Test Runner
===============
.. code-block::
Usage: pyqt5-tools qmltestrunner [OPTIONS]
Options:
-p, --qml2-import-path DIRECTORY
Paths to be combined with QML2_IMPORT_PATH
--qmltestrunner-help Pass through to get QML test runner's --help
--qt-debug-plugins / --no-qt-debug-plugins
Set QT_DEBUG_PLUGINS=1
--test-qml-example Test the pyqt5-tools QML example
--help Show this message and exit.
--------------
Special Thanks
--------------
|MacStadium|
.. |MacStadium| image:: https://uploads-ssl.webflow.com/5ac3c046c82724970fc60918/5c019d917bba312af7553b49_MacStadium-developerlogo.png
:alt: MacStadium
:target: https://www.macstadium.com/
Thanks to MacStadium for providing me with a macOS system to develop and test
out the final pyqt5-tools platform. This is still 'in work'. See
`issue #12`_.