PyQt QGraphicsView with bounding box. User can move horizontal border of the box vertically.
Project description
pyqt-vbounding-box
PyQt QGraphicsView with bounding box. User can move horizontal border of the box vertically.
Requirements
- PyQt5 >= 5.8
Setup
python -m pip install pyqt-vbounding-box
Feature
-
Being able to drag and drop horizontal border vertically
-
Pressing mouse cursor to place more adjacent border on the spot.
-
Right click to release the focus of the box
Example
Code Sample
from PyQt5.QtWidgets import QWidget, QGridLayout, QApplication, QPushButton, QFileDialog
from pyqt_vbounding_box.vBoundingBox import
VBoundingBox
class VerticalSelectionSquareGraphicsViewExample(QWidget):
def __init__(self):
super().__init__()
self.__initUi()
def __initUi(self):
addImageBtn = QPushButton('Add image')
addImageBtn.clicked.connect(self.__addImage)
self.__view = VBoundingBox()
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 = VerticalSelectionSquareGraphicsViewExample()
ex.show()
sys.exit(app.exec_())
Result
See Also
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for pyqt_vbounding_box-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3b37a905e6206832173638eea11a74094efcad3e5a167aa93074f7da70a5cac |
|
MD5 | da99bbe7ec74faa9cf4c0872cbd64488 |
|
BLAKE2b-256 | ee603d191902efd8067eb7b3bb701ee8a85496c0cfb8827aeb0de9fb94d0b7eb |