https://github.com/qtstrap/qtstrap
A Qt application bootstrapping framework
https://github.com/qtstrap/qtstrap
bootstrap pyqt pyside2 python widgets
Last synced: 10 months ago
JSON representation
A Qt application bootstrapping framework
- Host: GitHub
- URL: https://github.com/qtstrap/qtstrap
- Owner: qtstrap
- License: mit
- Created: 2021-03-25T06:28:25.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-12-29T00:41:51.000Z (over 1 year ago)
- Last Synced: 2025-08-15T15:47:02.032Z (10 months ago)
- Topics: bootstrap, pyqt, pyside2, python, widgets
- Language: Python
- Homepage: https://qtstrap.github.io/qtstrap/
- Size: 6.41 MB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# QtStrap: Qt application bootstrapping framework
[](./LICENSE)
[](https://pypi.org/project/qtstrap/)
[](https://github.com/qtstrap/qtstrap)
Qt is excellent, but it's also enormous. There's a lot of topics, and many of them have hidden gotchas. PySide2 and PyQt are also excellent, letting us leverage the powerful Qt libraries from up in the clouds in PythonLand, but this arrangement has its own gotchas.
The goal of qtstrap is get your applications up and running quickly, so you can focus on your problem instead of on Qt's idiosyncracies.
# Features
More complete docs are available [here](https://docs.qtstrap.dev).
* `qtstrap` command line tool to bootstrap new projects
* crossplatform makefile with useful development commands
* preconfigured build system using PyInstaller and InnoSetup
* custom Qt widgets with useful behaviors
* Pythonic layout system using ContextLayouts
* Some other stuff I haven't remembered yet
# Quick start
```sh
$ mkdir test && cd test
$ python3 -m venv .venv
$ source .venv/bin/activate
$ python3 -m pip install qtstrap PySide6
$ qtstrap init
```
The init script will prompt you to enter the name of your application and the name of its publisher(which is probably you), and then it will generate an application skeleton.
You can test that everything installed properly by executing:
```sh
$ python3 app/main.py
```
If you see a window like this, then you're good to go:

## Custom Widgets
- `LabelEdit`
- `HLine` and `VLine`
- `LinkLabel`
- Buttons:
- `StateButton`
- `IconToggleButton`
- `ConfirmToggleButton`
- `MenuButton`
- Persistent Widgets (for rapid prototyping of saved data):
- `PersistentCheckableAction`
- `PersistentCheckBox`
- `PersistentComboBox`
- `PersistentLineEdit`
- `PersistentListWidget`
- `PersistentPlainTextEdit`
- `PersistentTabWidget`
- `PersistentTextEdit`
- `PersistentTreeWidget`
## Utility Classes and Functions
- `Adapter`
- `TimeStamp`
- `StringBuilder`
- `call_later()`
## decorators:
- `@accepts_file_drops`
- `@trace`
- `@singleton`
## context managers:
- `Defer`
- `SignalBlocker`
## qtstrap.extras:
- `CommandPalette`, like VSCode or SublimeText
- Logging Subsystem: log to local database + log viewer widgets
- `CodeEditor`: Custom QTextEditor subclass customized for code editing
# Dependencies
* Python 3
* PySide2/PySide6 or PyQt5/PyQt6
* Make(optional, but recommended)
# Installation
```sh
pip install qtstrap
```
# Contributing
Contributions are always welcome. Feel free to [open an issue](https://github.com/qtstrap/qtstrap/issues/new)
or [start a new discussion](https://github.com/qtstrap/qtstrap/discussions/new) on our GitHub.