Skip to content

A curated collection of tips, tutorials, and code examples for building graphical user interfaces with Python, using the PySide library and the Qt framework.

Notifications You must be signed in to change notification settings

natorsc/py-pyside

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Beautiful GUIs with Python (PySide) and Qt framework

Creating graphical interfaces with Python (PySide) and Qt.

natorsc - py-pyside stars - py-pyside forks - py-pyside License MIT

✨ About this project

This repository is your complete guide to building sleek, modern graphical user interfaces with Python (PySide) and Qt framework. Whether you're a beginner or an experienced developer, you'll find practical tutorials, tips, and real code examples to level up your projects.

If this content has helped you, please consider making a donation. Your support makes a real difference and helps the project grow! 💙

🛠 Technologies used

Python Qt uv

👨‍💻 Author

Crafted with 💙 by Renato Cruz. Got questions or feedback? Reach out anytime!

Email

What I'm listening to while I code or study 😎🎵:

Spotify

💝 Support This Project

Your donation keeps this project alive and helps me continue creating and sharing useful content.

GitHub Sponsors

https://github.com/sponsors/natorsc/

Pix (Brazil)

b1839493-2afe-484d-9272-82a3e402b36f


💡 Extra

Qt

Kirigami

KDE

Softwares

PySide6

Main commands:

  • pyside6-android-deploy.
  • pyside6-assistant.
  • pyside6-balsam.
  • pyside6-balsamui.
  • pyside6-deploy.
  • pyside6-designer.
  • pyside6-genpyi.
  • pyside6-linguist.
  • pyside6-lrelease.
  • pyside6-lupdate.
  • pyside6-metaobjectdump.
  • pyside6-project.
  • pyside6-qml.
  • pyside6-qmlcachegen.
  • pyside6-qmlformat.
  • pyside6-qmlimportscanner.
  • pyside6-qmllint.
  • pyside6-qmlls.
  • pyside6-qmltyperegistrar.
  • pyside6-qsb.
  • pyside6-qtpy2cpp.
  • pyside6-rcc.
  • pyside6-svgtoqml.
  • pyside6-uic.

Flatpak

Pip generator

PySide6

Example:

{
  "id": "com.github.natorsc.AppName",
  "runtime": "org.kde.Platform",
  "runtime-version": "6.9",
  "sdk": "org.kde.Sdk",
  "base": "io.qt.PySide.BaseApp",
  "base-version": "6.9",
  "command": "app-name",
  "cleanup-commands": [
    "- /app/cleanup-BaseApp.sh"
  ],
  "finish-args": [
    "--share=ipc",
    "--socket=wayland",
    "--socket=x11",
    "--socket=pulseaudio",
    "--device=dri"
  ],
  "modules": [
    {
      "name": "app-name",
      "buildsystem": "simple",
      "build-commands": [
        "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"app_name\" --no-build-isolation"
      ],
      "sources": [
        {
          "type": "file",
          "path": "./dist/app_name-0.1.0-py3-none-any.whl"
        }
      ]
    }
  ]
}

PyQt6

Example:

{
  "id": "com.github.natorsc.AppName",
  "runtime": "org.kde.Platform",
  "runtime-version": "6.9",
  "sdk": "org.kde.Sdk",
  "base": "com.riverbankcomputing.PyQt.BaseApp",
  "base-version": "6.9",
  "command": "app-name",
  "cleanup-commands": [
    "- /app/cleanup-BaseApp.sh"
  ],
  "finish-args": [
    "--share=ipc",
    "--socket=wayland",
    "--socket=x11",
    "--socket=pulseaudio",
    "--device=dri"
  ],
  "modules": [
    {
      "name": "app-name",
      "buildsystem": "simple",
      "build-commands": [
        "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"app_name\" --no-build-isolation"
      ],
      "sources": [
        {
          "type": "file",
          "path": "./dist/app_name-0.1.0-py3-none-any.whl"
        }
      ]
    }
  ]
}

Github actions

If necessary, create a file for each operating system.

name: Deploying PySide6 with Nuitka ⚙️.
on:
  push:
    branches: ['main']
  workflow_dispatch:

permissions:
  contents: read
  pages: write
  id-token: write

concurrency:
  group: 'deploy'
  cancel-in-progress: true

jobs:
  build:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: '${{ matrix.os }}'
    steps:
      - name: Check out repository 💾.
        uses: actions/checkout@v5
      
      - name: Install Python 🐍.
        uses: actions/setup-python@v5
        with:
            python-version: '3.11'
            architecture: 'x64'
            cache: 'pip'
            cache-dependency-path: |
              **/requirements*.txt

      - name: Install requirements 🔨.
        working-directory: .
        run: python -m pip install --upgrade pip && pip install -r requirements.txt

      - name: Install and configure Nuitka 🛠️.
        uses: Nuitka/Nuitka-Action@main
        with:
          nuitka-version: main
          script-name: path/to/the/script.py
          enable-plugins: pyside6
          quiet: true
          standalone: true
          disable-console: true
          macos-create-app-bundle: true
          output-file: nome-do-aplicativo
          linux-icon: path/to/the/icon.ico
          windows-icon-from-ico: path/to/the/icon.ico
          macos-app-icon: path/to/the/con.icns
          macos-app-name: nome-do-aplicativo

      - name: Upload artifact (onefile) 🚀.
        uses: actions/upload-artifact@v4
        with:
          name: '${{ runner.os }}-build'
          path: |
            build/app.dist
            build/*.exe
            build/*.bin
            build/*.app/**/*

