{"id":15578317,"url":"https://github.com/morefigs/pyqt-helper","last_synced_at":"2025-04-24T01:10:25.851Z","repository":{"id":62582837,"uuid":"165797120","full_name":"morefigs/pyqt-helper","owner":"morefigs","description":"Autogenerate getter and setter code for PyQt UI objects","archived":false,"fork":false,"pushed_at":"2019-11-03T22:11:31.000Z","size":20,"stargazers_count":6,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T20:35:44.491Z","etag":null,"topics":["boilerplate","code-generation","getter","pyqt","pyqt5","python","python3","setter","ui"],"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/morefigs.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":"2019-01-15T06:25:42.000Z","updated_at":"2023-06-21T08:45:07.000Z","dependencies_parsed_at":"2022-11-03T22:01:47.823Z","dependency_job_id":null,"html_url":"https://github.com/morefigs/pyqt-helper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morefigs%2Fpyqt-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morefigs%2Fpyqt-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morefigs%2Fpyqt-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morefigs%2Fpyqt-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morefigs","download_url":"https://codeload.github.com/morefigs/pyqt-helper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250540941,"owners_count":21447427,"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","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":["boilerplate","code-generation","getter","pyqt","pyqt5","python","python3","setter","ui"],"created_at":"2024-10-02T19:08:33.690Z","updated_at":"2025-04-24T01:10:25.829Z","avatar_url":"https://github.com/morefigs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyqt-helper\n\nPyQt Helper is a script for auto-generating boiler plate code for interacting with PyQt widgets, such as value getters and setters, widget connections, and slot functions.\n\nUsage\n-----\n\n`python pyqt_helper.py widgets.txt`\n\nwhere `widgets.txt` is a text file containing a PyQt widget object name on each line e.g. `spinBox_distance`.\n\nExample\n-------\n\nGiven a text file named `widgets.txt` containing the object name of `spinBox_distance`, the following code would be generated and saved to a Python file named `widgets_helper.py`:\n\n```python\nclass WidgetsHelper:\n\n    @property\n    def distance(self) -\u003e int:\n        return self.ui.spinBox_distance.value()\n\n    @distance.setter\n    def distance(self, value: int) -\u003e None:\n        self.ui.spinBox_distance.setValue(value)\n\n    @property\n    def distance_enabled(self) -\u003e bool:\n        return self.ui.spinBox_distance.isEnabled()\n\n    @distance_enabled.setter\n    def distance_enabled(self, enabled: bool) -\u003e None:\n        self.ui.spinBox_distance.setEnabled(enabled)\n```\n\nA PyQt UI class can then simply inherit `WidgetsHelper` to gain the provided functionality:\n\n```python\nclass MyWindow(QMainWindow, WidgetsHelper):\n\n    def method(self):\n        # enable the distance spin box and set its value to 100\n        self.distance_enabled = True\n        self.distance = 100\n        \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorefigs%2Fpyqt-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorefigs%2Fpyqt-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorefigs%2Fpyqt-helper/lists"}