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
See Also
-
pyqt-vbounding-box - vertical way
-
pyqt-bounding-box - horizontal/vertical ways
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)
| File | Size | Uploaded | |
|---|---|---|---|
| pyqt-hbounding-box-0.0.13.tar.gz | 4.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|