QtSql

QSQLITE (SQLite3)

QPSQL (PostgreSQL)

Arch Linux

sudo pacman -S \
postgresql-libs

QMARIADB (MariaDB)

Arch Linux

sudo pacman -S \
mariadb-libs

QMYSQL (MySQL)

Arch Linux

sudo pacman -S \
mariadb-libs

KDE Kirigami

Kirigami is a KDE UI (User Interface) framework designed to make it easier to create convergent and responsive applications.

Dependências

Arch Linux

sudo pacman -S \
pyside6 \
kirigami \
flatpak-builder \
qqc2-desktop-style \
appstream

PyQt6: sudo pacman -S python-pyqt6.

Fedora

sudo dnf install \
python3-pyside6 \
kf6-kirigami-devel \
flatpak-builder \
qqc2-desktop-style \
appstream-compose

PyQt6: sudo dnf install python3-pyqt6.

openSuse

sudo zypper install \
python3-qt6 \
python3-pyside6 \
kf6-kirigami-devel \
flatpak-builder \
qqc2-desktop-style \
AppStream-compose

PyQt6: sudo zypper install python-PyQt6.

Abstract card

Abstract card

Code:

Application window

Application window

Code:

Card

Card

Code:

Chips

Chips

Code:

Dialog

Dialog

Code:

Dialog menu

Dialog menu

Code:

Dialog prompt

Dialog prompt

Code:

Global drawer

Global drawer

Code:

Global drawer context

ToDo.

Global drawer context

Code:

Global drawer desktop

Global drawer desktop

Code:

Global drawer header

Global drawer header

Code:

Overlay drawer

Overlay drawer

Code:



Qt Quick

Application window

Application window

Code:


Busy indicator

Busy indicator

Code:


Button

Button

Code:


Button group

Button group

Code:


Charts

Arch Linux:

sudo pacman -S \
qt6-charts

Fedora:

sudo dnf install \
qt6-charts

Ubuntu 25.04:

sudo apt install \
qml6-module-qtcharts

Area series

Area series

Code:


Bar series

Bar series

Code:


Horizontal bar series

Horizontal bar series

Code:


Horizontal percent bar series

Horizontal percent bar series

Code:


Horizontal stacked bar series

Horizontal stacked bar series

Code:


Line series

Line series

Code:


Percent bar series

Percent bar series

Code:


Pie donut series

Pie donut series

Code:


Pie series

Pie series

Code:


Scatter series

Scatter series

Code:


Spline series

Spline series

Code:


Stacked bar series

Stacked bar series

Code:


Check box

Check box

Code:


Check delegate

Check delegate

Code:


Color dialog

Color dialog

Code:


Column layout

Column layout

Code:


Combo box

Combo box

Code:


Day of week row

Day of week row

Code:


Delay button

Delay button

Code:


Dial

Dial

Code:


Dialog

Dialog

Code:


Drawer

Drawer

Code:


File dialog

File dialog

Code:


Folder dialog

Folder dialog

Code:


Font dialog

Font dialog

Code:


Frame

Frame

Code:


Grid Layout

Grid Layout

Code:


Group box

Group box

Code:


Import QML file

Import QML file

Code:


Item delegate

Item delegate

Code:


Layout item proxy

Layout item proxy

Code:


Message dialog

Message dialog

Code:


Overlay

Overlay

Code:


Popup

Popup

Code:


Row layout

Row layout

Code:


Set initial properties

Todo

Set initial properties

Code:


Stack layout

Stack layout

Code:


Text field

Text field

Code:


Text input

Text input

Code:


Translation

Translation

Code:


Tree view

Tree view

Code:



Qt widgets

QApplication

QApplication

Code:

QBoxLayout

QBoxLayout

Code:

QButtonGroup

QButtonGroup

Code:

QCalendarWidget

QCalendarWidget

Code:

QCheckBox

QCheckBox

Code:

QColorDialog

QColorDialog

Code:

QColumnView

QColumnView

Code:

QComboBox

QComboBox

Code:

QCompleter

QCompleter

Code:

QDateEdit

QDateEdit

Code:

QDateTimeEdit

QDateTimeEdit

Code:

QDial

QDial

Code:

QDialog

QDialog

Code:

QDialogButtonBox

QDialogButtonBox

Code:

QDockWidget

QDockWidget

Code:

QDoubleSpinBox

QDoubleSpinBox

Code:

QErrorMessage

QErrorMessage

Code:

QFileDialog

QFileDialog

Code:

QFontComboBox

QFontComboBox

Code:

QFontDialog

QFontDialog

Code:

QFormLayout

QFormLayout

Code:

QFrame

QFrame

Code:

QGridLayout

QGridLayout

Code:

QGroupBox

QGroupBox

Code:

QHBoxLayout

QHBoxLayout

Code:

QInputDialog

QInputDialog

Code:

QLabel

QLabel

Code:

QLCDNumber

QLCDNumber

Code:

QLineEdit

QLineEdit

Code:

QListView

QListView

Code:

QListWidget

QListWidget

Code:

QMainWindow

QMainWindow

Code:

QSystemTrayIcon

QSystemTrayIcon

Code:


About

A curated collection of tips, tutorials, and code examples for building graphical user interfaces with Python, using the PySide library and the Qt framework.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages