{"id":17603021,"url":"https://github.com/yjg30737/pyqt-bounding-box","last_synced_at":"2025-09-10T02:44:36.670Z","repository":{"id":57677849,"uuid":"445793887","full_name":"yjg30737/pyqt-bounding-box","owner":"yjg30737","description":"PyQt bounding box for graphic design software","archived":false,"fork":false,"pushed_at":"2022-12-28T08:56:15.000Z","size":38,"stargazers_count":13,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-12T10:05:44.027Z","etag":null,"topics":["bounding-boxes","pyqt","pyqt-examples","pyqt-tutorial","pyqt5","pyqt5-examples","pyqt5-tutorial","python","python3","python37","qgraphicsitem","qgraphicsrectitem","qgraphicsscene","qgraphicsview","qt"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yjg30737.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-08T10:55:14.000Z","updated_at":"2024-07-12T01:23:56.000Z","dependencies_parsed_at":"2023-01-31T06:15:31.574Z","dependency_job_id":null,"html_url":"https://github.com/yjg30737/pyqt-bounding-box","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yjg30737/pyqt-bounding-box","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjg30737%2Fpyqt-bounding-box","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjg30737%2Fpyqt-bounding-box/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjg30737%2Fpyqt-bounding-box/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjg30737%2Fpyqt-bounding-box/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yjg30737","download_url":"https://codeload.github.com/yjg30737/pyqt-bounding-box/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjg30737%2Fpyqt-bounding-box/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274402784,"owners_count":25278349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bounding-boxes","pyqt","pyqt-examples","pyqt-tutorial","pyqt5","pyqt5-examples","pyqt5-tutorial","python","python3","python37","qgraphicsitem","qgraphicsrectitem","qgraphicsscene","qgraphicsview","qt"],"created_at":"2024-10-22T13:37:29.249Z","updated_at":"2025-09-10T02:44:36.647Z","avatar_url":"https://github.com/yjg30737.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyqt-bounding-box\nPyQt bounding box for graphic design software\n\n## Requirements\nPyQt5 \u003e= 5.8\n\n## Setup\n`python -m pip install pyqt-bounding-box`\n\n## Feature\n* Cursor shape changes properly for position (horizontal/vertical edge, etc.)\n* Being able to resize the box horizontally/vertically/diagonally \n* Being able to move the box with either mouse cursor or arrow keys\n* Being able to change the attribute of the box\n\n## Methods Overview\n* setLineWidth(self, n: int) - Default width is 3\n* setColor(self, color: QColor) - Default color is black\n* setStyle(self, style: Qt.PenStyle) - Default style is Qt.DashLine (You can see more about this style in \u003ca href=\"https://doc.qt.io/qt-6/qt.html#PenStyle-enum\"\u003ehere\u003c/a\u003e)\n* setWidth(width: int)\n* setHeight(height: int)\n* setSize(width: int, height: int)\n\nYou can use the standard function like `setPen(pen: QPen)` if you know how to use it, Here's the example:\n\n```python\nitem = BoundingBox()\n\npen = QPen()\npen.setStyle(Qt.DashLine)\npen.setWidth(3)\npen.setColor(QColor(0, 0, 0))\n\nitem.setPen(pen)\n```\n\n## Example\nCode Sample\n\n```python\nfrom PyQt5.QtWidgets import QWidget, QGraphicsView, QVBoxLayout, QApplication, QGraphicsScene\n\nfrom pyqt_bounding_box.boundingBox import BoundingBox\n\n\nclass Example(QWidget):\n    def __init__(self):\n        super().__init__()\n        self.__initUi()\n\n    def __initUi(self):\n        view = QGraphicsView()\n        self.__scene = QGraphicsScene()\n        self.__scene.setSceneRect(0, 0, 400, 400)\n\n        item = BoundingBox()\n        # item.setLineWidth(8) If you want to change the edge line width, add the code.\n        # item.setColor(QColor(255, 255, 255)) If you want to change the color of the line to white, add the code.\n        # item.setStyle(Qt.SolidLine) If you want to change the style of line from dashed to solid line, add the code.\n        self.__scene.addItem(item)\n        view.setScene(self.__scene)\n\n        lay = QVBoxLayout()\n        lay.addWidget(view)\n\n        self.setLayout(lay)\n\n\nif __name__ == \"__main__\":\n    import sys\n\n    app = QApplication(sys.argv)\n    example = Example()\n    example.show()\n    app.exec_()\n```\n\nResult\n\nhttps://user-images.githubusercontent.com/55078043/148708740-cd1f0765-7768-44b6-88bb-770e2d34fe12.mp4\n\n## See Also\n* \u003ca href=\"https://github.com/yjg30737/pyqt-hbounding-box.git\"\u003epyqt-hbounding-box\u003c/a\u003e\n* \u003ca href=\"https://github.com/yjg30737/pyqt-vbounding-box.git\"\u003epyqt-vbounding-box\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyjg30737%2Fpyqt-bounding-box","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyjg30737%2Fpyqt-bounding-box","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyjg30737%2Fpyqt-bounding-box/lists"}