pyqt-templates


Namepyqt-templates JSON
Version 0.0.8 PyPI version JSON
download
home_pagehttps://github.com/centroid457/
Summarypyqt help examples and some other useful objects (overloaded pyqt classes)
upload_time2024-03-29 12:58:55
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
VCS
bugtrack_url
requirements pytest requirements-checker object-info funcs-aux PyQt5
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyqt_templates (v0.0.8)

## 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 and sourcecode 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",
    "author": "Andrei Starichenko",
    "author_email": "centroid@mail.ru",
    "download_url": "https://files.pythonhosted.org/packages/7d/44/da08bfb6b303d6d60f74bd23f025d15f6fe51b52b8edac9897f46094d68b/pyqt_templates-0.0.8.tar.gz",
    "platform": null,
    "description": "# pyqt_templates (v0.0.8)\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 and sourcecode 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.0.8",
    "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"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "494a2e19e197841f2dd22e4e13d9690a54c86f49cf6d24a20e35752b1fcafcf7",
                "md5": "6a42d830b70203bc16ac2f901a02dee8",
                "sha256": "c3c10274da8f810707c3753fcb5740849538b6d53baf10c8dfc61fbcdc653a68"
            },
            "downloads": -1,
            "filename": "pyqt_templates-0.0.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6a42d830b70203bc16ac2f901a02dee8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 15689,
            "upload_time": "2024-03-29T12:58:53",
            "upload_time_iso_8601": "2024-03-29T12:58:53.949430Z",
            "url": "https://files.pythonhosted.org/packages/49/4a/2e19e197841f2dd22e4e13d9690a54c86f49cf6d24a20e35752b1fcafcf7/pyqt_templates-0.0.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7d44da08bfb6b303d6d60f74bd23f025d15f6fe51b52b8edac9897f46094d68b",
                "md5": "e1b728128cf18db5886b614074fb0240",
                "sha256": "a5feb2556825d2ff78f2d31eb915224a01f43293ac461886a6971dd0ba4ebf58"
            },
            "downloads": -1,
            "filename": "pyqt_templates-0.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "e1b728128cf18db5886b614074fb0240",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 14738,
            "upload_time": "2024-03-29T12:58:55",
            "upload_time_iso_8601": "2024-03-29T12:58:55.911639Z",
            "url": "https://files.pythonhosted.org/packages/7d/44/da08bfb6b303d6d60f74bd23f025d15f6fe51b52b8edac9897f46094d68b/pyqt_templates-0.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-29 12:58:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "centroid457",
    "github_project": "pyqt_templates",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "pytest",
            "specs": []
        },
        {
            "name": "requirements-checker",
            "specs": []
        },
        {
            "name": "object-info",
            "specs": []
        },
        {
            "name": "funcs-aux",
            "specs": []
        },
        {
            "name": "PyQt5",
            "specs": []
        }
    ],
    "lcname": "pyqt-templates"
}
        
Elapsed time: 0.21591s