Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yjg30737/pyqt-hbounding-box
PyQt QGraphicsView with bounding box. User can move vertical border of the box horizontally.
https://github.com/yjg30737/pyqt-hbounding-box
pyqt pyqt-examples pyqt-qgraphicsview pyqt5 pyqt5-examples pyqt5-framework pyqt5-gui pyqt5-qgraphicsview pyqt5-tools pyqt5-tutorial python python3 python37 qgraphicsview qt selection-box
Last synced: 22 days ago
JSON representation
PyQt QGraphicsView with bounding box. User can move vertical border of the box horizontally.
- Host: GitHub
- URL: https://github.com/yjg30737/pyqt-hbounding-box
- Owner: yjg30737
- License: mit
- Created: 2021-12-23T03:56:55.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-17T02:37:47.000Z (over 2 years ago)
- Last Synced: 2024-10-11T09:28:58.812Z (about 1 month ago)
- Topics: pyqt, pyqt-examples, pyqt-qgraphicsview, pyqt5, pyqt5-examples, pyqt5-framework, pyqt5-gui, pyqt5-qgraphicsview, pyqt5-tools, pyqt5-tutorial, python, python3, python37, qgraphicsview, qt, selection-box
- Language: Python
- Homepage:
- Size: 27.3 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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```python
from PyQt5.QtWidgets import QWidget, QGridLayout, QApplication, QPushButton, QFileDialogfrom 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 sysapp = 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
* pyqt-vbounding-box - vertical way
* pyqt-bounding-box - horizontal/vertical ways