补充官方PYQT5车轮的工具
pyqt5-tools的Python项目详细描述
Pyqt5控制盘不提供包括在 旧的二进制安装程序。此包旨在提供 当正式的pyqt5轮子停留时对开发人员有用的包 专注于实现pyqt5应用程序的依赖性。
安装
yourenv\Scripts\pip.exeinstall--prepyqt5-tools~=5.11
通常使用pip install安装pyqt5工具。在大多数情况下 您应该使用virtualenv或venv来创建 在中安装依赖项。上面的命令假定 目录yourenv。--pre允许最新版本 尽管不是完整版本,但已安装。你必须 在任何给定的时间点,决定这是否是一个好的选择。这个 ~=5.11指定一个release compatible with5.11,它将是 为PyQt55.11构建的pyqt5工具的最新版本。如果你在使用 不同的pyqt5版本,请指定它而不是5.11。pypi保存了一个列表 all available versions。
用法
为每个工具创建一个脚本,这样您就可以得到如下文件 Scripts\designer.exe启动程序。每个人搜索 从当前工作目录中查找.env文件的文件系统树 如果找到就装上。如果找到环境变量 DOT_ENV_DIRECTORY将被设置为包含^{tt6}的目录$ 文件。使用这个额外的变量,您可以指定相对于 .env位置。
PYQTDESIGNERPATH=${PYQTDESIGNERPATH};${DOT_ENV_DIRECTORY}/path/to/my/widgets
另外,下面列出的每个pyqt5*包装器都包含一个参数 运行一个基本的示例,该示例可用于查看插件是否正常工作。 这些示例是而不是用于作为良好代码的示例。
设计师
有一个Scripts\pyqt5designer.exe入口点可以帮助填写 PYQTDESIGNERPATH来自命令行参数或.env文件。 未知参数传递给原始qt设计器程序。
Usage: pyqt5designer [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_tools) --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.
如果要在设计器中使用Form>;View Code...,可以 运行Scripts\pyqt5toolsinstalluic.exe,它将复制pyuic5.exe 这样设计器将使用它并显示生成的python代码。pyqt5 必须已安装,否则此脚本将无法找到原始的 pyuic5.exe要复制。
除了官方设计器插件的标准特性之外,这个 为小部件的python代码提供异常对话框。否则设计师 在windows中,python异常会自动崩溃。
qml插件
还包括qml插件。将来可能会提供一个工具 将插件复制到需要它的每个目录。暂时 这必须手动完成。
site-packages\pyqt5_tools\Qt\bin\plugins\pyqt5qmlplugin.dll
qml场景
Usage: pyqt5qmlscene [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测试运行器
Usage: pyqt5qmltestrunner [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.