pyqt-templates


Namepyqt-templates JSON
Version 0.1.6 PyPI version JSON
download
home_pagehttps://github.com/centroid457/
Summarypyqt help examples and some other useful objects (overloaded pyqt classes)
upload_time2024-10-16 13:26:15
maintainerNone
docs_urlNone
authorAndrei Starichenko
requires_python>=3.6
licenseNone
keywords pyqt pyqt templates pyqt guide pyqt usage pyqt examples pyqt usage examples pyqt help pyqt help examples pyqt signals pyqt highlighter
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Ver/TestedPython](https://img.shields.io/pypi/pyversions/pyqt_templates)
![Ver/Os](https://img.shields.io/badge/os_development-Windows-blue)  
![repo/Created](https://img.shields.io/github/created-at/centroid457/pyqt_templates)
![Commit/Last](https://img.shields.io/github/last-commit/centroid457/pyqt_templates)
![Tests/GitHubWorkflowStatus](https://github.com/centroid457/pyqt_templates/actions/workflows/test_linux.yml/badge.svg)
![Tests/GitHubWorkflowStatus](https://github.com/centroid457/pyqt_templates/actions/workflows/test_windows.yml/badge.svg)  
![repo/Size](https://img.shields.io/github/repo-size/centroid457/pyqt_templates)
![Commit/Count/t](https://img.shields.io/github/commit-activity/t/centroid457/pyqt_templates)
![Commit/Count/y](https://img.shields.io/github/commit-activity/y/centroid457/pyqt_templates)
![Commit/Count/m](https://img.shields.io/github/commit-activity/m/centroid457/pyqt_templates)

# pyqt_templates (current v0.1.6/![Ver/Pypi Latest](https://img.shields.io/pypi/v/pyqt_templates?label=pypi%20latest))

## DESCRIPTION_SHORT
pyqt help examples and some other useful objects (overloaded pyqt classes)

## DESCRIPTION_LONG
Designed for ...


## Features
1. good template for TableView/Model/Signals  


********************************************************************************
## License
See the [LICENSE](LICENSE) file for license rights and limitations (MIT).


## Release history
See the [HISTORY.md](HISTORY.md) file for release history.


## Installation
```commandline
pip install pyqt-templates
```


## Import
```python
from pyqt_templates import *
```


********************************************************************************
## USAGE EXAMPLES
See tests, sourcecode and docstrings for other examples.  

------------------------------
### 1. template-1=IMPORT_BEST.py
```python
import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
```

------------------------------
### 2. template-2=QAPP_in_cls.py
```python
import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *

from typing import *


# =====================================================================================================================
pass


# =====================================================================================================================
class Gui(QWidget):
    TITLE: str = "[GUI] Universal"
    _QAPP: QApplication = QApplication([])

    def __init__(self):
        super().__init__()

        self.wgt_create()
        self.wgt_main__apply_settings()
        self.slots_connect()

        # GUI SHOW ----------------------------------------------------------------------------------------------------
        self.show()
        exit_code = self._QAPP.exec_()
        if exit_code == 0:
            print(f"[OK]GUI({exit_code=})closed correctly")
        else:
            print(f"[FAIL]GUI({exit_code=})closed INCORRECTLY")
        sys.exit(exit_code)

    def wgt_main__apply_settings(self) -> None:
        # MAIN WINDOW -------------------------------------------------------------------------------------------------
        self.setWindowTitle(self.TITLE)

        self.setMinimumSize(300, 100)
        # self.setMinimumWidth(300)
        # self.setMinimumHeight(100)

        self.resize(300, 100)

    def wgt_create(self) -> None:
        # GRID --------------------------------------------------------------------------------------------------------
        layout_grid = QGridLayout()
        layout_grid.setSpacing(2)
        layout_grid.addWidget(QLabel("STLINK"), 0, 0)
        layout_grid.addWidget(QLabel("0"), 0, 1)
        layout_grid.addWidget(QLabel("1"), 0, 2)

        # START -------------------------------------------------------------------------------------------------------
        self.btn_start = QPushButton("START")
        self.btn_start.setCheckable(True)

        # layout ------------------------------------------------------------------------------------------------------
        layout_main = QVBoxLayout()
        layout_main.addLayout(layout_grid)
        layout_main.addWidget(self.btn_start)
        self.setLayout(layout_main)

    def slots_connect(self) -> None:
        self.btn_start.toggled.connect(self.btn_toggled)

    def btn_toggled(self, _state: Optional[bool] = None) -> None:
        print(f"btn {_state=}")


# =====================================================================================================================
if __name__ == '__main__':
    Gui()


# =====================================================================================================================
```

********************************************************************************

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/centroid457/",
    "name": "pyqt-templates",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "pyqt, pyqt templates, pyqt guide, pyqt usage, pyqt examples, pyqt usage examples, pyqt help, pyqt help examples, pyqt signals, pyqt highlighter",
    "author": "Andrei Starichenko",
    "author_email": "centroid@mail.ru",
    "download_url": "https://files.pythonhosted.org/packages/2d/0d/d04c41394f5b439273fe6add9de6a9157dbc6ff5be1ac78ac705094792d5/pyqt_templates-0.1.6.tar.gz",
    "platform": null,
    "description": "![Ver/TestedPython](https://img.shields.io/pypi/pyversions/pyqt_templates)\r\n![Ver/Os](https://img.shields.io/badge/os_development-Windows-blue)  \r\n![repo/Created](https://img.shields.io/github/created-at/centroid457/pyqt_templates)\r\n![Commit/Last](https://img.shields.io/github/last-commit/centroid457/pyqt_templates)\r\n![Tests/GitHubWorkflowStatus](https://github.com/centroid457/pyqt_templates/actions/workflows/test_linux.yml/badge.svg)\r\n![Tests/GitHubWorkflowStatus](https://github.com/centroid457/pyqt_templates/actions/workflows/test_windows.yml/badge.svg)  \r\n![repo/Size](https://img.shields.io/github/repo-size/centroid457/pyqt_templates)\r\n![Commit/Count/t](https://img.shields.io/github/commit-activity/t/centroid457/pyqt_templates)\r\n![Commit/Count/y](https://img.shields.io/github/commit-activity/y/centroid457/pyqt_templates)\r\n![Commit/Count/m](https://img.shields.io/github/commit-activity/m/centroid457/pyqt_templates)\r\n\r\n# pyqt_templates (current v0.1.6/![Ver/Pypi Latest](https://img.shields.io/pypi/v/pyqt_templates?label=pypi%20latest))\r\n\r\n## DESCRIPTION_SHORT\r\npyqt help examples and some other useful objects (overloaded pyqt classes)\r\n\r\n## DESCRIPTION_LONG\r\nDesigned for ...\r\n\r\n\r\n## Features\r\n1. good template for TableView/Model/Signals  \r\n\r\n\r\n********************************************************************************\r\n## License\r\nSee the [LICENSE](LICENSE) file for license rights and limitations (MIT).\r\n\r\n\r\n## Release history\r\nSee the [HISTORY.md](HISTORY.md) file for release history.\r\n\r\n\r\n## Installation\r\n```commandline\r\npip install pyqt-templates\r\n```\r\n\r\n\r\n## Import\r\n```python\r\nfrom pyqt_templates import *\r\n```\r\n\r\n\r\n********************************************************************************\r\n## USAGE EXAMPLES\r\nSee tests, sourcecode and docstrings for other examples.  \r\n\r\n------------------------------\r\n### 1. template-1=IMPORT_BEST.py\r\n```python\r\nimport sys\r\nfrom PyQt5.QtCore import *\r\nfrom PyQt5.QtGui import *\r\nfrom PyQt5.QtWidgets import *\r\n```\r\n\r\n------------------------------\r\n### 2. template-2=QAPP_in_cls.py\r\n```python\r\nimport sys\r\nfrom PyQt5.QtCore import *\r\nfrom PyQt5.QtGui import *\r\nfrom PyQt5.QtWidgets import *\r\n\r\nfrom typing import *\r\n\r\n\r\n# =====================================================================================================================\r\npass\r\n\r\n\r\n# =====================================================================================================================\r\nclass Gui(QWidget):\r\n    TITLE: str = \"[GUI] Universal\"\r\n    _QAPP: QApplication = QApplication([])\r\n\r\n    def __init__(self):\r\n        super().__init__()\r\n\r\n        self.wgt_create()\r\n        self.wgt_main__apply_settings()\r\n        self.slots_connect()\r\n\r\n        # GUI SHOW ----------------------------------------------------------------------------------------------------\r\n        self.show()\r\n        exit_code = self._QAPP.exec_()\r\n        if exit_code == 0:\r\n            print(f\"[OK]GUI({exit_code=})closed correctly\")\r\n        else:\r\n            print(f\"[FAIL]GUI({exit_code=})closed INCORRECTLY\")\r\n        sys.exit(exit_code)\r\n\r\n    def wgt_main__apply_settings(self) -> None:\r\n        # MAIN WINDOW -------------------------------------------------------------------------------------------------\r\n        self.setWindowTitle(self.TITLE)\r\n\r\n        self.setMinimumSize(300, 100)\r\n        # self.setMinimumWidth(300)\r\n        # self.setMinimumHeight(100)\r\n\r\n        self.resize(300, 100)\r\n\r\n    def wgt_create(self) -> None:\r\n        # GRID --------------------------------------------------------------------------------------------------------\r\n        layout_grid = QGridLayout()\r\n        layout_grid.setSpacing(2)\r\n        layout_grid.addWidget(QLabel(\"STLINK\"), 0, 0)\r\n        layout_grid.addWidget(QLabel(\"0\"), 0, 1)\r\n        layout_grid.addWidget(QLabel(\"1\"), 0, 2)\r\n\r\n        # START -------------------------------------------------------------------------------------------------------\r\n        self.btn_start = QPushButton(\"START\")\r\n        self.btn_start.setCheckable(True)\r\n\r\n        # layout ------------------------------------------------------------------------------------------------------\r\n        layout_main = QVBoxLayout()\r\n        layout_main.addLayout(layout_grid)\r\n        layout_main.addWidget(self.btn_start)\r\n        self.setLayout(layout_main)\r\n\r\n    def slots_connect(self) -> None:\r\n        self.btn_start.toggled.connect(self.btn_toggled)\r\n\r\n    def btn_toggled(self, _state: Optional[bool] = None) -> None:\r\n        print(f\"btn {_state=}\")\r\n\r\n\r\n# =====================================================================================================================\r\nif __name__ == '__main__':\r\n    Gui()\r\n\r\n\r\n# =====================================================================================================================\r\n```\r\n\r\n********************************************************************************\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "pyqt help examples and some other useful objects (overloaded pyqt classes)",
    "version": "0.1.6",
    "project_urls": {
        "Homepage": "https://github.com/centroid457/",
        "Source": "https://github.com/centroid457/pyqt_templates"
    },
    "split_keywords": [
        "pyqt",
        " pyqt templates",
        " pyqt guide",
        " pyqt usage",
        " pyqt examples",
        " pyqt usage examples",
        " pyqt help",
        " pyqt help examples",
        " pyqt signals",
        " pyqt highlighter"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "95f05a0a24d91a6b54708e8b6f2943dbbc72876fbdacd18b73fe98b70c14ef36",
                "md5": "2a7a11475b307aa825ff310557f95d46",
                "sha256": "500da8f63a5be6646392e5475b3bfccb4bbffdc4f376d6f969f8e508ca7623cd"
            },
            "downloads": -1,
            "filename": "pyqt_templates-0.1.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2a7a11475b307aa825ff310557f95d46",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 25154,
            "upload_time": "2024-10-16T13:26:14",
            "upload_time_iso_8601": "2024-10-16T13:26:14.650319Z",
            "url": "https://files.pythonhosted.org/packages/95/f0/5a0a24d91a6b54708e8b6f2943dbbc72876fbdacd18b73fe98b70c14ef36/pyqt_templates-0.1.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2d0dd04c41394f5b439273fe6add9de6a9157dbc6ff5be1ac78ac705094792d5",
                "md5": "6b1d64d286b87ddd7a440a4835b80b2d",
                "sha256": "2fca6945ccbb9b5522b91d4faf6dae237bcc43af15b8f8701000e450ef16af9d"
            },
            "downloads": -1,
            "filename": "pyqt_templates-0.1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "6b1d64d286b87ddd7a440a4835b80b2d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 25367,
            "upload_time": "2024-10-16T13:26:15",
            "upload_time_iso_8601": "2024-10-16T13:26:15.982674Z",
            "url": "https://files.pythonhosted.org/packages/2d/0d/d04c41394f5b439273fe6add9de6a9157dbc6ff5be1ac78ac705094792d5/pyqt_templates-0.1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-16 13:26:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "centroid457",
    "github_project": "pyqt_templates",
    "github_not_found": true,
    "lcname": "pyqt-templates"
}
        
Elapsed time: 0.44586s