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.1.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.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file sideqr-0.0.1.tar.gz.

File metadata

  • Download URL: sideqr-0.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 88e9fbc31caa8746fe7e486c295f3f1204f85545a08c9c56a8ef7c4ca2362e8b
MD5 fa459cbf8f6f423499800d4fb341a2b3
BLAKE2b-256 2d21523530fa59665893099d14be523fc8a5d25fec9e776e108b4aeeaadabe09

See more details on using hashes here.

File details

Details for the file sideqr-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: sideqr-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8fd6615da4fccaf3fea72d2e3b88324871cdd79f7d38c6b5d2c09d7079c602fe
MD5 0eeaca0939d4c596ed03c27ddeb51d01
BLAKE2b-256 9e93068ae74bd9295666d9d8b70506f47d72ac5cb6171efc17274587b401ed4a

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