{"id":14982687,"url":"https://github.com/yjg30737/pyqt-toast","last_synced_at":"2025-09-08T03:31:35.290Z","repository":{"id":57676465,"uuid":"441581862","full_name":"yjg30737/pyqt-toast","owner":"yjg30737","description":"PyQt Toast (Small message displayed on the screen, visible for a short time)","archived":false,"fork":false,"pushed_at":"2024-03-20T01:05:54.000Z","size":57,"stargazers_count":12,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-20T17:11:54.459Z","etag":null,"topics":["pyqt","pyqt-examples","pyqt-toast","pyqt-tutorial","pyqt5","pyqt5-examples","pyqt5-gui","pyqt5-toast","pyqt5-tools","pyqt5-tutorial","python","python3","python37","qt","qt-toast","toast"],"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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-25T01:14:44.000Z","updated_at":"2024-05-23T01:30:35.000Z","dependencies_parsed_at":"2024-10-23T00:30:02.797Z","dependency_job_id":null,"html_url":"https://github.com/yjg30737/pyqt-toast","commit_stats":{"total_commits":71,"total_committers":1,"mean_commits":71.0,"dds":0.0,"last_synced_commit":"c7811a66edef43390e5b33d9b78bde7e4b886b85"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjg30737%2Fpyqt-toast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjg30737%2Fpyqt-toast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjg30737%2Fpyqt-toast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjg30737%2Fpyqt-toast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yjg30737","download_url":"https://codeload.github.com/yjg30737/pyqt-toast/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232276057,"owners_count":18498369,"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":["pyqt","pyqt-examples","pyqt-toast","pyqt-tutorial","pyqt5","pyqt5-examples","pyqt5-gui","pyqt5-toast","pyqt5-tools","pyqt5-tutorial","python","python3","python37","qt","qt-toast","toast"],"created_at":"2024-09-24T14:05:51.890Z","updated_at":"2025-01-03T01:23:06.879Z","avatar_url":"https://github.com/yjg30737.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyqt-toast\nPyQt Toast (Small message displayed on the screen, visible for a short time)\n\n## Help Wanted\nIf you are good at PyQt, i kindly ask you to make setDuration work :) \n\n## Requirements\nPyQt5 \u003e= 5.14\n\n## Setup\n`python -m pip install pyqt-toast`\n\n## Usage\n* ```Toast(text='This is toast', duration=3, parent=self)``` - Constructor. Giving ```parent``` argument to ```self``` value helps toast to maintain its place after window got moved. \n\n\u003cb\u003eNote:\u003c/b\u003e You have to declare this one time as a class variable at initializing point(e.g. ```__initUi```) or else new one will pop up even though last one is still showing.\n* `setPosition(pos: QPoint)` - Place center of the toast at the given position.\n* `setFont(font: QFont)` - Set the font of text in toast. Toast's size will be automatically changed based on text's size.\n* `setForegroundColor(color)` - Set the text(foreground) color. `color` argument can be both `str`(6-digits hex color string), `QColor` types.\n* `setBackgroundColor(color)` - Set the background color. `color` argument can be both `str`(6-digits hex color string), `QColor` types.\n* `setOpacity(opacity: float)` - Set the opacity of toast.\n* `setDuration(duration: int)` - Set the duration of toast. - This doesn't work currently ..\n* `setAlignment(alignment)` - Set the alignment of text.\n\n## Example\nCode Sample\n```python\nfrom PyQt5.QtWidgets import QWidget, QApplication, QPushButton, QGridLayout\n\nfrom pyqt_toast import Toast\n\n\nclass ToastExample(QWidget):\n    def __init__(self):\n        super().__init__()\n        self.__initUi()\n\n    def __initUi(self):\n        btn = QPushButton('Krabby Patty secret formula')\n        self.__toast = Toast(text='The Krabby Patty formula is the sole property of the Krusty Krab and is only to be discussed in part or in whole with its creator Mr. Krabs. Duplication of this formula is punishable by law. Restrictions apply, results may vary.', duration=3, parent=self)\n        btn.clicked.connect(self.__toast.show)\n        lay = QGridLayout()\n        lay.addWidget(btn)\n        self.setLayout(lay)\n\n\nif __name__ == \"__main__\":\n    import sys\n\n    app = QApplication(sys.argv)\n    toastExample = ToastExample()\n    toastExample.show()\n    app.exec_()\n```\n\nResult\n\nhttps://user-images.githubusercontent.com/55078043/163155105-371e5d88-8b77-4a25-90cc-5c461f841762.mp4\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyjg30737%2Fpyqt-toast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyjg30737%2Fpyqt-toast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyjg30737%2Fpyqt-toast/lists"}