SideQR
SideQR is a PySide6-based library that provides a custom QML component for real-time QR code scanning. It leverages OpenCV and PyZbar for efficient QR code detection and can be seamlessly integrated into PySide6 applications using QML.
Features
- Real-time QR code detection using the device camera.
- Customizable QML component (
QRScanner) for easy integration. - Optional highlight overlays for detected QR codes.
- Lightweight and fast, using multithreading for frame processing.
Installation
You can install SideQR via pip:
pip install sideqr
Or install directly from the GitHub repository:
pip install git+https://github.com/vishnumg/SideQR.git
Usage
1. Importing the Library in QML
Once installed, you can import the QRScanner component into your QML application:
import QtQuick
import QtQuick.Controls
import QtMultimedia
import SideQR 1.0
ApplicationWindow {
visible: true
width: 640
height: 480
title: "QR Code Scanner"
MediaDevices {
id: mediaDevices
}
CaptureSession {
camera: Camera {
id: camera
cameraDevice: mediaDevices.defaultVideoInput
active: true
}
videoOutput: qrScanner.videoSink
}
QRScanner {
id: qrScanner
onBarcodeDetected: barcode => {
console.log("QR Code detected:", barcode)
}
previewOutput: videoOutput.videoSink
}
VideoOutput {
id: videoOutput
anchors.fill: parent
}
}
2. Running the Example
You can also test the library with the provided example:
python examples/qr_scanner_app.py
This will open a window showing the camera feed, and detected QR codes will be displayed in the console and UI.
API
QRScanner Properties:
videoSink: Connects the camera input to theQRScannercomponent.previewOutput: Outputs the processed video frames (with or without highlights) to aVideoOutput.
QRScanner Signals:
barcodeDetected: Emits the decoded QR code data as a string whenever a QR code is detected.
Dependencies
Install them manually if needed:
pip install PySide6 opencv-python pyzbar Pillow numpy
Contributing
Contributions are welcome! Feel free to fork the repository, make changes, and submit pull requests.
- Fork the repo
- Create your feature branch:
git checkout -b feature-name - Commit your changes:
git commit -m 'Add new feature' - Push to the branch:
git push origin feature-name - Open a pull request
License
This project is licensed under the MIT License. See the LICENSE file for details.
Metadata
Release files for sideqr 0.0.post20
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sideqr-0.0.post20.tar.gz | 6.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sideqr-0.0.post20-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.4 kB
Release files / sideqr-0.0.post20.tar.gz
| Download URL | sideqr-0.0.post20.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3c9a99e7cbf9ba62a3aeaded371f93bb9d53b4bb9f4178d667985612cb228e92
|
|
BLAKE2b-256 checksum How to use checksums |
82410abac4710fe493681666a14fa01b2f1ca2bdd8265ae279c115a75f6e1bd1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|
Release files / sideqr-0.0.post20-py3-none-any.whl
| Download URL | sideqr-0.0.post20-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c2749b5e159ed0f8acaae27c418ee3d9ba59bd769d6cbe48ccd66b70ef9f1e0
|
|
BLAKE2b-256 checksum How to use checksums |
ca0dd1bf4e023b123f0b46296e52eac3c15ac47390891b6ec68225c0bd1da325
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|