在setup.py中编译qt资源文件、ui文件和翻译

setup_qt的Python项目详细描述


在setup.py中编译qt资源文件、ui文件和翻译

可与pyqt4、pyqt5、pyside和pyside2一起使用。qt绑定的使用 包装纸,如Qt.pyQtPy也受支持。

要求

示例

setup.py:

fromsetuptoolsimportsetupfromsetup_qtimportbuild_qtsetup(name='example',version='1.0.0',description='setup_qt example',author='Monty Python',author_email='monty.python@example.com',url='https://www.example.com',license='MIT',packages=['example'],package_data={'example':['*.ui','*.qrc','languages/*.ts','languages/*.qm',],},entry_points={'gui_scripts':['example=example.__main__:main',],},install_requires=['PyQt5','Qt.py',],options=['build_qt':{'packages':['example'],'languages':['cs'],# optional'languages_dir':'languages',# optional ('languages' is default)'bindings':'PyQt5',# optional ('PyQt5' is default)'replacement_bindings':'Qt',# optional (for Qt.py wrapper usage)},],cmdclass={'build_qt':build_qt,},)

用法:

[user@host ~]$ python setup.py build_qt
running build_qt
compiling example Qt resource files...
compiling example Qt UI files...
updating example Qt translation files...
compiling example Qt translation files...

帮助

Options for 'build_qt' command:
  --packages              List of comma separated packages in which to
                          recursively find .qrc, .ui and .ts files
  --languages             List of comma separated translation languages (could
                          be empty)
  --languages-dir         Directory with translation files (could be empty,
                          default is "languages")
  --bindings              Qt binding from which to use pyrcc, pyuic and
                          pylupdate commands (default is PyQt5)
  --replacement-bindings  Qt bindings replacement (e.g. if using wrapper like
                          Qt.py or QtPy)
  --pyrcc                 pyrcc command executable
  --pyuic                 pyuic command executable
  --pylupdate             pylupdate command executable
  --lrelease              lrelease command executable
  --filename-qrc          name template for .py files compiled from .qrc files
  --filename-ui           name template for .py files compiled from .ui files
  --filename-ts           name template for newly created .ts files

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java游戏!框架伪造应用程序它实际上做什么?   java如何在JavaFx中显示表视图中的即时更改?   对象类的equals()方法的java重载   xpages介绍如何部署java。IBM Notes中的策略更改   java如何访问侦听器中的另一个视图?   java getDefaultDisplay()的替代方法是什么   java opencv匹配模板   java Android Firebase写入数据时的常量超时   在Java中,如何将包含大量空格的数字字符串转换为一系列Int变量。   带有GUI的swing Java模拟无法运行模拟   java NoSuchElementException在特定的Web端上使用无头铬和硒   java对文件进行迭代,即使文件在目录中也会出现“未找到文件”异常。你能告诉我为什么吗?谢谢   递归Java 8,匿名递归嵌套方法   java为什么我看到枚举常量的字段值会被序列化/反序列化?在哪种情况下,枚举中哪些内容没有序列化?   java在运行sonar scanner和Spotbugs规则时出错,用于单片项目?   java如何检查硬件键盘是否可用?(黑莓)   tile游戏动作侦听器循环中的java错误   sockets Java线程池与高请求场景中的新线程   java如何使用Hibernate注释在联接表上创建索引?