Skip to main content

A PySide6 library providing a custom QML component for QR code scanning.

Project description

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 the QRScanner component.
  • previewOutput: Outputs the processed video frames (with or without highlights) to a VideoOutput.

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.

  1. Fork the repo
  2. Create your feature branch: git checkout -b feature-name
  3. Commit your changes: git commit -m 'Add new feature'
  4. Push to the branch: git push origin feature-name
  5. Open a pull request

License

This project is licensed under the MIT License. See the LICENSE file for details.


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

sideqr-0.0.post20.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

sideqr-0.0.post20-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file sideqr-0.0.post20.tar.gz.

File metadata

  • Download URL: sideqr-0.0.post20.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for sideqr-0.0.post20.tar.gz
Algorithm Hash digest
SHA256 3c9a99e7cbf9ba62a3aeaded371f93bb9d53b4bb9f4178d667985612cb228e92
MD5 edbf162b33a2e935eeb5d627a047cdde
BLAKE2b-256 82410abac4710fe493681666a14fa01b2f1ca2bdd8265ae279c115a75f6e1bd1

See more details on using hashes here.

File details

Details for the file sideqr-0.0.post20-py3-none-any.whl.

File metadata

  • Download URL: sideqr-0.0.post20-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for sideqr-0.0.post20-py3-none-any.whl
Algorithm Hash digest
SHA256 7c2749b5e159ed0f8acaae27c418ee3d9ba59bd769d6cbe48ccd66b70ef9f1e0
MD5 c215ec8e54eb966f9134a644e51d8b39
BLAKE2b-256 ca0dd1bf4e023b123f0b46296e52eac3c15ac47390891b6ec68225c0bd1da325

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