{"id":23002860,"url":"https://github.com/likianta/declare-qml","last_synced_at":"2025-10-06T09:50:42.906Z","repository":{"id":111982117,"uuid":"308869654","full_name":"likianta/declare-qml","owner":"likianta","description":"Introduce QML-like declarative structure to Python world. Developer writes only pure Python code for QML.","archived":false,"fork":false,"pushed_at":"2021-10-28T11:08:11.000Z","size":1796,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T14:22:29.692Z","etag":null,"topics":["declarative-programming","enaml","pyml","python-gui","qml","qml-alternative","qtquick","reactive-gui"],"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/likianta.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":"2020-10-31T11:47:09.000Z","updated_at":"2024-11-18T16:17:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"ca7f867a-c56f-4962-9da1-654261a47669","html_url":"https://github.com/likianta/declare-qml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/likianta/declare-qml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likianta%2Fdeclare-qml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likianta%2Fdeclare-qml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likianta%2Fdeclare-qml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likianta%2Fdeclare-qml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/likianta","download_url":"https://codeload.github.com/likianta/declare-qml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likianta%2Fdeclare-qml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278591239,"owners_count":26012027,"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-10-06T02:00:05.630Z","response_time":65,"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":["declarative-programming","enaml","pyml","python-gui","qml","qml-alternative","qtquick","reactive-gui"],"created_at":"2024-12-15T07:12:28.494Z","updated_at":"2025-10-06T09:50:42.889Z","avatar_url":"https://github.com/likianta.png","language":"Python","readme":"\u003e NOTE: English version is not complete yet, here is the Chinese version README.\n\n\u003e WIP: This project is in a very early stage. Any proposals and issues are welcomed!\n\n# Declare-PySide | 声明式 PySide 界面库\n\n`declare-pyside` 可以让开发者以 \"声明式\" 的纯 Python 语法编写可视化界面框架. 借助 Qt 强大的图形表达能力和 Python 简洁直观的嵌套式语法结构, 您将以全新的方式创造现代化的用户图形界面.\n\n`declare-pyside` 在以下方面具有显著优势:\n\n**1. 声明式的语法**\n\n下面两张图分别展示了命令式语法 (左图) 和声明式语法 (右图) 的表现方式:\n\n[TODO]\n\n**2. 健全的类型提示系统**\n\n[TODO]\n\n**3. 调用方式的优化**\n\n[TODO]\n\n**4. 热重载**\n\n[TODO]\n\n# 快速开始\n\n`declare-pyside` 的组件基于 QML 组件生成. 如果您之前是 QML 开发者, 那么这个库的上手难度会小很多.\n\n```py\nfrom declare_pyside import *\nfrom declare_pyside.widgets import *\nfrom lk_lambdex import lambdex\n\n\"\"\" Description\n\n- Two lines of text are center in window.\n- A button is under text lines.\n- Click button to update text1's text and font size.\n- The text2's text is synchronized to text1's text, but font size stayed.\n\"\"\"\n\nwith Application() as app:\n\n    with Window() as win:\n        win.width = 600\n        win.height = 400\n        win.color = '#F2F2F2'\n        win.visible = True\n        \n        with Text() as txt1:\n            txt1.anchors.center_in = win\n            txt1.font.pixel_size = 12\n        \n        with Text() as txt2:\n            txt2.anchors.top = txt1.bottom\n            txt2.text.bind(txt1.text)\n            txt2.font.pixel_size.kiss(txt1.font.pixel_size)\n            \n        with Button() as btn:\n            btn.anchors.top = txt2.bottom\n            btn.text = 'Update Text'\n            btn.clicked.connect(lambdex('', \"\"\"\n                txt1.text += '!'\n                txt1.font.pixel_size += 1\n            \"\"\"))\n```\n\n[TODO]\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flikianta%2Fdeclare-qml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flikianta%2Fdeclare-qml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flikianta%2Fdeclare-qml/lists"}