PyQt6 中的 QtDesigner 在哪里?

问题描述

我找到了 bindings/QtDesigner 目录,但里面全是 .sip 文件

在 pypi 的 package website 中,它说

sip-install 工具还将安装 sdist 包中的绑定,但允许您配置安装的许多方面。

sip-install 需要一个名为 pyproject.toml文件,但只有 QtDesigner.toml,如果我将其重命名pyproject.toml,它无法运行。

sip-install: pyproject.toml: the '[tool.sip.Metadata]' section is missing

QtDesigner.toml内容

# Automatically generated configuration for PyQt6.QtDesigner.

sip-version = "6.0.1"
sip-abi-version = "13.0"
module-tags = ["Qt_6_0_0","Qt_6_0_0","Linux","Linux"]
module-disabled-features = ["PyQt_WebChannel","PyQt_OpenGL_ES2","PyQt_WebChannel","PyQt_WebChannel"]

解决方法

您可以将 PyQt5 的设计器用于 PyQt6。您可以使用以下命令将ui文件转换为PyQt6 Python文件:

pyuic6 -x filename.ui -o filename.py

注意:你不需要安装pyuic6,它会随PyQt6自动安装。