Qt6 QML Book/Qt for Python/介绍

Introduction

介绍

The Qt for Python project provides the tooling to bind C++ and Qt to Python, and a complete Python API to Qt. This means that everything that you can do with Qt and C++, you can also do with Qt and Python. This ranges from headless services to widget based user interfaces. In this chapter, we will focus on how to integrate QML and Python.

Python项目的Qt提供了将C++和Qt绑定到Python的工具,以及一个完整的Python API到Qt。这意味着你可以用Qt和C++做的一切,你也可以用Qt和Python来做。这包括无头服务和基于窗体的用户界面。在本章中,我们将重点讨论如何集成QML和Python。

Currently, Qt for Python is available for all desktop platforms, but not for mobile. Depending on which platform you use, the setup of Python is slightly different, but as soon as you have a Python and PyPA environment setup, you can install Qt for Python using pip. This is discussed in more detail further down.

​目前,Qt for Python适用于所有桌面平台,但不适用于移动平台。根据所使用的平台,Python的设置略有不同,但一旦有了Python和PyPA环境设置,就可以使用pip安装Qt for Python。下面将更详细地讨论这一点。

As the Qt for Python project provides an entirely new language binding for Qt, it also comes with a new set of documentation. The following resources are good to know about when exploring this module.

由于Qt for Python项目为Qt提供了一种全新的语言绑定,它还附带了一组新的文档。在探索本模块时,可以了解以下资源。

The Qt for Python bindings are generated using the Shiboken tool. At times, it might be of interest to read about it as well to understand what is going on. The preferred point for finding information about Shiboken is the reference documentation. If you want to mix your own C++ code with Python and QML, Shiboken is the tool that you need.

​Python绑定的Qt是使用Shiboken工具生成的。有时,读一读关于它的文章,以及了解正在发生的事情,可能会有兴趣。查找Shiboken信息的首选点是参考文档。如果你想把你自己的C++代码和Python和QML混合,Shiboken就是你需要的工具。

TIP

Through-out this chapter we will use Python 3.7.

在本章中,我们将使用Python 3.7。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值