A library the uses PyQt5 for setting up apps with a window to programatically draw in.
Project description
PyQtPaint
This is still a work in progress, but basic functionality is present. A library of boilerplate code using the PyQt5 library. Used for creating a window to draw in and having an application and update thread. Also comes with some predefined objects to add to the window for drawing.
Modules
-
PyQtPaint.app: Contains theAppabstract class for running the window and updates to it. -
PyQtPaint.form: Contains thePainterWindowclass of which objects can be added and removed from it. These objects will be painted on every update call. -
PyQtPaint.objects: Contains thePainterObjectabstract class which descendants will have paint methods and other styling methods for customizing the object.
Examples:
Press esc to close.
- tree_app.py
- mouse_app.py
Usage:
The expected way to use this library to to create a class that extends App. The subclass can override various methods inside of App and there are options for further customization.
App Options:
These will be keyword arguments that are passed into the super constructor.
auto_update: Defaults toTrue; determines if an asynchronous thread should be made and ranfps: Defaults to30; will be the amount of times theupdatemethod is called in a secondmouse_tracking: Defaults toFalse; Will not capture mouse movements unless a button is down whenFalsetitle: Defaults toPainter Window; The title to be displayed on the windowfullscreen: Defaults toFalse; IfTruethe window will be in fullscreen modesize: The size of the window as a tuple(width, height)width: Defaults to600; If notsizethe width of the windowheight: Defaults to600; If notsizethe height of the windowposition: Defaults to(0, 0); Where the window should be placed on the screenrender_hint: Defaults toQPainter.Antialiasing; The render hint the window should use when paintingbackground: Defaults toQBrush(Qt.black); TheQBrushthe background should use
Methods to override:
Standard:
setup_objects:- Automatically called in the constructor
- Where the initial painter objects should be added to the window
update:- When
auto_updateis true will be called asynchronously multiple times a second based onfps - When
auto_updateis false callupdatemanually when you need a repaint
- When
Events:
They will all have an event parameter
Keys:
keyPresskeyRelease
Mouse:
mousePressmouseReleasemouseDoublemouseMovemouseEntermouseLeavemouseWheel
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyqtpaint-0.1.0.tar.gz.
File metadata
- Download URL: pyqtpaint-0.1.0.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
318ad32d4858db75cd18c46e220534dcb743046a7872b400ddd6625912bd2e11
|
|
| MD5 |
0e221b5b8f0b2b37a9021cca5bf85e6c
|
|
| BLAKE2b-256 |
7c33ba3e9a40ae9ccf216bbfb10ec532e7c85e2b96661daf441241d37205df21
|
File details
Details for the file pyqtpaint-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyqtpaint-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
daf52af31a5e08ffede09bfdf9471f60b45a25611857b11c2a25053f5ef0c734
|
|
| MD5 |
0cc495000a8a755b76b2d72d61a21c33
|
|
| BLAKE2b-256 |
ea892d9e1ebaeb8ef22a70a7676fe74757ae0d0dcc0f3358ba3dfabb597b8b63
|