Skip to main content

Like Bootstrap, but qt-er.

Project description

QtStrap: Qt application bootstrapping framework

license pypi version PyPI status

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.

  • 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

$ 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:

$ python3 app/main.py

If you see a window like this, then you're good to go:

screenshot

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

pip install qtstrap

Contributing

Contributions are always welcome. Feel free to open an issue or start a new discussion on our GitHub.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qtstrap-0.7.1.tar.gz (138.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qtstrap-0.7.1-py3-none-any.whl (76.7 kB view details)

Uploaded Python 3

File details

Details for the file qtstrap-0.7.1.tar.gz.

File metadata

  • Download URL: qtstrap-0.7.1.tar.gz
  • Upload date:
  • Size: 138.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for qtstrap-0.7.1.tar.gz
Algorithm Hash digest
SHA256 70abae958402970dc2bcd3fbd958b20800fa1b946ed5c308063ea8ed40ae4b8f
MD5 99f7b864a1ee4de664365a1a795fe4e6
BLAKE2b-256 9bb35924779e660d18d30a191864b07115e2acebbbc23ae1163cbd18badcaf2f

See more details on using hashes here.

File details

Details for the file qtstrap-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: qtstrap-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 76.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for qtstrap-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1cb021447112d4d2775ec279c93cc5824c7a440fc2ef37704824db07bdbaab54
MD5 49dac51d00fb6eda8ee49bf39a920709
BLAKE2b-256 6ce8df77c64f028235b002ab4d8215143ccd150b9b74bb6664885fe88639c3f7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page