Skip to main content

pyqt-hbounding-box

PyQt QGraphicsView with bounding box. User can move vertical border of the box horizontally.

Requirements

PyQt5 >= 5.8

Setup

python -m pip install pyqt-hbounding-box

Feature

  • Being able to drag and drop vertical border horizontally

  • Pressing mouse cursor to place more adjacent border on the spot.

  • Right click to release the focus of the box

  • You can set the background out of the box darker with setDarkerOutOfBox(f: bool).

Example

Code Sample

from PyQt5.QtWidgets import QWidget, QGridLayout, QApplication, QPushButton, QFileDialog



from pyqt_hbounding_box.hboundingBox import HBoundingBox





class HBoundingBoxExample(QWidget):

    def __init__(self):

        super().__init__()

        self.__initUi()



    def __initUi(self):

        addImageBtn = QPushButton('Add image')

        addImageBtn.clicked.connect(self.__addImage)

        self.__view = HBoundingBox()



        lay = QGridLayout()

        lay.addWidget(addImageBtn)

        lay.addWidget(self.__view)



        self.setLayout(lay)



    def __addImage(self):

        filename = QFileDialog.getOpenFileName(self, 'Open', '', 'Image Files (*.png *.jpg *.bmp)')

        if filename[0]:

            filename = filename[0]

            self.__view.setFile(filename)





if __name__ == "__main__":

    import sys



    app = QApplication(sys.argv)

    ex = HBoundingBoxExample()

    ex.show()

    sys.exit(app.exec_())

Result

https://user-images.githubusercontent.com/55078043/147186296-fa9083d0-67c6-4d7e-b139-7845ee38ddf9.mp4

See Also

Metadata

Release files for pyqt-hbounding-box 0.0.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyqt-hbounding-box 0.0.13
File Size Uploaded
pyqt-hbounding-box-0.0.13.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyqt-hbounding-box 0.0.13
File Interpreter ABI Platform
pyqt_hbounding_box-0.0.13-py3-none-any.whl Python 3 none any Details

Total release size: 9.1 kB

Release files / pyqt-hbounding-box-0.0.13.tar.gz

Download URL pyqt-hbounding-box-0.0.13.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
694c38f8c3c79525ea8edb81e41fcb608d4339c43837f725f4133edb4c967553
BLAKE2b-256 checksum
How to use checksums
b8ca8fd84cdfa3b7a8e200beb3bb0c1679f7c762a4f8070a02e6b7eef2956e91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/0.0.0 CPython/3.7.6

Release files / pyqt_hbounding_box-0.0.13-py3-none-any.whl

Download URL pyqt_hbounding_box-0.0.13-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7593a4c6ed490e978c08d63a1659151ad21da80294d5684903ae64e46c7ac7ef
BLAKE2b-256 checksum
How to use checksums
ceef5fd9b80acb9c056a1e7af38bacd5841820d8f962d4d10572254480caa2f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/0.0.0 CPython/3.7.6

Release history Release notifications | RSS feed

This release

0.0.13 This release

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page