Getting Started - Qt for Python (original) (raw)

Toggle table of contents sidebar

Here you can find the steps to install and create a simple application using the two technologies that Qt provides: Qt Widgets and Qt Quick.

Note

If you are new to Qt, you can check the Frequently Asked Questions section at the end of this page to understand concepts, file types, compatibles IDEs, etc. In case you own a Qt License, please refer to Commercial Use.

Requirements

Before you can install Qt for Python, first you must install the following software:

Installation

Prints PySide6 version

print(PySide6.version)

Prints the Qt version used to compile PySide6

print(PySide6.QtCore.version)
Note
For more information about what’s included in the pyside6package, check Package Details.

Create your first Qt Application

Qt Widgets and Qt Quick comparison header animation

Qt provides two technologies to build User Interfaces:

Both technologies offer you the possibility to use drag and drop tools to create your interfaces. pyside6-designer for Qt Widgets (included when you install pyside6), and Qt Design Studio for Qt Quick (Get it here).

Note

After reading this page, it is recommended that you check thepyside6-project tool to learn how to create projects automatically without writing all the code by hand.

Create your first Qt Application with Qt Widgets

Your Qt for Python setup is ready. You can explore it further by developing a simple application that prints "Hello World" in several languages. The following instructions will guide you through the development process:

The MyWidget class has the magic member function that randomly chooses an item from the hello list. When you click the button, themagic function is called.

Create your first Qt Application with Qt Quick

To do the same using Qt Quick:

Next steps

Now that you have use both technologies, you can head to ourExamples and Tutorials sections.

Frequently Asked Questions

Here you can find a couple of common questions and situations that will clarify questions before you start programming.

Why Qt for Python?

As a Qt/C++ developer, why should I consider Qt for Python?

Why Qt for Python?