diff --git a/en/schema-object/index.html b/en/schema-object/index.html index 41e211d..ddec75b 100755 --- a/en/schema-object/index.html +++ b/en/schema-object/index.html @@ -2738,7 +2738,7 @@
下面是一个相对完整的示例,展示了如何使用show_schema_object_editor()
来编辑一个结构化对象:
下面是一个相对完整的示例,展示了如何使用show_schema_object_panel()
来编辑一个结构化对象:
from typing import Any, Dict
from qtpy.QtWidgets import QWidget
diff --git a/schema-object/index.html b/schema-object/index.html
index 002b68f..50204a2 100755
--- a/schema-object/index.html
+++ b/schema-object/index.html
@@ -2736,7 +2736,7 @@
下面是一个相对完整的示例,展示了如何使用show_schema_object_editor()
来编辑一个结构化对象:
下面是一个相对完整的示例,展示了如何使用show_schema_object_panel()
来编辑一个结构化对象:
from typing import Any, Dict
from qtpy.QtWidgets import QWidget
diff --git a/search/search_index.json b/search/search_index.json
index 5891f49..5f1d640 100755
--- a/search/search_index.json
+++ b/search/search_index.json
@@ -1 +1 @@
-{"config":{"lang":["en","zh"],"separator":"[\\s\\u200b\\u3000\\-\u3001\u3002\uff0c\uff0e\uff1f\uff01\uff1b]+","pipeline":["stemmer"]},"docs":[{"location":"","title":"\u9996\u9875","text":""},{"location":"#_1","title":"\uff08\u4e00\uff09\u7b80\u4ecb","text":"PyGUIAdapter
\u662f\u4e00\u4e2a\u7528\u4e8e\u5feb\u901f\u6784\u5efa\u56fe\u5f62\u7528\u6237\u754c\u9762\u7684Python\u5e93\uff0c\u53ea\u9700\u6781\u5c11\u7684\u4ee3\u7801\uff0c\u5c31\u53ef\u4ee5\u5c06\u51e0\u4e4e\u4efb\u610fPython\u51fd\u6570\u65e0\u7f1d\u8f6c\u5316\u4e3a\u56fe\u5f62\u7528\u6237\u754c\u9762\uff0c\u5927\u5927\u7b80\u5316\u4e86GUI\u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u53d1\u8fc7\u7a0b\u3002
PyGUIAdapter
\u7684\u6838\u5fc3\u7406\u5ff5\u662f\uff0c\u4ee5\u5c3d\u53ef\u80fd\u201c\u65e0\u611f\u201d\u548c\u201c\u4f4e\u4fb5\u5165\u6027\u201d\u7684\u65b9\u5f0f\uff0c\u5e2e\u52a9\u5f00\u53d1\u8005\u521b\u5efa\u7528\u6237\u754c\u9762\uff0c\u4f7f\u5f00\u53d1\u8005\u80fd\u591f\u4e13\u6ce8\u4e8e\u6838\u5fc3\u529f\u80fd\u7684\u5b9e\u73b0\uff0c\u800c\u4e0d\u5fc5\u5c06\u7cbe\u529b\u5206\u6563\u5230\u590d\u6742\u3001\u7e41\u7410\u7684GUI\u7f16\u7a0b\u4e0a\uff0c\u4ece\u800c\u5c3d\u53ef\u80fd\u964d\u4f4e\u5f00\u53d1\u8005\u7684\u5b66\u4e60\u6210\u672c\u548c\u5fc3\u667a\u8d1f\u62c5\u3002
"},{"location":"#_2","title":"\uff08\u4e8c\uff09 \u9002\u7528\u573a\u666f","text":"PyGUIAdapter
\u4e0e\u201c\u8f93\u5165\uff08Input\uff09-\u5904\u7406\uff08Process\uff09-\u8f93\u51fa\uff08Output\uff09
\u201d\u7a0b\u5e8f\u8bbe\u8ba1\u6a21\u5f0f\u9ad8\u5ea6\u5951\u5408\uff0c\u56e0\u6b64\u5176\u7279\u522b\u9002\u7528\u4e8e\u4ee5\u4e0b\u51e0\u79cd\u5f00\u53d1\u573a\u666f\uff1a
- \u5de5\u5177\u7c7b\u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u53d1
- \u5c06\u73b0\u6709
CLI
\u7a0b\u5e8f\u5feb\u901f\u8fc1\u79fb\u5230\u56fe\u5f62\u754c\u9762
\u4e0b\u9762\u662fPython\u5b98\u65b9\u6587\u6863\u7ed9\u51fa\u7684\u4e00\u4e2a\u4f7f\u7528argparse
\u521b\u5efa\u547d\u4ee4\u884c\u7684\u4f8b\u5b50\uff1a
import argparse\nparser = argparse.ArgumentParser(description='Process some integers.')\nparser.add_argument('integers', metavar='N', type=int, nargs='+',\n help='an integer for the accumulator')\nparser.add_argument('--sum', dest='accumulate', action='store_const',\n const=sum, default=max,\n help='sum the integers (default: find the max)')\n\nargs = parser.parse_args()\nprint(args.accumulate(args.integers))\n
\u501f\u52a9PyGUIAdapter
\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u7528\u6781\u5c11\u7684\u4ee3\u7801\u5c06\u5176\u8f6c\u6362\u6210GUI\u7a0b\u5e8f\u3002\u800c\u4e14\u5f00\u53d1\u8005\u518d\u4e5f\u65e0\u9700\u5c06\u5927\u91cf\u7cbe\u529b\u82b1\u8d39\u5728\u547d\u4ee4\u884c\u53c2\u6570\u7684\u8bbe\u8ba1\u548c\u5904\u7406\u4e0a\uff1a
from typing import List, Literal\nfrom pyguiadapter.adapter import GUIAdapter\n\n\ndef process_integers(\n integers: List[int], operation: Literal[\"sum\", \"max\"] = \"max\"\n) -> int:\n \"\"\"\n Process some integers.\n\n @param integers: integers for the accumulator\n @param operation: sum the integers (default: find the max)\n \"\"\"\n func = max if operation == \"max\" else sum\n return func(integers)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(process_integers)\n adapter.run()\n
"},{"location":"#_3","title":"\uff08\u4e09\uff09\u7279\u6027","text":" - \u4f7f\u7528\u7b80\u5355\uff0c\u5f00\u53d1\u5feb\u901f\uff0c\u53ef\u4ee5\u7528\u6781\u5c11\u4ee3\u7801\u5b8c\u6210\u56fe\u5f62\u7528\u6237\u754c\u9762\u521b\u5efa\uff0c\u5b66\u4e60\u6210\u672c\u4f4e\uff0c\u5fc3\u667a\u8d1f\u62c5\u5c0f\u3002
- \u4e30\u5bcc\u7684\u5185\u7f6e\u63a7\u4ef6\u7c7b\u578b\uff0c\u5b9e\u73b0\u4e86\u8fd130\u79cd\u5185\u7f6e\u63a7\u4ef6\uff0c\u57fa\u672c\u5b9e\u73b0\u5f00\u7bb1\u5373\u7528\u3002
- \u6240\u6709Python\u7684\u57fa\u672c\u6570\u636e\u7c7b\u578b\u5747\u5b9e\u73b0\u4e86\u5bf9\u5e94\u8f93\u5165\u63a7\u4ef6\u3002
- \u6269\u5c55\u4e86\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff0c\u5b9a\u4e49\u4e86\u5927\u91cf\u8bed\u4e49\u5316\u7c7b\u578b\u5e76\u5b9e\u73b0\u4e86\u4e13\u7528\u63a7\u4ef6\uff0c\u65b9\u4fbf\u7528\u6237\u8f93\u5165\u65e5\u671f\u3001\u65f6\u95f4\u3001\u989c\u8272\u3001\u6587\u4ef6\u8def\u5f84\u7b49\u7279\u6b8a\u5bf9\u8c61\u3002
- \u5b9e\u73b0\u4e86\u901a\u7528\u5bf9\u8c61\u8f93\u5165\u63a7\u4ef6\uff0c\u652f\u6301\u8f93\u5165
Json\u5bf9\u8c61
\u548c\u4efb\u610fPython\u5b57\u9762\u91cf\u5bf9\u8c61
\uff08\u5305\u62ecint
\u3001float
\u3001bool
\u3001str
\u3001bytes
\u3001list
\u3001tuple
\u3001set
\u3001dict
\uff09\uff0c\u8d4b\u4e88\u4e86\u7528\u6237\u8f93\u5165\u4efb\u610f\u590d\u6742\u6570\u636e\u7684\u80fd\u529b\u3002
- \u9ad8\u53ef\u6269\u5c55\u6027\uff0c\u63d0\u4f9b\u4e86\u81ea\u5b9a\u4e49\u63a7\u4ef6\u63a5\u53e3\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u5f88\u65b9\u4fbf\u5730\u4e3a\u81ea\u5b9a\u4e49\u6570\u636e\u7c7b\u578b\u5b9e\u73b0\u4e13\u7528\u8f93\u5165\u63a7\u4ef6\u3002
- \u9ad8\u7075\u6d3b\u6027\u3002\u63a7\u4ef6\u4e0e\u7a97\u53e3\u5b9a\u4e49\u4e86\u5927\u91cf\u53ef\u914d\u7f6e\u5c5e\u6027\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u7075\u6d3b\u5730\u8c03\u6574\u63a7\u4ef6\u53ca\u7a97\u53e3\u7684\u5916\u89c2\u3001\u6837\u5f0f\u3001\u884c\u4e3a\uff0c\u63d0\u5347\u7528\u6237\u4f53\u9a8c\u3002
- \u652f\u6301\u4f7f\u7528\u4f7f\u7528\u6837\u5f0f\u8868\uff08
QSS
\uff09\u5b9a\u5236\u754c\u9762\u98ce\u683c\uff0c\u540c\u65f6\u63a5\u5165\u73b0\u6709\u7b2c\u4e09\u65b9\u754c\u9762\u7f8e\u5316\u5e93\u3002 - \u652f\u6301\u6dfb\u52a0\u7a97\u53e3\u83dc\u5355\u680f\u3001\u5de5\u5177\u680f\u3002
- \u652f\u6301\u76d1\u542c\u7a97\u53e3\u4e8b\u4ef6\u3002
- \u652f\u6301\u52a8\u6001\u4fee\u6539\u63a7\u4ef6\uff0c\u4e3a\u6784\u5efa\u590d\u6742\u5e94\u7528\u63d0\u4f9b\u4e86\u53ef\u80fd\u3002
- \u57fa\u4e8e
qtpy
\u62bd\u8c61\u5c42\uff0c\u4e0d\u4f9d\u8d56\u7279\u5b9aQt\u7ed1\u5b9a\u5e93\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u9700\u8981\u53ef\u81ea\u7531\u9009\u62e9PyQt5
\u3001PyQt6
\u3001PySide2
\u3001PySide2
\u3002 - \u754c\u9762\u5e95\u5c42\u4f7f\u7528
Qt
\uff0c\u517c\u5bb9\u6027\u597d\uff0c\u76f8\u6bd4webview\u7c7b
\u65b9\u6848\uff0c\u7cfb\u7edf\u8d44\u6e90\u5360\u7528\u66f4\u5c0f\u3002 - \u7eafPython\uff0c\u8de8\u5e73\u53f0\u7b80\u5355\u3002
"},{"location":"basic-types/","title":"\u57fa\u7840\u7c7b\u578b\u4e0e\u63a7\u4ef6","text":""},{"location":"basic-types/#int","title":"\uff08\u4e00\uff09int
\u7c7b\u578b","text":""},{"location":"basic-types/#1","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" IntSpinBox
- \u5916\u89c2
"},{"location":"basic-types/#2","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aIntSpinBoxConfig
"},{"location":"basic-types/#3","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import IntSpinBoxConfig\n\n\ndef int_example(arg1: int, arg2: int, arg3: int = 100) -> int:\n \"\"\"\n A simple example for **int** and **IntSpinBox**\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @return:\n\n @params\n # parameter widget config for arg1\n [arg1]\n default_value = -100\n min_value = -100\n max_value = 100\n\n # parameter widget config for arg2\n [arg2]\n default_value = 1000\n max_value = 999\n prefix = \"$\"\n\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n return arg1 + arg2 + arg3\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n int_example,\n widget_configs={\n # parameter config for arg3\n \"arg3\": IntSpinBoxConfig(\n default_value=100, min_value=0, max_value=1000, step=10, prefix=\"$\"\n )\n },\n )\n adapter.run()\n
"},{"location":"basic-types/#float","title":"\uff08\u4e8c\uff09float
\u7c7b\u578b","text":""},{"location":"basic-types/#1_1","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" FloatSpinBox
- \u5916\u89c2
"},{"location":"basic-types/#2_1","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aFloatSpinBoxConfig
"},{"location":"basic-types/#3_1","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import FloatSpinBoxConfig\n\n\ndef float_example(float_arg1: float, float_arg2: float, float_arg3: float = 3.14):\n \"\"\"\n example for **float** and **FloatSpinBox**\n\n @param float_arg1: this parameter is configured in docstring , see `@params ... @end` block below\n @param float_arg2: this parameter is configured with `run()` via a FloatSpinBoxConfig object\n @param float_arg3: this parameter is configured with `run()` via a dict instance\n @return:\n\n @params\n [float_arg1]\n default_value = 1.0\n max_value = 100.0\n step = 2.0\n decimals = 3\n prefix = \"r: \"\n suffix = \"%\"\n\n @end\n\n \"\"\"\n uprint(\"float_arg1\", float_arg1)\n uprint(\"float_arg2\", float_arg2)\n uprint(\"float_arg3\", float_arg3)\n return float_arg1 + float_arg2 + float_arg3\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n\n float_arg2_config = FloatSpinBoxConfig(\n default_value=-0.5, max_value=1.0, step=0.000005, decimals=5, prefix=\"R: \"\n )\n\n adapter.add(\n float_example,\n widget_configs={\n \"float_arg2\": float_arg2_config,\n \"float_arg3\": {\n # this will override the default_value in the function signature\n \"default_value\": 1,\n \"max_value\": 2.0,\n \"step\": 0.00001,\n \"decimals\": 5,\n },\n },\n )\n adapter.run()\n
"},{"location":"basic-types/#bool","title":"\uff08\u4e09\uff09bool
\u7c7b\u578b","text":""},{"location":"basic-types/#1_2","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" BoolBox
- \u5916\u89c2
"},{"location":"basic-types/#2_2","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aBoolBoxConfig
"},{"location":"basic-types/#3_2","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import BoolBoxConfig\n\n\ndef bool_example(\n bool_arg1: bool = False, bool_arg2: bool = True, bool_arg3: bool = False\n):\n \"\"\"\n example for type **bool** and **BoolBox** widget\n\n @param bool_arg1: this parameter will be configured in docstring\n @param bool_arg2: this parameter will be configured with **adapter.run()** via a BoolBoxConfig object\n @param bool_arg3: this parameter will be configured with **adapter.run()** via a dict\n @return:\n\n @params\n [bool_arg1]\n # this will override the default value defined in the function signature\n default_value = true\n true_text = \"On\"\n false_text = \"Off\"\n true_icon = \"fa.toggle-on\"\n false_icon = \"fa.toggle-off\"\n vertical = false\n @end\n \"\"\"\n uprint(bool_arg1, bool_arg2, bool_arg3)\n return bool_arg1, bool_arg2, bool_arg3\n\n\nif __name__ == \"__main__\":\n\n bool_arg2_conf = {\n # this will override the default value defined in the function signature\n \"default_value\": True,\n \"true_text\": \"Enable\",\n \"false_text\": \"Disable\",\n \"true_icon\": \"fa.toggle-on\",\n \"false_icon\": \"fa.toggle-off\",\n \"vertical\": True,\n }\n\n bool_arg3_conf = BoolBoxConfig(\n # this will override the default value defined in the function signature\n default_value=True,\n true_text=\"true\",\n false_text=\"false\",\n vertical=False,\n )\n\n adapter = GUIAdapter()\n adapter.add(\n bool_example,\n widget_configs={\"bool_arg2\": bool_arg2_conf, \"bool_arg3\": bool_arg3_conf},\n )\n adapter.run()\n
"},{"location":"basic-types/#str","title":"\uff08\u56db\uff09str
\u7c7b\u578b","text":""},{"location":"basic-types/#1_3","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" LineEdit
- \u5916\u89c2
"},{"location":"basic-types/#2_3","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aLineEditConfig
"},{"location":"basic-types/#3_3","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import LineEditConfig, LineEdit\n\n\ndef str_example(\n str_arg1: str = \"arg1\",\n str_arg2: str = \"arg2\",\n str_arg3: str = \"arg3\",\n str_arg4: str = \"arg4\",\n str_arg5: str = \"arg5\",\n):\n \"\"\"\n example for type **str** and **LineEdit** widget\n\n @param str_arg1: this parameter will be configured in docstring\n @param str_arg2: this parameter will be configured in docstring\n @param str_arg3: this parameter will be configured in docstring\n @param str_arg4: this parameter will be configured with adapter.run() via a LineEditConfig object\n @param str_arg5: this parameter will be configured with adapter.run() via a dict\n @return:\n\n @params\n [str_arg1]\n # override the default value of str_arg1 defined in the function signature\n default_value = \"123456\"\n clear_button = true\n max_length = 5\n frame = false\n\n [str_arg2]\n input_mask = \"000.000.000.000;_\"\n\n [str_arg3]\n default_value = \"\"\n placeholder = \"this is a placeholder text\"\n\n\n @end\n\n \"\"\"\n uprint(\"str_example\")\n uprint(\"str_arg1:\", str_arg1)\n uprint(\"str_arg2:\", str_arg2)\n uprint(\"str_arg3:\", str_arg3)\n uprint(\"str_arg4:\", str_arg4)\n uprint(\"str_arg5:\", str_arg5)\n return str_arg1 + str_arg2 + str_arg3 + str_arg4 + str_arg5\n\n\nif __name__ == \"__main__\":\n\n str_arg4_conf = LineEditConfig(\n # override the default value of str_arg4 defined in the function signature\n default_value=\"this is a readonly text\",\n readonly=False,\n echo_mode=LineEdit.PasswordEchoOnEditMode,\n )\n\n str_arg5_conf = {\n \"validator\": r\"^[a-zA-Z0-9]+$\",\n \"alignment\": LineEdit.AlignCenter,\n }\n\n adapter = GUIAdapter()\n adapter.add(\n str_example,\n widget_configs={\n \"str_arg4\": str_arg4_conf,\n \"str_arg5\": str_arg5_conf,\n },\n )\n adapter.run()\n
"},{"location":"basic-types/#list","title":"\uff08\u4e94\uff09list
\u7c7b\u578b","text":""},{"location":"basic-types/#1_4","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" ListEdit
- \u5916\u89c2
"},{"location":"basic-types/#2_4","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aListEditConfig
"},{"location":"basic-types/#3_4","title":"3\u3001\u793a\u4f8b","text":"from typing import List\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import ListEditConfig\n\n\ndef list_example(arg1: list, arg2: List, arg3: list):\n \"\"\"\n This is an example for **ListEdit** and list** types\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n arg3: description of arg3\n\n Returns:\n None\n\n @params\n [arg1]\n default_value = [1,2,3,4]\n\n [arg2]\n default_value = [\"a\", \"b\", 3, \"d\"]\n @end\n \"\"\"\n uprint(\"arg1: \", arg1)\n uprint(\"arg2: \", arg2)\n uprint(\"arg3: \", arg3)\n\n\nif __name__ == \"__main__\":\n arg3_conf = ListEditConfig(\n default_value=[1, 2, 3, 4, [\"a\", \"b\", 3, \"d\"]],\n # set editor_height or editor_width to 0 will hide the inplace editor\n editor_height=0,\n editor_width=0,\n )\n adapter = GUIAdapter()\n adapter.add(\n list_example,\n widget_configs={\"arg3\": arg3_conf},\n )\n adapter.run()\n
"},{"location":"basic-types/#tuple","title":"\uff08\u516d\uff09tuple
\u7c7b\u578b","text":""},{"location":"basic-types/#1_5","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" TupleEdit
- \u5916\u89c2
"},{"location":"basic-types/#2_5","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aTupleEditConfig
"},{"location":"basic-types/#3_5","title":"3\u3001\u793a\u4f8b","text":"from typing import Tuple\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import TupleEditConfig\n\n\ndef tuple_example(arg1: tuple, arg2: Tuple, arg3: tuple):\n \"\"\"\n This is an example for **TupleEdit** and **tuple** types\n\n Args:\n arg1: describes of arg1\n arg2: describes of arg2\n arg3: describes of arg3\n\n Returns:\n None\n \"\"\"\n uprint(\"arg1: \", arg1)\n uprint(\"arg2: \", arg2)\n uprint(\"arg3: \", arg3)\n\n\nif __name__ == \"__main__\":\n arg1_conf = TupleEditConfig(\n default_value=(1, 2, 3),\n )\n arg2_conf = {\n \"default_value\": (1, 2, 3, [1, 2, 3, 4]),\n }\n arg3_conf = TupleEditConfig(\n default_value=(1, 2, 3),\n label=\"Arg3\",\n # set editor_height or editor_width to 0 will hide the inplace editor\n editor_height=0,\n editor_width=0,\n )\n adapter = GUIAdapter()\n adapter.add(\n tuple_example,\n widget_configs={\n \"arg1\": arg1_conf,\n \"arg2\": arg2_conf,\n \"arg3\": arg3_conf,\n },\n )\n adapter.run()\n
"},{"location":"basic-types/#set","title":"\uff08\u4e03\uff09set
\u7c7b\u578b","text":""},{"location":"basic-types/#1_6","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" SetEdit
- \u5916\u89c2
"},{"location":"basic-types/#2_6","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aSetEditConfig
"},{"location":"basic-types/#3_6","title":"3\u3001\u793a\u4f8b","text":"from typing import Set, MutableSet\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import SetEditConfig\n\n\ndef set_example(arg1: set, arg2: Set, arg3: MutableSet):\n \"\"\"\n This is an example for **SetEdit** for **set** types.\n\n Args:\n arg1: description of arg1.\n arg2: description of arg2.\n arg3: description of arg3.\n\n Returns:\n None.\n \"\"\"\n uprint(\"arg1: \", arg1)\n uprint(\"arg2: \", arg2)\n uprint(\"arg3: \", arg3)\n\n\nif __name__ == \"__main__\":\n arg1_conf = SetEditConfig(\n default_value={1, 2, 3},\n )\n arg2_conf = SetEditConfig(\n default_value={\"a\", \"b\", 1, 2},\n )\n arg3_conf = {\n \"default_value\": {1, 2, 3, (1, 2, 3, 4)},\n }\n adapter = GUIAdapter()\n adapter.add(\n set_example,\n widget_configs={\n \"arg1\": arg1_conf,\n \"arg2\": arg2_conf,\n \"arg3\": arg3_conf,\n },\n )\n adapter.run()\n
"},{"location":"basic-types/#dict","title":"\uff08\u4e03\uff09dict
\u7c7b\u578b","text":""},{"location":"basic-types/#1_7","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" DictEdit
- \u5916\u89c2
"},{"location":"basic-types/#2_7","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aDictEditConfig
"},{"location":"basic-types/#3_7","title":"3\u3001\u793a\u4f8b","text":"from typing import Dict, Mapping, MutableMapping, TypedDict\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import DictEditConfig\n\n\nclass User(TypedDict):\n name: str\n age: int\n address: str\n email: str\n\n\ndef dict_example(\n arg1: dict, arg2: Dict, arg3: MutableMapping, arg4: Mapping, arg5: User\n):\n \"\"\"\n This is an example for **DictEdit** widget and **dict** types.\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n arg3: description of arg3\n arg4: description of arg4\n arg5: description of arg5\n\n Returns:\n None\n\n @params\n [arg1]\n default_value = {a=1,b=2,c=\"3\"}\n\n [arg2]\n default_value = {\"key1\"=\"value1\", \"key2\"=\"value2\"}\n\n @end\n \"\"\"\n uprint(\"arg1: \", arg1)\n uprint(\"arg2: \", arg2)\n uprint(\"arg3: \", arg3)\n uprint(\"arg4: \", arg4)\n uprint(\"arg5: \", arg5)\n\n\nif __name__ == \"__main__\":\n arg1_conf = DictEditConfig(\n default_value={\"a\": 1, \"b\": 2, \"c\": \"3\", \"d\": [1, 2, 3]},\n )\n arg3_conf = DictEditConfig(\n default_value={\"a\": \"A\", \"b\": \"B\"},\n )\n\n arg4_conf = DictEditConfig(\n default_value={\"c\": \"C\", \"d\": \"D\", \"e\": [1, 2, 3, 4]},\n )\n\n arg5_conf = DictEditConfig(\n default_value=User(\n name=\"John\", age=30, address=\"123 Main St\", email=\"john@example.com\"\n ),\n )\n\n adapter = GUIAdapter()\n adapter.add(\n dict_example,\n widget_configs={\n \"arg1\": arg1_conf,\n \"arg3\": arg3_conf,\n \"arg4\": arg4_conf,\n \"arg5\": arg5_conf,\n },\n )\n adapter.run()\n
"},{"location":"basic-types/#date","title":"\uff08\u516b\uff09date
\u7c7b\u578b","text":""},{"location":"basic-types/#1_8","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" DateEdit
- \u5916\u89c2
"},{"location":"basic-types/#2_8","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aDateEditConfig
"},{"location":"basic-types/#3_8","title":"3\u3001\u793a\u4f8b","text":"from datetime import date\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import DateEditConfig, DateEdit\n\n\ndef date_example(arg1: date, arg2: date, arg3: date):\n \"\"\"\n This is an example for **DateEdit** and **date** type.\n Args:\n arg1: description of arg1\n arg2: description of arg2\n arg3: description of arg3\n\n Returns:\n None\n\n @params\n [arg2]\n label = \"Argument 2\"\n display_format = \"yyyy-MM-dd\"\n @end\n\n \"\"\"\n uprint(\"arg1\", arg1)\n uprint(\"arg2\", arg2)\n uprint(\"arg3\", arg3)\n\n\nif __name__ == \"__main__\":\n arg1_conf = DateEditConfig(\n min_date=date(2023, 1, 1),\n max_date=date(2023, 12, 31),\n )\n arg3_conf = DateEditConfig(\n default_value=date(2023, 6, 1),\n min_date=date(2023, 1, 1),\n max_date=date(2023, 12, 31),\n calendar_popup=True,\n alignment=DateEdit.AlignCenter,\n time_spec=DateEdit.UTC,\n )\n adapter = GUIAdapter()\n adapter.add(\n date_example,\n widget_configs={\"arg1\": arg1_conf, \"arg3\": arg3_conf},\n )\n adapter.run()\n
"},{"location":"basic-types/#time","title":"\uff08\u4e5d\uff09time
\u7c7b\u578b","text":""},{"location":"basic-types/#1_9","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" TimeEdit
- \u5916\u89c2
"},{"location":"basic-types/#2_9","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aTimeEditConfig
"},{"location":"basic-types/#3_9","title":"3\u3001\u793a\u4f8b","text":"from datetime import time\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import TimeEditConfig, TimeEdit\nfrom pyguiadapter.widgets.basic.datetimeedit import TimeSpec\n\n\ndef time_example(arg1: time, arg2: time, arg3: time):\n \"\"\"\n This is an example for **TimeEdit** and **datetime.time** type.\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n arg3: description of arg3\n\n Returns:\n None\n\n @params\n [arg3]\n label = \"Argument 3\"\n display_format = \"HH\u5c0f\u65f6mm\u5206ss\u79d2\"\n\n @end\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n arg1_conf = TimeEditConfig(\n default_value=time(hour=12, minute=30),\n max_time=time(hour=23, minute=59),\n min_time=time(hour=0, minute=0),\n time_spec=TimeSpec.UTC,\n )\n arg2_conf = TimeEditConfig(\n default_value=time(hour=20, minute=30),\n max_time=time(hour=23, minute=59),\n min_time=time(hour=12, minute=0),\n alignment=TimeEdit.AlignCenter,\n )\n adapter = GUIAdapter()\n adapter.add(\n time_example,\n widget_configs={\"arg1\": arg1_conf, \"arg2\": arg2_conf},\n )\n adapter.run()\n
"},{"location":"basic-types/#datetime","title":"\uff08\u5341\uff09datetime
\u7c7b\u578b","text":""},{"location":"basic-types/#1_10","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" DateTimeEdit
- \u5916\u89c2
"},{"location":"basic-types/#2_10","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aDateTimeEditConfig
"},{"location":"basic-types/#3_10","title":"3\u3001\u793a\u4f8b","text":"from datetime import datetime\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import DateTimeEditConfig, DateTimeEdit\n\n\ndef datetime_example(arg1: datetime, arg2: datetime, arg3: datetime):\n \"\"\"\n This an example for **DateTimeEdit** widget and **datetime** type.\n\n Args:\n arg1: description of arg1.\n arg2: description of arg2.\n arg3: description of arg3.\n\n Returns:\n None.\n\n @params\n [arg2]\n label = \"Argument 2\"\n display_format = \"dd.MM.yyyy HH:mm:ss\"\n @end\n\n \"\"\"\n uprint(\"arg1\", arg1)\n uprint(\"arg2\", arg2)\n uprint(\"arg3\", arg3)\n\n\nif __name__ == \"__main__\":\n arg1_conf = DateTimeEditConfig(\n min_datetime=datetime(2023, 1, 1),\n max_datetime=datetime(2023, 12, 31),\n time_spec=DateTimeEdit.UTC,\n )\n arg3_conf = DateTimeEditConfig(\n default_value=datetime(2023, 6, 1, 12, 59, 59),\n min_datetime=datetime(2023, 1, 1),\n max_datetime=datetime(2023, 12, 31),\n alignment=DateTimeEdit.AlignCenter,\n calendar_popup=False,\n )\n adapter = GUIAdapter()\n adapter.add(\n datetime_example,\n widget_configs={\n \"arg1\": arg1_conf,\n \"arg3\": arg3_conf,\n },\n )\n adapter.run()\n
"},{"location":"basic-types/#typingliteral","title":"\uff08\u5341\u4e00\uff09typing.Literal
\u7c7b\u578b","text":""},{"location":"basic-types/#1_11","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" ExclusiveChoiceBox
- \u5916\u89c2
"},{"location":"basic-types/#2_11","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aExclusiveChoiceBoxConfig
"},{"location":"basic-types/#3_11","title":"3\u3001\u793a\u4f8b","text":"from typing import Literal\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import ExclusiveChoiceBoxConfig\n\n\nclass MyObj(object):\n def __init__(self, name: str):\n self._name = name\n\n def __str__(self):\n return self._name\n\n def __eq__(self, other):\n if isinstance(other, MyObj):\n return other._name == self._name\n return False\n\n def __hash__(self):\n return hash(self._name)\n\n\nmy_objects = [MyObj(\"obj1\"), MyObj(\"obj2\"), MyObj(\"obj3\")]\n\n\ndef literal_example(\n arg1: Literal[\"option1\", \"option2\", \"option3\"] = \"option2\",\n arg2: Literal[1, 2, 3, 4, 5] = 3,\n arg3: Literal[\"option1\", \"option2\", 1, 2, True, False] = 1,\n arg4: MyObj = my_objects[0],\n):\n \"\"\"\n This is an example for **ExclusiveChoiceBox** widget and **Literal** type hint.\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n arg3: description of arg3\n arg4: description of arg4\n\n Returns:\n None\n\n @params\n [arg3]\n columns = 2\n show_type_icon = true\n @end\n \"\"\"\n uprint(\"arg1: \", arg1)\n uprint(\"arg2: \", arg2)\n uprint(\"arg3: \", arg3)\n uprint(f\"arg4: {arg4}({type(arg4)})\")\n\n\nif __name__ == \"__main__\":\n arg4_conf = ExclusiveChoiceBoxConfig(\n default_value=my_objects[1],\n show_type_icon=True,\n choices=my_objects,\n object_icon=\"ei.asl\",\n )\n adapter = GUIAdapter()\n adapter.add(literal_example, widget_configs={\"arg4\": arg4_conf})\n adapter.run()\n
"},{"location":"basic-types/#enumenum","title":"\uff08\u5341\u4e8c\uff09enum.Enum
\u7c7b\u578b","text":""},{"location":"basic-types/#1_12","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" EnumSelect
- \u5916\u89c2
"},{"location":"basic-types/#2_12","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aEnumSelectConfig
"},{"location":"basic-types/#3_12","title":"3\u3001\u793a\u4f8b","text":"from enum import Enum\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.utils import qta_icon\nfrom pyguiadapter.widgets import EnumSelectConfig\n\n\nclass Weekday(Enum):\n MONDAY = 1\n TUESDAY = 2\n WEDNESDAY = 3\n THURSDAY = 4\n FRIDAY = 5\n SATURDAY = 6\n SUNDAY = 7\n\n\nclass Color(Enum):\n RED = 1\n GREEN = 2\n BLUE = 3\n\n\ndef enums_example(day_enums: Weekday, color_enums: Color = Color.GREEN):\n \"\"\"\n This is an example for type **enum** and **EnumSelect** widget.\n\n @param day_enums: Enums for week days\n @param color_enums: Enums for RGB colors\n @return:\n\n @params\n [day_enums]\n default_value = \"MONDAY\"\n icons = {\"MONDAY\"=\"mdi6.numeric-1-circle\", \"TUESDAY\"=\"mdi6.numeric-2-circle\"}\n\n @end\n\n \"\"\"\n uprint(day_enums)\n uprint(color_enums)\n\n\nif __name__ == \"__main__\":\n color_enums_conf = EnumSelectConfig(\n # this will override the default value defined in the function signature\n default_value=Color.BLUE,\n icons={\n # you can use the Enum value as the key to its icon\n \"RED\": qta_icon(\"mdi.invert-colors\", color=\"red\"),\n \"GREEN\": qta_icon(\"mdi.invert-colors\", color=\"green\"),\n \"BLUE\": qta_icon(\"mdi.invert-colors\", color=\"blue\"),\n # or you can use the Enum value itself as the key to its icon\n # Color.RED: qta_icon(\"mdi.invert-colors\", color=\"red\"),\n # Color.GREEN: qta_icon(\"mdi.invert-colors\", color=\"green\"),\n # Color.BLUE: qta_icon(\"mdi.invert-colors\", color=\"blue\"),\n },\n icon_size=(24, 24),\n )\n adapter = GUIAdapter()\n adapter.add(enums_example, widget_configs={\"color_enums\": color_enums_conf})\n adapter.run()\n
"},{"location":"basic-types/#typinganyobject","title":"\uff08\u5341\u4e09\uff09typing.Any
\u3001object
\u7c7b\u578b","text":""},{"location":"basic-types/#1_13","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" PyLiteralEdit
- \u5916\u89c2
"},{"location":"basic-types/#2_13","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aPyLiteralEditConfig
"},{"location":"basic-types/#3_13","title":"3\u3001\u793a\u4f8b","text":"from typing import Any, Union\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import PyLiteralEditConfig\n\n\ndef py_literal_example(arg1: Any, arg2: object, arg3: Union[int, str]):\n \"\"\"\n This is an example of **PyLiteralEdit** widget and **Any**, **object**, **Union** types\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n arg3: description of arg3\n\n Returns:\n None\n \"\"\"\n uprint(\"arg1: \", arg1, f\", type={type(arg1)}\")\n uprint(\"arg2: \", arg2, f\", type={type(arg2)}\")\n uprint(\"arg3: \", arg3, f\", type={type(arg3)}\")\n\n\nif __name__ == \"__main__\":\n # PyLiteralEdit support the PyLiteralType, which is a Union of:\n # bool, int, float, bytes, str, list, tuple, dict, set and NoneType.\n\n arg1_config = PyLiteralEditConfig(\n default_value=[1, 2, 3, 4],\n )\n arg2_config = PyLiteralEditConfig(\n default_value=(\"a\", \"b\", \"c\", \"d\"),\n )\n arg3_config = PyLiteralEditConfig(\n default_value={1, 2, 3},\n )\n adapter = GUIAdapter()\n adapter.add(\n py_literal_example,\n widget_configs={\n \"arg1\": arg1_config,\n \"arg2\": arg2_config,\n \"arg3\": arg3_config,\n },\n )\n adapter.run()\n
"},{"location":"cancel/","title":"\u53d6\u6d88\u51fd\u6570\u6267\u884c","text":""},{"location":"cancel/#_1","title":"\uff08\u4e00\uff09\u6982\u8ff0","text":"\u5728PyGUIAdapter
\u4e2d\uff0c\u5f00\u53d1\u8005\u7684\u51fd\u6570\u9ed8\u8ba4\u8fd0\u884c\u5728\u5355\u72ec\u7684\u4e00\u4e2a\u7ebf\u7a0b\u4e2d\uff08\u5f53\u524d\u7684\u5b9e\u73b0\uff09\uff0c\u8fd9\u6837\u7684\u8bbe\u8ba1\u4e3b\u8981\u662f\u4e3a\u4e86\u907f\u514d\u51fd\u6570\u957f\u65f6\u95f4\u6267\u884c\u963b\u585e\u4e3b\u7ebf\u7a0b\uff0c\u5bfc\u81f4\u754c\u9762\u5361\u6b7b\u3002\u5bf9\u4e8e\u957f\u65f6\u95f4\u8fd0\u884c\u7684\u51fd\u6570\uff0c\u5f00\u53d1\u8005\u53ef\u80fd\u5e0c\u671b\u8ba9\u7528\u6237\u5177\u5907\u53d6\u6d88\u771f\u6b63\u6267\u884c\u4e2d\u7684\u51fd\u6570\u7684\u80fd\u529b\u3002
\u4e3a\u4e86\u5b9e\u73b0\u53d6\u6d88\u51fd\u6570\u6267\u884c\u7684\u6548\u679c\uff0c\u4e00\u79cd\u7b80\u5355\u7c97\u66b4\u7684\u60f3\u6cd5\u662f\u76f4\u63a5\u7ec8\u7ed3\uff08terminate\uff09\u51fd\u6570\u8fd0\u884c\u7684\u90a3\u4e2a\u7ebf\u7a0b\uff0c\u4f46\u662f\u8fd9\u79cd\u505a\u6cd5\u5b58\u5728\u5f88\u5927\u7684\u9690\u60a3\uff0c\u8fd9\u79cd\u65b9\u6cd5\u65e0\u6cd5\u786e\u5b9a\u7ebf\u7a0b\u7ec8\u6b62\u65f6\u7684\u5177\u4f53\u72b6\u6001\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6570\u636e\u4e0d\u4e00\u81f4\u3001\u8d44\u6e90\u6cc4\u9732\u6216\u5176\u4ed6\u96be\u4ee5\u9884\u6d4b\u7684\u95ee\u9898\u3002\u6b63\u5e38\u7684\u505a\u6cd5\u662f\u901a\u8fc7\u8f6e\u8be2\u68c0\u67e5\u67d0\u4e2a\u6761\u4ef6\uff0c\u5728\u6ee1\u8db3\u6761\u4ef6\u65f6\u8ba9\u51fd\u6570\u8fd4\u56de\uff0c\u4ece\u800c\u8fbe\u5230\u7ebf\u7a0b\u6b63\u5e38\u7ed3\u675f\u7684\u6548\u679c\uff0cPyGUIAdapter
\u57fa\u4e8e\u8fd9\u4e00\u601d\u8def\uff0c\u5b9e\u73b0\u4e86\u4e00\u79cd\u79f0\u4e4b\u4e3a\u534f\u5546\u5f0f\u53d6\u6d88
\u7684\u51fd\u6570\u6267\u884c\u53d6\u6d88\u673a\u5236\u3002
\u6240\u8c13\u201c\u534f\u5546\u5f0f\u201d
\uff0c\u6307\u7684\u662f\u51fd\u6570\u7684\u53d6\u6d88\u5e76\u4e0d\u662f\u5fc5\u7136\u7684\uff0c\u7528\u6237\u53d6\u6d88\u51fd\u6570\u7684\u64cd\u4f5c\u88ab\u89c6\u4e3a\u4e00\u79cd\u201c\u8bf7\u6c42\u201d
\uff0c\u5f00\u53d1\u8005\u9700\u8981\u5728\u51fd\u6570\u4e2d\u624b\u52a8\u5904\u7406\u8fd9\u79cd\u8bf7\u6c42\uff0c\u5e76\u6839\u636e\u5177\u4f53\u7684\u60c5\u51b5\u505a\u51fa\u5904\u7406\u3002\u8fd9\u91cc\u8bf4\u7684\u5904\u7406\uff0c\u53ef\u4ee5\u662f\u201c\u540c\u610f\u8bf7\u6c42\uff0c\u7acb\u5373\u4ece\u51fd\u6570\u8fd4\u56de\u201d
\uff0c\u4e5f\u53ef\u4ee5\u662f\u201c\u540c\u610f\u8bf7\u6c42\uff0c\u6267\u884c\u67d0\u4e9b\u7279\u5b9a\u6b65\u9aa4\uff08\u6bd4\u5982\u8d44\u6e90\u6e05\u7406\uff09\u540e\u8fd4\u56de\u201d
\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u662f\u201c\u4e0d\u540c\u610f\u8bf7\u6c42\uff0c\u7ee7\u7eed\u6267\u884c\u51fd\u6570\u201d
\u3002\u6362\u8a00\u4e4b\uff0c\u7528\u6237\u5177\u6709\u53d6\u6d88\u51fd\u6570\u6267\u884c\u7684\u201c\u5efa\u8bae\u6743\u201d
\uff0c\u800c\u51fd\u6570\u662f\u5426\u53d6\u6d88\u7684\u201c\u51b3\u5b9a\u6743\u201d
\u4ecd\u7136\u5f52\u4e8e\u5f00\u53d1\u8005\u6216\u8005\u8bf4\u51fd\u6570\u672c\u8eab\u3002
"},{"location":"cancel/#_2","title":"\uff08\u4e8c\uff09\u65b9\u6cd5\u4e0e\u793a\u4f8b","text":"\u8981\u4f7f\u4e00\u4e2a\u51fd\u6570\u53ef\u4ee5\u88ab\u53d6\u6d88\uff0c\u9996\u5148\uff0c\u9700\u8981\u5728\u8c03\u7528GUIAdapter.add()
\u65f6\u4f20\u5165cancellable=True
\u3002\u6b64\u65f6\uff0c\u51fd\u6570\u6267\u884c\u7a97\u53e3\u7684\u64cd\u4f5c\u533a\u57df\u5c06\u663e\u793a\u4e00\u4e2a\u53d6\u6d88\u6309\u94ae\u3002\u7528\u6237\u901a\u8fc7\u6309\u4e0b\u6b64\u6309\u94ae\u6765\u5411\u51fd\u6570\u53d1\u51fa\u53d6\u6d88\u6267\u884c\u7684\u8bf7\u6c42\u3002
\u5728\u51fd\u6570\u4e2d\uff0c\u5f00\u53d1\u8005\u9700\u8981\u901a\u8fc7\u8c03\u7528ucontext.is_function_cancelled()
\u5b9a\u671f\u68c0\u67e5\u7528\u6237\u662f\u5426\u53d1\u51fa\u4e86\u53d6\u6d88\u51fd\u6570\u6267\u884c\u7684\u8bf7\u6c42\uff0c\u5e76\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u505a\u51fa\u5904\u7406\u3002
\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a
import time\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.ucontext import is_function_cancelled\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.windows.fnexec import FnExecuteWindowConfig\n\n\ndef cancel_function_example(target: int = 10, delay_per_iter: float = 0.5):\n \"\"\"\n @params\n [target]\n min_value = 1\n\n [delay_per_iter]\n min_value = 0.001\n step = 0.5\n decimals = 3\n\n @end\n \"\"\"\n for i in range(target):\n if is_function_cancelled():\n break\n uprint(\"process: \", i)\n time.sleep(delay_per_iter)\n uprint(\"done!\")\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n cancel_function_example,\n cancelable=True,\n window_config=FnExecuteWindowConfig(disable_widgets_on_execute=True),\n )\n adapter.run()\n
\u6548\u679c\u5982\u4e0b\uff1a
"},{"location":"custom-widget/","title":"WIP","text":""},{"location":"extend-types/","title":"\u6269\u5c55\u7c7b\u578b\u4e0e\u63a7\u4ef6","text":""},{"location":"extend-types/#text_t","title":"\uff08\u4e00\uff09text_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0","title":"0\u3001\u8bf4\u660e","text":"str
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u957f\u6587\u672c\uff08\u591a\u884c\u6587\u672c\uff09\u3002
"},{"location":"extend-types/#1","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" TextEdit
- \u5916\u89c2
"},{"location":"extend-types/#2","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aTextEditConfig
"},{"location":"extend-types/#3","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import text_t\nfrom pyguiadapter.widgets import TextEditConfig\n\n\ndef text_t_example(arg1: text_t, arg2: text_t, arg3: text_t = \"foo\") -> str:\n \"\"\"\n This is an example for **text_t** type hint and **TextEdit** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n @return:\n\n @params\n [arg1]\n default_value = \"Hello World\"\n\n [arg2]\n default_value = \"\u4f60\u597d\uff0c\u4e16\u754c\uff01\"\n\n @end\n \"\"\"\n assert isinstance(arg1, str)\n assert isinstance(arg2, str)\n assert isinstance(arg3, str)\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n return \"{};{};{}\".format(arg1, arg2, arg3)\n\n\nif __name__ == \"__main__\":\n\n arg3_conf = TextEditConfig(\n default_value=\"bar\",\n placeholder=\"Please input some text here!\",\n )\n\n adapter = GUIAdapter()\n adapter.add(\n text_t_example,\n widget_configs={\"arg3\": arg3_conf},\n )\n adapter.run()\n
"},{"location":"extend-types/#int_t","title":"\uff08\u4e8c\uff09int_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_1","title":"0\u3001\u8bf4\u660e","text":"int
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u7528\u4e8e\u63d0\u4f9bLineEdit
\u5f62\u5f0f\u7684\u8f93\u5165\u63a7\u4ef6\u3002
"},{"location":"extend-types/#1_1","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" IntLineEdit
- \u5916\u89c2
"},{"location":"extend-types/#2_1","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aIntLineEditConfig
"},{"location":"extend-types/#3_1","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import int_t\nfrom pyguiadapter.widgets import IntLineEditConfig\n\n\ndef int_t_example(arg1: int_t, arg2: int_t, arg3: int_t = 100) -> int:\n \"\"\"\n This is an example for **int_t** type hint and **IntLineEdit** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n @return:\n\n @params\n [arg1]\n default_value = -100\n min_value = -100\n max_value = 100\n\n [arg2]\n max_value = 999\n empty_value = -1\n\n @end\n \"\"\"\n assert isinstance(arg1, int)\n assert isinstance(arg2, int)\n assert isinstance(arg3, int)\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n return arg1 + arg2 + arg3\n\n\nif __name__ == \"__main__\":\n\n arg3_conf = IntLineEditConfig(\n default_value=-99,\n min_value=-100,\n max_value=100,\n empty_value=None,\n placeholder=\"Enter a number\",\n clear_button=True,\n )\n\n adapter = GUIAdapter()\n adapter.add(\n int_t_example,\n widget_configs={\"arg3\": arg3_conf},\n )\n adapter.run()\n
"},{"location":"extend-types/#float_t","title":"\uff08\u4e09\uff09float_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_2","title":"0\u3001\u8bf4\u660e","text":"float
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u7528\u4e8e\u63d0\u4f9bLineEdit
\u5f62\u5f0f\u7684\u8f93\u5165\u63a7\u4ef6\u3002
"},{"location":"extend-types/#1_2","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" FloatLineEdit
- \u5916\u89c2
"},{"location":"extend-types/#2_2","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aFloatLineEditConfig
"},{"location":"extend-types/#3_2","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import float_t\nfrom pyguiadapter.widgets import FloatLineEditConfig\n\n\ndef float_t_example(arg1: float_t, arg2: float_t, arg3: float_t = 100) -> float:\n \"\"\"\n This is an example for **float_t** type hint and **FloatLineEdit** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n @return:\n\n @params\n [arg1]\n default_value = -100.0\n min_value = -100.0\n max_value = 100.0\n\n [arg2]\n default_value = 99999999.0\n max_value = 99999999.0\n empty_value = -1.0\n decimals = 3\n scientific_notation = true\n\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n return arg1 + arg2 + arg3\n\n\nif __name__ == \"__main__\":\n\n arg3_conf = FloatLineEditConfig(\n default_value=-0.00005,\n min_value=-100.0,\n max_value=100.0,\n empty_value=None,\n decimals=5,\n scientific_notation=True,\n clear_button=True,\n placeholder=\"Enter a float value\",\n )\n\n adapter = GUIAdapter()\n adapter.add(\n float_t_example,\n widget_configs={\"arg3\": arg3_conf},\n )\n adapter.run()\n
"},{"location":"extend-types/#int_slider_t","title":"\uff08\u56db\uff09int_slider_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_3","title":"0\u3001\u8bf4\u660e","text":"int
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u7528\u4e8e\u63d0\u4f9bSlider\uff08\u6ed1\u52a8\u6761\uff09
\u5f62\u5f0f\u7684\u8f93\u5165\u63a7\u4ef6\u3002
"},{"location":"extend-types/#1_3","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" Slider
- \u5916\u89c2
"},{"location":"extend-types/#2_3","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aSliderConfig
"},{"location":"extend-types/#3_3","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import int_slider_t\nfrom pyguiadapter.widgets import SliderConfig\nfrom pyguiadapter.widgets.extend.slider import TickPosition\n\n\ndef int_slider_t_example(\n arg1: int_slider_t, arg2: int_slider_t, arg3: int_slider_t = 100\n) -> int:\n \"\"\"\n This is an example for **int_slider_t** type hint and **Slider** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n @return:\n\n @params\n [arg1]\n default_value = -100\n min_value = -100\n max_value = 100\n\n [arg2]\n max_value = 999\n single_step = 2\n tracking = false\n prefix = \"count: \"\n tick_interval = 10\n inverted_controls = true\n inverted_appearance = true\n\n @end\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n return arg1 + arg2 + arg3\n\n\nif __name__ == \"__main__\":\n\n arg3_conf = SliderConfig(\n default_value=-99,\n min_value=-100,\n max_value=100,\n tick_position=TickPosition.TicksAbove,\n tick_interval=2,\n single_step=1,\n page_step=10,\n suffix=\" mv\",\n )\n\n adapter = GUIAdapter()\n adapter.add(\n int_slider_t_example,\n widget_configs={\"arg3\": arg3_conf},\n )\n adapter.run()\n
"},{"location":"extend-types/#int_dial_t","title":"\uff08\u4e94\uff09int_dial_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_4","title":"0\u3001\u8bf4\u660e","text":"int
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u7528\u4e8e\u63d0\u4f9bDial\uff08\u62e8\u53f7\u76d8\uff09
\u5f62\u5f0f\u7684\u8f93\u5165\u63a7\u4ef6\u3002
"},{"location":"extend-types/#1_4","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" Dial
- \u5916\u89c2
"},{"location":"extend-types/#2_4","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aDialConfig
"},{"location":"extend-types/#3_4","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import int_dial_t\nfrom pyguiadapter.widgets import DialConfig\n\n\ndef int_dial_t_example(\n arg1: int_dial_t, arg2: int_dial_t, arg3: int_dial_t = 100\n) -> int:\n \"\"\"\n This is an example for **int_dial_t** type hint and **Dial** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n @return:\n\n @params\n [arg1]\n default_value = -100\n min_value = -100\n max_value = 100\n\n [arg2]\n max_value = 999\n single_step = 2\n tracking = false\n prefix = \"count: \"\n inverted_controls = true\n inverted_appearance = true\n\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n return arg1 + arg2 + arg3\n\n\nif __name__ == \"__main__\":\n\n arg3_conf = DialConfig(\n default_value=-99,\n min_value=-100,\n max_value=100,\n suffix=\" mv\",\n )\n\n adapter = GUIAdapter()\n adapter.add(int_dial_t_example, widget_configs={\"arg3\": arg3_conf})\n adapter.run()\n
"},{"location":"extend-types/#colot_hex_t","title":"\uff08\u516d\uff09colot_hex_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_5","title":"0\u3001\u8bf4\u660e","text":"str
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u989c\u8272\u503c\uff08\u5341\u516d\u8fdb\u5236\u5b57\u7b26\u4e32\uff09\u3002\u53ef\u4ee5\u8868\u793aRGB\u989c\u8272\u503c\uff0c\u5982#FFFFFF
\uff1b\u4e5f\u53ef\u4ee5\u8868\u793aRGBA\u989c\u8272\u503c\uff0c\u5982#FFFFFF80
\u3002
"},{"location":"extend-types/#1_5","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" ColorHexPicker
- \u5916\u89c2
"},{"location":"extend-types/#2_5","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aColorPickerConfig
"},{"location":"extend-types/#3_5","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import color_hex_t\nfrom pyguiadapter.widgets import ColorHexPickerConfig\n\n\ndef color_hex_t_example(\n arg1: color_hex_t,\n arg2: color_hex_t,\n arg3: color_hex_t = \"red\",\n):\n \"\"\"\n This is an example for type **color_hex_t** type hint and **ColorPicker** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg1]\n default_value = \"#aaffbb\"\n alpha_channel = false\n @end\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n arg2_conf = ColorHexPickerConfig(default_value=\"#effeedff\", alpha_channel=True)\n arg3_conf = ColorHexPickerConfig(display_color_name=False)\n adapter = GUIAdapter()\n adapter.add(\n color_hex_t_example, widget_configs={\"arg2\": arg2_conf, \"arg3\": arg3_conf}\n )\n adapter.run()\n
"},{"location":"extend-types/#colot_tuple_t","title":"\uff08\u4e03\uff09colot_tuple_t
\u7c7b\u578b","text":""},{"location":"extend-types/#1_6","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" ColorPicker
- \u5916\u89c2
"},{"location":"extend-types/#2_6","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aColorPickerConfig
"},{"location":"extend-types/#3_6","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import color_tuple_t\nfrom pyguiadapter.widgets import ColorTuplePickerConfig\n\n\ndef color_tuple_t_example(\n arg1: color_tuple_t,\n arg2: color_tuple_t,\n arg3: color_tuple_t = (125, 230, 156),\n):\n \"\"\"\n This is an example for type **color_tuple_t** type hint and **ColorPicker** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg1]\n default_value = [255,0, 126]\n alpha_channel = false\n @end\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n arg2_conf = ColorTuplePickerConfig(\n default_value=(25, 25, 25, 255), alpha_channel=True\n )\n arg3_conf = ColorTuplePickerConfig(display_color_name=False)\n adapter = GUIAdapter()\n adapter.add(\n color_tuple_t_example, widget_configs={\"arg2\": arg2_conf, \"arg3\": arg3_conf}\n )\n adapter.run()\n
"},{"location":"extend-types/#choice_t","title":"\uff08\u516b\uff09choice_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_6","title":"0\u3001\u8bf4\u660e","text":"object
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u7ec4\u786e\u5b9a\u5bf9\u8c61\u4e2d\u7684\u4e00\u4e2a\u5bf9\u8c61\uff0c\u63d0\u4f9bComboBox\uff08\u4e0b\u62c9\u5217\u8868\uff09
\u5f62\u5f0f\u7684\u8f93\u5165\u63a7\u4ef6\uff0c\u7528\u4e8e\u4ece\u4e00\u7ec4\u53ef\u9009\u9879\u4e2d\u9009\u62e9\u4efb\u610f\u4e00\u4e2a\u9009\u9879\u3002\u53ef\u9009\u9879\u53ef\u4ee5\u662f\u53ef\u4ee5\u5b9e\u73b0\u4e86__hash__
\u548c__eq__
\u65b9\u6cd5\u7684\u4efb\u4f55\u5bf9\u8c61\uff0c\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\u5b57\u7b26\u4e32\u3001\u6570\u5b57\u7b49\u3002
"},{"location":"extend-types/#1_7","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" ChoiceBox
- \u5916\u89c2
"},{"location":"extend-types/#2_7","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aChoiceBoxConfig
"},{"location":"extend-types/#3_7","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import choice_t\nfrom pyguiadapter.widgets import ChoiceBoxConfig\n\n\nclass MyObject(object):\n def __init__(self, name: str):\n self.name = name\n\n def __eq__(self, other):\n if not isinstance(other, MyObject):\n return False\n return self.name == other.name\n\n def __hash__(self):\n return hash(self.name)\n\n def __str__(self):\n # this method is very important\n # the return value will be displayed as the ChoiceBox's item\n return self.name\n\n\ndef choice_t_example(arg1: choice_t, arg2: choice_t, arg3: choice_t, arg4: choice_t):\n \"\"\"\n This is an example for type **choice_t** type hint and **ChoiceBox** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n @param arg4: description for arg4\n @return:\n\n @params\n [arg1]\n # choices can be a list of numbers\n choices = {\"A\"=1, \"B\"=2, \"C\"=3}\n\n @end\n \"\"\"\n uprint(\"arg1:\", arg1, f\", type: {type(arg1)}\")\n uprint(\"arg2:\", arg2, f\", type: {type(arg2)}\")\n uprint(\"arg3:\", arg3, f\", type: {type(arg3)}\")\n uprint(\"arg4:\", arg4, f\", type: {type(arg4)}\")\n\n\nif __name__ == \"__main__\":\n arg2_conf = ChoiceBoxConfig(\n default_value=\"opt2\",\n # choices can be a list of strings\n choices=[\"opt1\", \"opt2\", \"opt3\", \"opt4\"],\n editable=True,\n )\n\n obj1 = MyObject(\"apple\")\n obj2 = MyObject(\"banana\")\n obj3 = MyObject(\"orange\")\n\n arg3_conf = ChoiceBoxConfig(\n default_value=obj2,\n # choices can be a list of objects which have implemented __eq__ and __hash__ methods\n choices=[obj1, obj2, obj3],\n )\n\n arg4_conf = ChoiceBoxConfig(\n # choices can be a list of numbers\n choices={\"A\": 1, \"B\": 2, \"C\": 3},\n editable=True,\n add_user_input=False,\n )\n\n adapter = GUIAdapter()\n adapter.add(\n choice_t_example,\n widget_configs={\"arg2\": arg2_conf, \"arg3\": arg3_conf, \"arg4\": arg4_conf},\n )\n adapter.run()\n
"},{"location":"extend-types/#choices_t","title":"\uff08\u4e5d\uff09choices_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_7","title":"0\u3001\u8bf4\u660e","text":"list
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u7ec4\u53ef\u9009\u9879\u4e2d\u7684\u591a\u4e2a\u5bf9\u8c61\uff0c\u63d0\u4f9b\u4e00\u7ec4CheckBox\uff08\u590d\u9009\u6846\uff09
\u4f5c\u4e3a\u8f93\u5165\u63a7\u4ef6\uff0c\u7528\u4e8e\u4ece\u4e00\u7ec4\u53ef\u9009\u9879\u4e2d\u9009\u62e9\u591a\u4e2a\u9009\u9879\u3002\u53ef\u9009\u9879\u53ef\u4ee5\u662f\u53ef\u4ee5\u5b9e\u73b0\u4e86__hash__
\u548c__eq__
\u65b9\u6cd5\u7684\u4efb\u4f55\u5bf9\u8c61\uff0c\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\u5b57\u7b26\u4e32\u3001\u6570\u5b57\u7b49\u3002
"},{"location":"extend-types/#1_8","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" MultiChoiceBox
- \u5916\u89c2
"},{"location":"extend-types/#2_8","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aMultiChoiceBoxConfig
"},{"location":"extend-types/#3_8","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import choices_t\nfrom pyguiadapter.widgets import MultiChoiceBoxConfig\n\n\nclass MyObject(object):\n def __init__(self, name: str):\n self.name = name\n\n def __eq__(self, other):\n if not isinstance(other, MyObject):\n return False\n return self.name == other.name\n\n def __hash__(self):\n return hash(self.name)\n\n def __str__(self):\n # this method is very important\n # the return value will be displayed as the ChoiceBox's item\n return self.name\n\n\ndef choices_t_example(arg1: choices_t, arg2: choices_t, arg3: choices_t):\n \"\"\"\n This is an example for type **choices_t** type hint and **MultiChoiceBox** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg1]\n default_value = [\"opt1\", \"opt2\"]\n choices = [\"opt1\", \"opt2\", \"opt3\", \"opt4\", \"opt5\"]\n @end\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n arg2_conf = MultiChoiceBoxConfig(\n choices=[MyObject(\"foo\"), MyObject(\"bar\"), MyObject(\"baz\")]\n )\n arg3_conf = MultiChoiceBoxConfig(\n default_value=(1, 2, 3),\n choices={\n \"Option 1\": 1,\n \"Option 2\": 2,\n \"Option 3\": 3,\n \"Option 4\": 4,\n \"Option 5\": 5,\n },\n columns=2,\n )\n adapter = GUIAdapter()\n adapter.add(\n choices_t_example, widget_configs={\"arg2\": arg2_conf, \"arg3\": arg3_conf}\n )\n adapter.run()\n
"},{"location":"extend-types/#key_sequence_t","title":"\uff08\u5341\uff09key_sequence_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_8","title":"0\u3001\u8bf4\u660e","text":"str
\u6216List[str]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff08\u4ece\u63a7\u4ef6\u83b7\u53d6\u7684\u503c\u662fstr
\u7c7b\u578b\u8fd8\u662fList[str]
\u7c7b\u578b\uff0c\u7531KeySequenceEditConfig
\u7684return_type
\u5c5e\u6027\u51b3\u5b9a\uff09\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u6309\u952e\u5e8f\u5217\u3002
"},{"location":"extend-types/#1_9","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" KeySequenceEdit
- \u5916\u89c2
"},{"location":"extend-types/#2_9","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aKeySequenceEditConfig
"},{"location":"extend-types/#3_9","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import key_sequence_t\nfrom pyguiadapter.widgets import KeySequenceEditConfig, KeySequenceEdit\n\n\ndef key_sequence_t_example(\n arg1: key_sequence_t,\n arg2: key_sequence_t,\n arg3: key_sequence_t,\n):\n \"\"\"\n This is an example for type **key_sequence_t** type hint and **KeySequenceEdit** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg1]\n default_value = \"Ctrl+Shift+V\"\n\n @end\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n arg2_conf = KeySequenceEditConfig(default_value=\"Ctrl+Alt+D\")\n\n arg3_conf = KeySequenceEditConfig(\n default_value=\"Ctrl+Shift+T\",\n key_sequence_format=KeySequenceEdit.PortableText,\n return_type=\"list\",\n )\n adapter = GUIAdapter()\n adapter.add(\n key_sequence_t_example, widget_configs={\"arg2\": arg2_conf, \"arg3\": arg3_conf}\n )\n adapter.run()\n
"},{"location":"extend-types/#plain_dict_t","title":"\uff08\u5341\u4e00\uff09plain_dict_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_9","title":"0\u3001\u8bf4\u660e","text":"dict
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u666e\u901a\u5b57\u5178\uff0c\u6240\u8c13\u666e\u901a\u5b57\u5178\u662f\u6307\u952e\u503c\u5bf9\u7c7b\u578b\u6ee1\u8db3\uff1akey:str -> value: Union[str,int,float,bool,list,dict,None]\u7684\u5b57\u5178\u3002
"},{"location":"extend-types/#1_10","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" PlainDictEdit
- \u5916\u89c2
"},{"location":"extend-types/#2_10","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aPlainDictEditConfig
"},{"location":"extend-types/#3_10","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import PlainDictEditConfig\nfrom pyguiadapter.extend_types import plain_dict_t\n\n\ndef plain_dict_t_example(arg1: plain_dict_t, arg2: plain_dict_t, arg3: plain_dict_t):\n \"\"\"\n This is an example for type **plain_dict_t** type hint and **PlainDictEdit** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg3]\n default_value = {key1=1,key2=\"value\",key3=true,key4=[1,2,3.0]}\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1, \"type: \", type(arg1))\n uprint(\"arg2:\", arg2, \"type: \", type(arg2))\n uprint(\"arg3:\", arg3, \"type: \", type(arg3))\n\n\nif __name__ == \"__main__\":\n arg1_conf = PlainDictEditConfig(\n default_value={\n \"key1\": 1,\n \"key2\": \"value\",\n \"key3\": True,\n \"key4\": [1, 2, 3.0],\n \"key5\": None,\n \"key6\": {\"key7\": 1},\n }\n )\n arg2_conf = PlainDictEditConfig(\n default_value={\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer token123\",\n },\n key_header=\"Header\",\n value_header=\"Value\",\n vertical_header_visible=True,\n )\n adapter = GUIAdapter()\n adapter.add(\n plain_dict_t_example, widget_configs={\"arg1\": arg1_conf, \"arg2\": arg2_conf}\n )\n adapter.run()\n
"},{"location":"extend-types/#string_list_t","title":"\uff08\u5341\u4e8c\uff09string_list_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_10","title":"0\u3001\u8bf4\u660e","text":"List[str]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u5b57\u7b26\u4e32\u5217\u8868\u3002
"},{"location":"extend-types/#1_11","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" StringListEdit
- \u5916\u89c2
"},{"location":"extend-types/#2_11","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aStringListEditConfig
"},{"location":"extend-types/#3_11","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import StringListEditConfig\nfrom pyguiadapter.extend_types import string_list_t\n\n\ndef string_list_t_example(\n arg1: string_list_t,\n arg2: string_list_t,\n arg3: string_list_t,\n):\n \"\"\"\n This is an example for type **string_list_t** type hint and **StringListEdit** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg1]\n default_value = [\"a\", \"b\", \"c\", \"d\"]\n add_file = true\n add_dir = false\n file_filters = \"Python files(*.py);;Text files(*.txt)\"\n\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n arg2_conf = StringListEditConfig(add_file=False, add_dir=True)\n arg3_conf = StringListEditConfig(add_file=False, add_dir=False)\n adapter = GUIAdapter()\n adapter.add(\n string_list_t_example, widget_configs={\"arg2\": arg2_conf, \"arg3\": arg3_conf}\n )\n adapter.run()\n
"},{"location":"extend-types/#json_obj_t","title":"\uff08\u5341\u4e09\uff09json_obj_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_11","title":"0\u3001\u8bf4\u660e","text":"Union[str,int,float,bool,list,dict,None]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2aJSON\u5bf9\u8c61\u3002
"},{"location":"extend-types/#1_12","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" JsonEdit
- \u5916\u89c2
"},{"location":"extend-types/#2_12","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aJsonEditConfig
"},{"location":"extend-types/#3_12","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import JsonEditConfig\nfrom pyguiadapter.extend_types import json_obj_t\n\n\ndef json_obj_t_example(arg1: json_obj_t, arg2: json_obj_t, arg3: json_obj_t):\n \"\"\"\n This is an example for type **json_obj_t** type hint and **JsonEdit** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg3]\n default_value = true\n\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1, \"type: \", type(arg1))\n uprint(\"arg2:\", arg2, \"type: \", type(arg2))\n uprint(\"arg3:\", arg3, \"type: \", type(arg3))\n\n\nif __name__ == \"__main__\":\n arg1_conf = JsonEditConfig(default_value=[1, 2, 3, \"a\", \"b\", {\"a\": 1, \"b\": 2}])\n arg2_conf = JsonEditConfig(\n default_value={\"a\": 1, \"b\": 2},\n # height=0 or width=0 will make the inplace editor hidden.\n height=0,\n width=0,\n )\n adapter = GUIAdapter()\n adapter.add(\n json_obj_t_example, widget_configs={\"arg1\": arg1_conf, \"arg2\": arg2_conf}\n )\n adapter.run()\n
"},{"location":"extend-types/#directory_tdir_t","title":"\uff08\u5341\u56db\uff09directory_t
\u3001dir_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_12","title":"0\u3001\u8bf4\u660e","text":"str
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u76ee\u5f55\u8def\u5f84\u3002
"},{"location":"extend-types/#1_13","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" DirSelect
- \u5916\u89c2
"},{"location":"extend-types/#2_13","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aDirSelectConfig
"},{"location":"extend-types/#3_13","title":"3\u3001\u793a\u4f8b","text":"import os.path\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import directory_t, dir_t\nfrom pyguiadapter.widgets import DirSelectConfig\n\n\ndef directory_t_example(arg1: directory_t, arg2: directory_t, arg3: dir_t):\n \"\"\"\n This is an example for type **directory_t**(**dir_t**) type hint and **DirSelect** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg3]\n placeholder = \"select path\"\n dialog_title = \"Select Dir\"\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n arg1_conf = DirSelectConfig(\n placeholder=\"select save path\",\n dialog_title=\"Select Save Path\",\n )\n arg2_conf = DirSelectConfig(\n default_value=os.path.dirname(os.path.abspath(__file__)),\n start_dir=os.path.expanduser(\"~\"),\n clear_button=True,\n )\n adapter = GUIAdapter()\n adapter.add(\n directory_t_example, widget_configs={\"arg1\": arg1_conf, \"arg2\": arg2_conf}\n )\n adapter.run()\n
"},{"location":"extend-types/#file_t","title":"\uff08\u5341\u4e94\uff09file_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_13","title":"0\u3001\u8bf4\u660e","text":"str
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u6587\u4ef6\u8def\u5f84\u3002
"},{"location":"extend-types/#1_14","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" FileSelect
- \u5916\u89c2
"},{"location":"extend-types/#2_14","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aFileSelectConfig
"},{"location":"extend-types/#3_14","title":"3\u3001\u793a\u4f8b","text":"import os.path\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import FileSelectConfig\nfrom pyguiadapter.extend_types import file_t\n\n\ndef file_t_example(arg1: file_t, arg2: file_t, arg3: file_t):\n \"\"\"\n This is an example for type **file_t** type hint and **FileSelect** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg3]\n placeholder = \"input save path here\"\n save_file = true\n dialog_title = \"Save File\"\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n arg1_conf = FileSelectConfig(\n placeholder=\"input file path here\",\n filters=\"Text files(*.txt);;All files(*.*)\",\n dialog_title=\"Open File\",\n )\n arg2_conf = FileSelectConfig(\n default_value=os.path.abspath(__file__),\n start_dir=os.path.expanduser(\"~\"),\n clear_button=True,\n )\n adapter = GUIAdapter()\n adapter.add(file_t_example, widget_configs={\"arg1\": arg1_conf, \"arg2\": arg2_conf})\n adapter.run()\n
"},{"location":"extend-types/#files_t","title":"\uff08\u5341\u516d\uff09files_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_14","title":"0\u3001\u8bf4\u660e","text":"List[str]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u6587\u4ef6\u8def\u5f84\u5217\u8868\u3002
"},{"location":"extend-types/#1_15","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" MultiFileSelect
- \u5916\u89c2
"},{"location":"extend-types/#2_15","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aMultiFileSelectConfig
"},{"location":"extend-types/#3_15","title":"3\u3001\u793a\u4f8b","text":"import os.path\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import MultiFileSelectConfig\nfrom pyguiadapter.extend_types import files_t\n\n\ndef files_t_example(arg1: files_t, arg2: files_t, arg3: files_t):\n \"\"\"\n This is an example for type **files_t** type hint and **MultiFileSelect** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg3]\n placeholder = \"select files\"\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n arg1_conf = MultiFileSelectConfig(\n default_value=(\"a\", \"b\"),\n placeholder=\"input files here\",\n filters=\"Text files(*.txt);;All files(*.*)\",\n dialog_title=\"Open Files\",\n )\n arg2_conf = MultiFileSelectConfig(\n default_value=[os.path.abspath(__file__)],\n start_dir=os.path.expanduser(\"~\"),\n clear_button=True,\n )\n adapter = GUIAdapter()\n adapter.add(files_t_example, widget_configs={\"arg1\": arg1_conf, \"arg2\": arg2_conf})\n adapter.run()\n
"},{"location":"extend-types/#path_list_t","title":"\uff08\u5341\u4e03\uff09path_list_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_15","title":"0\u3001\u8bf4\u660e","text":"List[str]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u8def\u5f84\u5217\u8868\uff0c\u652f\u6301\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u548c\u6587\u4ef6\u5939\u8def\u5f84\u3002
"},{"location":"extend-types/#1_16","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" PathListEdit
- \u5916\u89c2
"},{"location":"extend-types/#2_16","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aPathListEditConfig
"},{"location":"extend-types/#3_16","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import path_list_t\nfrom pyguiadapter.widgets import PathListEdit, PathListEditConfig\n\n\ndef path_list_t_example(arg1: path_list_t, arg2: path_list_t, arg3: path_list_t):\n \"\"\"\n This is an example for **path_list_t** type hint and **PathListEdit** widget.\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n arg3: description of arg3\n\n Returns:\n \"\"\"\n uprint(arg1)\n uprint(arg2)\n uprint(arg3)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n path_list_t_example,\n widget_configs={\n \"arg1\": PathListEditConfig(\n add_files=True,\n add_dirs=True,\n file_filters=\"Python Files (*.py);;Json Files (*.json)\",\n text_elide_mode=PathListEdit.ElideNone,\n drag_n_drop=True,\n ),\n \"arg2\": PathListEditConfig(\n add_files=True,\n add_dirs=False,\n file_filters=\"Python Files (*.py);;Json Files (*.json)\",\n text_elide_mode=PathListEdit.ElideRight,\n drag_n_drop=True,\n ),\n \"arg3\": PathListEditConfig(\n add_files=False,\n add_dirs=True,\n text_elide_mode=PathListEdit.ElideLeft,\n drag_n_drop=True,\n ),\n },\n )\n adapter.run()\n
"},{"location":"extend-types/#file_list_t","title":"\uff08\u5341\u516b\uff09file_list_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_16","title":"0\u3001\u8bf4\u660e","text":"List[str]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u8def\u5f84\u5217\u8868\uff0c\u652f\u6301\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u3002
"},{"location":"extend-types/#1_17","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" FileListEdit
- \u5916\u89c2
"},{"location":"extend-types/#2_17","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aFileListEditConfig
"},{"location":"extend-types/#3_17","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import file_list_t\nfrom pyguiadapter.widgets import FileListEditConfig, FileListEdit\n\n\ndef file_list_t_example(arg1: file_list_t, arg2: file_list_t, arg3: file_list_t):\n \"\"\"\n This is an example for **file_list_t** type hint and **FileListEdit** widget.\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n arg3: description of arg3\n\n Returns:\n \"\"\"\n uprint(arg1)\n uprint(arg2)\n uprint(arg3)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n file_list_t_example,\n widget_configs={\n \"arg1\": FileListEditConfig(\n file_filters=\"Python Files (*.py);;Json Files (*.json)\",\n text_elide_mode=FileListEdit.ElideNone,\n drag_n_drop=True,\n ),\n \"arg2\": FileListEditConfig(\n file_filters=\"Python Files (*.py);;Json Files (*.json)\",\n text_elide_mode=FileListEdit.ElideRight,\n drag_n_drop=True,\n ),\n \"arg3\": FileListEditConfig(\n text_elide_mode=FileListEdit.ElideLeft,\n drag_n_drop=True,\n ),\n },\n )\n adapter.run()\n
"},{"location":"extend-types/#dir_list_t","title":"\uff08\u5341\u4e5d\uff09dir_list_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_17","title":"0\u3001\u8bf4\u660e","text":"List[str]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u8def\u5f84\u5217\u8868\uff0c\u652f\u6301\u6dfb\u52a0\u6587\u4ef6\u5939\u8def\u5f84\u3002
"},{"location":"extend-types/#1_18","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" DirectoryListEdit
- \u5916\u89c2
"},{"location":"extend-types/#2_18","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aDirectoryListEditConfig
"},{"location":"extend-types/#3_18","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import dir_list_t\nfrom pyguiadapter.widgets import DirectoryListEditConfig, DirectoryListEdit\n\n\ndef dir_list_t_example(arg1: dir_list_t, arg2: dir_list_t, arg3: dir_list_t):\n \"\"\"\n This is an example for **dir_list_t** type hint and **DirectoryListEdit** widget.\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n arg3: description of arg3\n\n Returns:\n \"\"\"\n uprint(arg1)\n uprint(arg2)\n uprint(arg3)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n dir_list_t_example,\n widget_configs={\n \"arg1\": DirectoryListEditConfig(\n text_elide_mode=DirectoryListEdit.ElideNone,\n drag_n_drop=True,\n ),\n \"arg2\": DirectoryListEditConfig(\n text_elide_mode=DirectoryListEdit.ElideRight,\n drag_n_drop=True,\n ),\n \"arg3\": DirectoryListEditConfig(\n text_elide_mode=DirectoryListEdit.ElideLeft,\n drag_n_drop=True,\n ),\n },\n )\n adapter.run()\n
"},{"location":"extend-types/#font_t","title":"\uff08\u4e8c\u5341\uff09font_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_18","title":"0\u3001\u8bf4\u660e","text":"str
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u5b57\u4f53\u540d\u79f0\uff0c\u63d0\u4f9b\u4e0b\u62c9\u6846\u4f9b\u7528\u6237\u9009\u62e9\u5f53\u524d\u7cfb\u7edf\u5df2\u5b89\u88c5\u5b57\u4f53\u3002
"},{"location":"extend-types/#1_19","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" FontSelect
- \u5916\u89c2
"},{"location":"extend-types/#2_19","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aFontSelectConfig
"},{"location":"extend-types/#3_19","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import font_t\nfrom pyguiadapter.widgets import FontSelectConfig, FontSelect\n\n\ndef font_t_example(arg1: font_t, arg2: font_t, arg3: font_t):\n \"\"\"\n This is an example for **font_t** type hint and **FontSelect** widget.\n\n Args:\n arg1: description of arg1.\n arg2: description of arg2.\n arg3: description of arg3.\n \"\"\"\n uprint(\"arg1: \", arg1)\n uprint(\"arg2: \", arg2)\n uprint(\"arg3: \", arg3)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n font_t_example,\n widget_configs={\n \"arg1\": FontSelectConfig(\n default_value=\"Arial\",\n font_filters=FontSelect.MonospacedFonts,\n ),\n \"arg2\": FontSelectConfig(\n font_filters=FontSelect.ProportionalFonts,\n ),\n \"arg3\": FontSelectConfig(\n font_filters=FontSelect.MonospacedFonts | FontSelect.ProportionalFonts,\n ),\n },\n )\n adapter.run()\n
"},{"location":"extend-types/#int_quantity_t","title":"\uff08\u4e8c\u5341\u4e00\uff09int_quantity_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_19","title":"0\u3001\u8bf4\u660e","text":"tuple
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u5177\u4f53\u4e3a\u4e00\u4e2a\u4e8c\u5143\u7d20\u5143\u7ec4Tuple[int, str | None]
\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u6574\u6570\u578b\u7684\u6570\u91cf
\uff08\u6240\u8c13\u6570\u91cf\u5373\u5e26\u5355\u4f4d\u7684\u91cf\uff09\uff0c\u7b2c\u4e00\u4e2a\u5143\u7d20\u4e3a\u6570\u91cf\u7684\u503c\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20\u4e3a\u6570\u91cf\u7684\u5355\u4f4d\u3002\u5b9e\u73b0\u4e86\u4e13\u95e8\u7684\u8f93\u5165\u63a7\u4ef6\uff0c\u5141\u8bb8\u7528\u6237\u8f93\u5165\u6570\u91cf\u7684\u503c\u548c\u9009\u62e9\u6570\u91cf\u7684\u5355\u4f4d\u3002
"},{"location":"extend-types/#1_20","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" IntQuantityBox
- \u5916\u89c2
"},{"location":"extend-types/#2_20","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aIntQuantityBoxConfig
"},{"location":"extend-types/#3_20","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import int_quantity_t, float_quantity_t\nfrom pyguiadapter.widgets import IntQuantityBoxConfig, FloatQuantityBoxConfig\n\n\ndef quantity_t_example(arg1: int_quantity_t, arg2: float_quantity_t):\n \"\"\"\n This is an example about **xxx_quantity_t** type hint and **XXXQuantityBox** widget.\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n \"\"\"\n uprint(\"arg1: \", arg1)\n uprint(\"arg2: \", arg2)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n quantity_t_example,\n widget_configs={\n \"arg1\": IntQuantityBoxConfig(\n default_value=(1, \"kg\"),\n units=[\"kg\", \"g\", \"mg\", \"\u00b5g\", \"ng\", \"pg\"],\n min_value=0,\n step=1,\n ),\n \"arg2\": FloatQuantityBoxConfig(\n default_value=(1.0, \"m\"),\n units=[\"m\", \"cm\", \"mm\", \"\u00b5m\", \"nm\", \"pm\"],\n min_value=0.0,\n max_value=1000.0,\n decimals=5,\n step=0.00001,\n ),\n },\n )\n adapter.run()\n
"},{"location":"extend-types/#float_quantity_t","title":"\uff08\u4e8c\u5341\u4e8c\uff09float_quantity_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_20","title":"0\u3001\u8bf4\u660e","text":"tuple
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u5177\u4f53\u4e3a\u4e00\u4e2a\u4e8c\u5143\u7d20\u5143\u7ec4Tuple[float, str | None]
\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u6d6e\u70b9\u578b\u7684\u6570\u91cf
\uff08\u6240\u8c13\u6570\u91cf\u5373\u5e26\u5355\u4f4d\u7684\u91cf\uff09\uff0c\u7b2c\u4e00\u4e2a\u5143\u7d20\u4e3a\u6570\u91cf\u7684\u503c\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20\u4e3a\u6570\u91cf\u7684\u5355\u4f4d\u3002\u5b9e\u73b0\u4e86\u4e13\u95e8\u7684\u8f93\u5165\u63a7\u4ef6\uff0c\u5141\u8bb8\u7528\u6237\u8f93\u5165\u6570\u91cf\u7684\u503c\u548c\u9009\u62e9\u6570\u91cf\u7684\u5355\u4f4d\u3002
"},{"location":"extend-types/#1_21","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" FloatQuantityBox
- \u5916\u89c2
"},{"location":"extend-types/#2_21","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aFloatQuantityBoxConfig
"},{"location":"extend-types/#3_21","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import int_quantity_t, float_quantity_t\nfrom pyguiadapter.widgets import IntQuantityBoxConfig, FloatQuantityBoxConfig\n\n\ndef quantity_t_example(arg1: int_quantity_t, arg2: float_quantity_t):\n \"\"\"\n This is an example about **xxx_quantity_t** type hint and **XXXQuantityBox** widget.\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n \"\"\"\n uprint(\"arg1: \", arg1)\n uprint(\"arg2: \", arg2)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n quantity_t_example,\n widget_configs={\n \"arg1\": IntQuantityBoxConfig(\n default_value=(1, \"kg\"),\n units=[\"kg\", \"g\", \"mg\", \"\u00b5g\", \"ng\", \"pg\"],\n min_value=0,\n step=1,\n ),\n \"arg2\": FloatQuantityBoxConfig(\n default_value=(1.0, \"m\"),\n units=[\"m\", \"cm\", \"mm\", \"\u00b5m\", \"nm\", \"pm\"],\n min_value=0.0,\n max_value=1000.0,\n decimals=5,\n step=0.00001,\n ),\n },\n )\n adapter.run()\n
"},{"location":"extend-types/#paths_t","title":"\uff08\u4e8c\u5341\u4e09\uff09paths_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_21","title":"0\u3001\u8bf4\u660e","text":"List[str]
\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u8868\u793a\u4e00\u7ec4\u8def\u5f84\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u529f\u80fd\u4e30\u5bcc\u7684\u5916\u7f6e\u8def\u5f84\u7f16\u8f91\u5668\uff0c\u901a\u8fc7\u8be5\u7f16\u8f91\u5668\uff0c\u7528\u6237\u53ef\u4ee5\u65b9\u4fbf\u5730\u7ba1\u7406\u4e00\u7ec4\u8def\u5f84\uff0c\u5305\u62ec\u6dfb\u52a0\u3001\u5220\u9664\u4ee5\u53ca\u6539\u53d8\u8def\u5f84\u7684\u987a\u5e8f\u3002
\u5728\u529f\u80fd\u4e0a\uff0cpaths_t
\u5728\u8bed\u4e49\u4e0a\u4e0epath_list_t
\u7c7b\u578b\u76f8\u540c\u3002\u4e8c\u8005\u7684\u533a\u522b\u4e3b\u8981\u5728\u4e8e\u53c2\u6570\u63a7\u4ef6\u3002paths_t
\u5bf9\u5e94\u7684\u53c2\u6570\u63a7\u4ef6\u4e3aPathsEditor
\uff0c \u800cpath_list_t
\u5bf9\u5e94\u7684\u53c2\u6570\u63a7\u4ef6\u4e3aPathListEdit
\u3002
\u4e4b\u6240\u4ee5\u8981\u5b9e\u73b0PathsEditor
\uff0c\u4e3b\u8981\u662f\u4e3a\u4e86\u5f25\u8865PathListEdit
\u5360\u7528\u7a7a\u95f4\u8fc7\u5927\u3001\u957f\u8def\u5f84\u663e\u793a\u4e0d\u5168\uff08\u9700\u8981\u6eda\u52a8\u6761\uff09\u4ee5\u53ca\u8def\u5f84\u64cd\u4f5c\u4e0d\u591f\u7075\u6d3b\uff08\u5982\u6392\u5e8f\u4e0d\u65b9\u4fbf\uff09\u7b49\u4e0d\u8db3\u3002 PathsEditor
\u662f\u4e00\u4e2a\u5916\u7f6e\u7684\u8def\u5f84\u7f16\u8f91\u5668\uff0c\u5b83\u5728\u63a7\u4ef6\u53c2\u6570\u63a7\u4ef6\u533a\u57df\u4ec5\u663e\u793a\u4e3a\u4e00\u4e2a\u6309\u94ae\uff0c\u56e0\u6b64\u5360\u7528\u7684\u7a7a\u95f4\u66f4\u5c0f\u3002\u540c\u65f6\uff0c\u5bf9\u4e8e\u8def\u5f84\u7684\u6dfb\u52a0\u3001\u5220\u9664\u3001\u4fee\u6539\u3001\u6392\u5e8f\u7b49\u64cd\u4f5c\uff0c PathsEditor
\u4e5f\u63d0\u4f9b\u4e86\u66f4\u52a0\u53cb\u597d\u548c\u76f4\u89c2\u7684\u64cd\u4f5c\u903b\u8f91\u3002
\u4e0b\u9762\u662f\u4e00\u7ec4\u76f4\u89c2\u7684\u5bf9\u6bd4\uff1a
"},{"location":"extend-types/#1_22","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" PathsEditor
- \u5916\u89c2
"},{"location":"extend-types/#2_22","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aPathsEditorConfig
"},{"location":"extend-types/#3_22","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import paths_t\n\n\ndef paths_t_example(arg1: paths_t, arg2: paths_t, arg3: paths_t):\n \"\"\"\n This is an example for **PathsEditor** for **paths_t** types.\n\n Args:\n arg1: description of arg1.\n arg2: description of arg2.\n arg3: description of arg3.\n\n Returns:\n None.\n\n @params\n [arg1]\n default_value = [\"/path/to/file1.txt\", \"/path/to/file2.txt\"]\n\n [arg2]\n add_dir = false\n\n [arg3]\n add_file = false\n\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(paths_t_example)\n adapter.run()\n
"},{"location":"icon_type/","title":"\u5173\u4e8e\u56fe\u6807","text":"\u5728PyGUIAdapter
\u4e2d\uff0c\u7edd\u5927\u591a\u6570\u9700\u8981\u5f00\u53d1\u8005\u63d0\u4f9b\u56fe\u6807\u7684\u5730\u65b9\uff0c\u90fd\u4f1a\u8981\u6c42\u5f00\u53d1\u8005\u4f20\u5165\u4e00\u4e2a\u7c7b\u578b\u4e3autils.IconType
\u7c7b\u578b\u7684\u5bf9\u8c61\u3002
\u5b9e\u9645\u4e0a\uff0cutils.IconType
\u662f\u4e00\u4e2a\u8054\u5408\u7c7b\u578b\u6216\u7c7b\u578b\u522b\u540d\uff0c\u5b83\u7b49\u4ef7\u4e8eUnion[str, Tuple[str, Union[list, dict]], QIcon, QPixmap, type(None)]
\u3002
PyGUIAdapter
\u5185\u90e8\u5c06\u901a\u8fc7utils.get_icon()
\u51fd\u6570\u5c06\u5f00\u53d1\u8005\u4f20\u5165\u8f6c\u5316\u4e3a\u5b9e\u9645\u7684QIcon
\u5bf9\u8c61\u3002
\u4e3a\u4e86\u65b9\u4fbf\u5f00\u53d1\u8005\u5feb\u901f\u5229\u7528\u73b0\u6709\u7684\u5b57\u4f53\u56fe\u6807\uff0c\u5982FontAwesome
\u3001Material Design Icons
\u7b49\uff0cPyGUIAdapter
\u96c6\u6210\u4e86qtawesome
\u5e93\u3002\u56e0\u6b64\u5728\u9700\u8981utils.IconType
\u7684\u573a\u5408\uff0c\u53ef\u4ee5\u4f20\u5165\u4e00\u4e2aqtawesome
\u652f\u6301\u7684\u56fe\u6807\u540d\u79f0\u5b57\u7b26\u4e32\u3002
\u53ef\u4ee5\u901a\u8fc7qtawesome
\u63d0\u4f9b\u7684\u56fe\u6807\u6d4f\u89c8\u5de5\u5177qta-browser
\u6765\u6d4f\u89c8\u548c\u590d\u5236\u5176\u6240\u652f\u6301\u7684\u56fe\u6807\u3002\u53ef\u4ee5\u901a\u8fc7\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u542f\u52a8qta-browser
\u5de5\u5177
qta-browser\n
\u5176\u754c\u9762\u5982\u4e0b\uff1a
\u5f00\u53d1\u8005\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4f20\u5165\u56fe\u6807\u6587\u4ef6\u7684\u8def\u5f84\uff0c\u5982\"/path/to/icon/icon.png\"
\uff0c\u6216\u8005Qt\u8d44\u6e90\u6587\u4ef6\uff08qrc
\uff09\u6587\u4ef6\u4e2d\u56fe\u6807\u7684\u8def\u5f84\uff0c\u5982\uff1a\":/path/to/icon/icon.png\"
\u3002
\u5f53\u4f20\u5165\u503c\u4e3aTuple[str, list|tuple]
\u7c7b\u578b\u65f6\uff0c\u60c5\u51b5\u66f4\u52a0\u590d\u6742\u4e00\u4e9b\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u7b2c\u4e00\u4e2a\u5143\u7d20\u5e94\u5f53\u662fqtawesome
\u652f\u6301\u7684\u56fe\u6807\u540d\u79f0\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20\u5219\u662fqtawesome.icon()
\u51fd\u6570\u7b2c\u4e00\u4e2a\u53c2\u6570\u4e4b\u540e\u7684\u5269\u4f59\u53c2\u6570\u3002\u4f8b\u5982\u5bf9\u4e8e\u4e0b\u9762\u793a\u4f8b\u4e2d\u7684my_icon
icon_options = {\n \"color\": \"blue\",\n \"color_active\": \"orange\"\n}\nmy_icon = (\"fa5s.music\", icon_options)\n
utils.get_icon()
\u5c06\u6309\u7167\u5982\u4e0b\u65b9\u5f0f\u8fdb\u884c\u5904\u7406\uff1a
import qtawesome as qta\n\ndef get_icon(src: IconType, *args, **kwargs) -> QIcon | None:\n ...\n if isinstance(src, tuple):\n assert len(src) >= 2\n assert isinstance(src[0], str) and isinstance(src[1], (dict, list))\n if isinstance(src[1], dict):\n return qta.icon(src[0], **src[1])\n else:\n return qta.icon(src[0], *src[1])\n else:\n raise ValueError(f\"invalid icon type: {type(src)}\")\n
utils.get_icon()
\u51fd\u6570\u7684\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a
def get_icon(src: IconType, *args, **kwargs) -> Optional[QIcon]:\n if src is None:\n return None\n if isinstance(src, QIcon):\n return src\n if isinstance(src, QPixmap):\n return QIcon(src)\n if isinstance(src, str):\n if os.path.isfile(src) or src.startswith(\":/\"):\n return QIcon(src)\n return qta.icon(src, *args, **kwargs)\n if isinstance(src, tuple):\n assert len(src) >= 2\n assert isinstance(src[0], str) and isinstance(src[1], (dict, list))\n if isinstance(src[1], dict):\n return qta.icon(src[0], **src[1])\n else:\n return qta.icon(src[0], *src[1])\n else:\n raise ValueError(f\"invalid icon type: {type(src)}\")\n
"},{"location":"license/","title":"\u5f00\u6e90\u8bb8\u53ef","text":"PyGUIAdapter
\u4f7f\u7528MIT
\u8bb8\u53ef\u534f\u8bae\u53d1\u5e03\u3002\u5f97\u76ca\u4e8eqtpy
\u7684\u62bd\u8c61\u80fd\u529b\uff0cPyGUIAdapter
\u672c\u8eab\u5e76\u4e0d\u4f9d\u8d56\u7279\u5b9aQt\u7ed1\u5b9a\u5e93\u3002 \u5f00\u53d1\u8005\u5728\u4f7f\u7528PyGUIAdapter
\u5f00\u53d1\u5e94\u7528\u7a0b\u5e8f\u65f6\uff0c\u82e5\u4f9d\u8d56\u7279\u5b9a\u7684Qt\u7ed1\u5b9a\u5e93\uff0c\u8fd8\u9700\u9075\u5b88\u6240\u9009\u7ed1\u5b9a\u5e93\u7684\u8bb8\u53ef\u534f\u8bae\u3002\u4f8b\u5982\uff1a
- \u82e5\u5f00\u53d1\u8005\u9009\u62e9\u4f7f\u7528
PySide2
\uff0c\u5219\u5176\u987b\u9075\u5b88LGPL
\uff08\u5177\u4f53\u4ee5\u968f\u9644\u7684\u8bb8\u53ef\u534f\u8bae\u4e3a\u51c6\uff09\u3002 - \u82e5\u5f00\u53d1\u8005\u9009\u62e9\u4f7f\u7528
PyQt5
\uff0c\u5219\u5176\u987b\u9075\u5b88GPL
\uff08\u5177\u4f53\u4ee5\u968f\u9644\u7684\u8bb8\u53ef\u534f\u8bae\u4e3a\u51c6\uff09\u3002
\u534f\u8bae\u94fe\u63a5\uff1aMIT\u3002
"},{"location":"menu/","title":"\u7a97\u53e3\u83dc\u5355\u680f","text":""},{"location":"menu/#_1","title":"\uff08\u4e00\uff09\u6982\u8ff0","text":"\u83dc\u5355\u680f\u7531\u4e00\u7ec4\u83dc\u5355\uff08Menu
\uff09\u7ec4\u6210\uff0c\u6bcf\u4e2a\u83dc\u5355\u4e0b\u53ef\u4ee5\u6dfb\u52a0\u82e5\u5e72\u83dc\u5355\u9879\uff08Action
\uff09\u6216\u5b50\u83dc\u5355\uff08Menu
\uff09\uff0c\u4e2d\u95f4\u53ef\u4ee5\u6dfb\u52a0\u5206\u9694\u7b26\uff08Separator
\uff09\u52a0\u4ee5\u5206\u9694\u3002
\u83dc\u5355\u680f\u7684\u5178\u578b\u5916\u89c2\u5982\u4e0b\u56fe\u6240\u793a\uff1a
\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7Menu\u7c7b\u5bf9\u8c61\u6765\u5b9a\u4e49\u83dc\u5355\u7684\u5c5e\u6027\uff0c\u5305\u62ec\u6307\u5b9a\u83dc\u5355\u7684\u6807\u9898\u3001\u662f\u5426\u5408\u5e76\u8fde\u7eed\u7684\u5206\u9694\u7b26\u3001\u83dc\u5355\u662f\u5426\u53ef\u88ab\"tear-off\"\u4ee5\u53ca\u8be5\u83dc\u5355\u4e0b\u5305\u542b\u7684\u83dc\u5355\u9879\uff08Action
\uff09\u6216\u5b50\u83dc\u5355\uff08Menu
\uff09\u3002\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u65b9\u5f0f\u5bfc\u5165Menu
\u7c7b
from pyguiadapter.menu import Menu\n
\u5173\u4e8eMenu
\u5bf9\u8c61\u7684\u8be6\u7ec6\u8bf4\u660e\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.menu.Menu
"},{"location":"menu/#_2","title":"\uff08\u4e8c\uff09\u4e3b\u8981\u5c5e\u6027","text":"\u5728\u83dc\u5355\u680f\u4e0a\uff0c\u83dc\u5355\u9879\u4f7f\u7528\u52a8\u4f5c\uff08Action\uff09
\u5b9a\u4e49\uff0c\u52a8\u4f5c\uff08Action\uff09
\u53ef\u4ee5\u8bbe\u7f6e\u56fe\u6807\uff08icon
\uff09\u3001\u6587\u5b57\uff08text
\uff09\u3001\u5feb\u6377\u952e\uff08shortcut
\uff09\u7b49\u5c5e\u6027\uff0c\u4e5f\u53ef\u4ee5\u8bbe\u7f6eon_triggered
\u3001on_toggled
\u7b49\u4e8b\u4ef6\u76d1\u542c\u5668\u3002\u5173\u4e8eAction
\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.action.Action
\u5728\u83dc\u5355\u680f\u4e0a\uff0c\u5b50\u83dc\u5355\u4f7f\u7528Menu
\u7c7b\u672c\u8eab\u8fdb\u884c\u5b9a\u4e49\u3002
\u83dc\u5355\u9879\u4e92\u65a5\u7684\u6548\u679c\u5982\u4e0b\u56fe\u6240\u793a\uff1a
"},{"location":"menu/#pyguiadapter.menu.Menu.title","title":"title: str
instance-attribute
","text":"\u83dc\u5355\u7684\u6807\u9898\u3002
"},{"location":"menu/#pyguiadapter.menu.Menu.actions","title":"actions: List[Union[Action, Separator, Menu]]
instance-attribute
","text":"\u83dc\u5355\u4e0b\u7684\u83dc\u5355\u9879\uff08Action
\uff09\u3001\u5206\u9694\u7b26\uff08Separator
\uff09\u6216\u5b50\u83dc\u5355\uff08Menu
\uff09
"},{"location":"menu/#pyguiadapter.menu.Menu.separators_collapsible","title":"separators_collapsible: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8fde\u7eed\u7684\u5206\u9694\u7b26\u5408\u5e76\u3002\u4e3aTrue
\u65f6\u8fde\u7eed\u5206\u9694\u7b26\u5c06\u88ab\u5408\u5e76\u4e3a\u4e00\u4e2a\uff0c\u540c\u65f6\uff0c\u4f4d\u4e8e\u83dc\u5355\u5f00\u5934\u6216\u7ed3\u5c3e\u7684\u5206\u9694\u7b26\u4e5f\u4f1a\u88ab\u9690\u85cf\u3002
"},{"location":"menu/#pyguiadapter.menu.Menu.tear_off_enabled","title":"tear_off_enabled: bool = True
class-attribute
instance-attribute
","text":"\u83dc\u5355\u53ef\u4ee5\u88ab\u201c\u6495\u4e0b\u201d\u3002\u4e3aTrue
\u65f6\uff0c\u83dc\u5355\u5c06\u5305\u542b\u4e00\u4e2a\u7279\u6b8a\u7684\u201c\u6495\u4e0b\u201d\u9879\uff08\u901a\u5e38\u663e\u793a\u4e3a\u83dc\u5355\u9876\u90e8\u7684\u865a\u7ebf\uff09\uff0c\u5f53\u89e6\u53d1\u5b83\u65f6\uff0c\u4f1a\u521b\u5efa\u4e00\u4e2a\u83dc\u5355\u7684\u526f\u672c\u3002\u8fd9\u4e2a\u201c\u6495\u4e0b\u201d\u7684\u526f\u672c \u4f1a\u5b58\u5728\u4e8e\u4e00\u4e2a\u5355\u72ec\u7684\u7a97\u53e3\u4e2d\uff0c\u5e76\u4e14\u5305\u542b\u4e0e\u539f\u59cb\u83dc\u5355\u76f8\u540c\u7684\u83dc\u5355\u9879\u3002
"},{"location":"menu/#pyguiadapter.menu.Menu.exclusive","title":"exclusive: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u83dc\u5355\u4e0b\u7684\u83dc\u5355\u9879\uff08Action
\uff09\u6dfb\u52a0\u5230\u4e00\u4e2a\u4e92\u65a5\u7ec4\u4e2d\u3002\u53ea\u6709\u5f53\u524d\u83dc\u5355\u4e0bcheckable
\u5c5e\u6027\u4e3aTrue
\u7684\u83dc\u5355\u9879\uff08Action
\uff09\u624d\u4f1a\u88ab\u6dfb\u52a0\u7684\u4e92\u65a5\u7ec4\u4e2d\u3002
"},{"location":"menu/#_3","title":"\uff08\u4e09\uff09\u793a\u4f8b","text":""},{"location":"menu/#11","title":"1\u3001\u793a\u4f8b1","text":"import json\n\nfrom pyguiadapter.action import Action, Separator\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.menu import Menu\nfrom pyguiadapter.utils import filedialog, inputdialog, messagebox\nfrom pyguiadapter.window import SimpleWindowEventListener\nfrom pyguiadapter.windows.fnselect import FnSelectWindow\n\n\ndef menu_example():\n pass\n\n\n############Action Callbacks##########\ndef on_action_open(window: FnSelectWindow, _: Action):\n print(\"on_action_open()\")\n ret = filedialog.get_open_file(\n parent=window,\n title=\"Open File\",\n start_dir=\"./\",\n filters=\"JSON files(*.json);;All files(*.*)\",\n )\n if ret:\n messagebox.show_info_message(window, f\"File will be opened: {ret}\")\n\n\ndef on_action_save(window: FnSelectWindow, _: Action):\n print(\"on_action_save()\")\n ret = filedialog.get_save_file(\n parent=window,\n title=\"Save File\",\n start_dir=\"./\",\n filters=\"JSON files(*.json);;All files(*.*)\",\n )\n if ret:\n messagebox.show_info_message(window, f\"File will be saved to: {ret}\")\n\n\ndef on_action_settings(window: FnSelectWindow, _: Action):\n default_settings = {\n \"opt1\": 1,\n \"opt2\": \"2\",\n \"opt3\": True,\n }\n new_settings = inputdialog.input_json_object(\n parent=window,\n title=\"Settings\",\n icon=\"fa.cog\",\n size=(600, 400),\n ok_button_text=\"Save\",\n cancel_button_text=\"Cancel\",\n initial_text=json.dumps(default_settings, indent=4, ensure_ascii=False),\n auto_indent=True,\n indent_size=4,\n auto_parentheses=True,\n line_wrap_mode=inputdialog.LineWrapMode.WidgetWidth,\n line_wrap_width=88,\n )\n if isinstance(new_settings, dict):\n messagebox.show_info_message(window, f\"new settings: {new_settings}\")\n\n\ndef on_action_confirm_quit(window: FnSelectWindow, action: Action, checked: bool):\n print(\"on_action_confirm_close(): \", checked)\n\n\ndef on_action_close(window: FnSelectWindow, _: Action):\n print(\"on_action_close()\")\n window.close()\n\n\ndef on_action_about(window: FnSelectWindow, _: Action):\n print(\"on_action_about()\")\n\n\n###############################\n\n\nif __name__ == \"__main__\":\n action_open = Action(\n text=\"Open\",\n icon=\"fa.folder-open\",\n on_triggered=on_action_open,\n shortcut=\"Ctrl+O\",\n )\n action_save = Action(\n text=\"Save\",\n icon=\"fa.save\",\n on_triggered=on_action_save,\n shortcut=\"Ctrl+S\",\n )\n\n action_settings = Action(\n text=\"Settings\",\n icon=\"fa.cog\",\n on_triggered=on_action_settings,\n shortcut=\"Ctrl+,\",\n )\n\n action_quit = Action(\n text=\"Quit\",\n icon=\"fa.power-off\",\n on_triggered=on_action_close,\n shortcut=\"Ctrl+Q\",\n )\n action_confirm_quit = Action(\n text=\"Confirm Quit\",\n checkable=True,\n checked=False,\n on_toggled=on_action_confirm_quit,\n )\n\n def on_window_create(window: FnSelectWindow):\n print(\"on_window_create()\")\n # make action_confirm_quit checked after the select window is created\n window.set_action_state(action_confirm_quit, True)\n\n def on_window_close(window: FnSelectWindow) -> bool:\n # get the state of action_confirm_quit\n # if it is checked, show a question message box to ask if the user really wants to close the window\n # if it is not checked, return True to close the window directly.\n state = window.get_action_state(action_confirm_quit)\n if state:\n # access the\n ret = messagebox.show_question_message(\n window,\n message=\"Do you really want to close the window?\",\n title=\"Quit\",\n buttons=messagebox.Yes | messagebox.No,\n )\n return ret == messagebox.Yes\n return True\n\n window_listener = SimpleWindowEventListener(\n on_create=on_window_create, on_close=on_window_close\n )\n\n menus = [\n Menu(\n title=\"File\",\n actions=[\n action_open,\n action_save,\n Separator(),\n action_confirm_quit,\n action_quit,\n ],\n ),\n Menu(title=\"Help\", actions=[action_settings]),\n ]\n\n adapter = GUIAdapter()\n adapter.add(menu_example, window_menus=menus, window_listener=window_listener)\n adapter.run()\n
"},{"location":"menu/#22","title":"2\u3001\u793a\u4f8b2\uff1a\u901a\u8fc7\u4e92\u65a5\u83dc\u5355\u9879\u5b9e\u73b0\u4e3b\u9898\u5207\u6362\u6548\u679c","text":"\u4ee5\u4e0b\u793a\u4f8b\u7528\u5230\u4e86\u7b2c\u4e09\u65b9\u5e93PyQtDarkTheme
\uff0c\u8fd0\u884c\u8be5\u793a\u4f8b\u9700\u5148\u5b89\u88c5\u8be5\u5e93\uff0c\u53ef\u4ee5\u53c2\u8003\u8fd9\u7bc7\u6587\u6863\uff1a\u754c\u9762\u7f8e\u5316\u3002
import qdarktheme\n\nfrom pyguiadapter.action import Action\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.menu import Menu\nfrom pyguiadapter.windows.fnselect import FnSelectWindow\n\n\ndef exclusive_action_example():\n pass\n\n\ndef on_app_start(app):\n qdarktheme.setup_theme(\"auto\")\n\n\ndef on_action_auto(win: FnSelectWindow, action: Action, checked: bool):\n if checked:\n qdarktheme.setup_theme(\"auto\")\n\n\ndef on_action_light(win: FnSelectWindow, action: Action, checked: bool):\n if checked:\n qdarktheme.setup_theme(\"light\")\n\n\ndef on_action_dark(win: FnSelectWindow, action: Action, checked: bool):\n if checked:\n qdarktheme.setup_theme(\"dark\")\n\n\naction_auto = Action(\n text=\"auto\",\n on_toggled=on_action_auto,\n checkable=True,\n checked=True,\n)\n\naction_light = Action(\n text=\"light\",\n on_toggled=on_action_light,\n checkable=True,\n)\n\naction_dark = Action(\n text=\"dark\",\n on_toggled=on_action_dark,\n checkable=True,\n)\n\nmenu_theme = Menu(\n title=\"Theme\",\n actions=[action_auto, action_light, action_dark],\n exclusive=True,\n)\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter(on_app_start=on_app_start)\n adapter.add(exclusive_action_example)\n adapter.run(show_select_window=True, select_window_menus=[menu_theme])\n
"},{"location":"multiple-functions/","title":"\u6dfb\u52a0\u591a\u4e2a\u51fd\u6570","text":""},{"location":"multiple-functions/#_1","title":"\uff08\u4e00\uff09\u6982\u8ff0","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u5411 GUIAdapter
\u5b9e\u4f8b\u4e2d\u6dfb\u52a0\u591a\u4e2a\u51fd\u6570\uff0c\u5728\u6b64\u60c5\u51b5\u4e0b\uff0cPyGUIAdapter
\u5c06\u663e\u793a\u4e00\u4e2a\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\uff0c\u5e76\u4ee5\u5217\u8868\u7684\u5f62\u5f0f\u5c55\u73b0\u6240\u6709\u5df2\u6dfb\u52a0\u7684\u51fd\u6570\uff0c\u4f9b\u7528\u6237\u9009\u62e9\u3002\u5728\u51fd\u6570\u5217\u8868\u4e2d\uff0c\u5c06\u663e\u793a\u51fd\u6570\u56fe\u6807\u4e0e\u540d\u79f0\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5bf9\u56fe\u6807\u4e0e\u51fd\u6570\u7684\u663e\u793a\u540d\u79f0\u8fdb\u884c\u81ea\u5b9a\u4e49\u3002\u540c\u65f6\uff0c\u5728\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\u7684\u53f3\u4fa7\uff0c\u5c06\u901a\u8fc7\u6587\u6863\u6d4f\u89c8\u5668\uff08Document Browser\uff09
\u663e\u793a\u5f53\u524d\u9009\u4e2d\u51fd\u6570\u7684\u8bf4\u660e\u6587\u6863\u3002
\u7528\u6237\u53ef\u901a\u8fc7\u53cc\u51fb\u51fd\u6570\u5217\u8868\u4e2d\u7684\u6761\u76ee\u6216\u8005\u70b9\u51fb\u9009\u62e9\u6309\u94ae\uff08Select\uff09
\u6253\u5f00\u76ee\u6807\u51fd\u6570\u7684\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow
\uff09\u3002
\u540c\u65f6\uff0cPyGUIAdapter
\u652f\u6301\u51fd\u6570\u5206\u7ec4\u529f\u80fd\uff0c\u5728\u51fd\u6570\u8f83\u591a\u65f6\uff0c\u4f7f\u7528\u8be5\u529f\u80fd\u53ef\u4ee5\u4f7f\u754c\u9762\u66f4\u52a0\u7b80\u6d01\u3001\u76f4\u89c2\u3002
\u4e0b\u9762\uff0c\u56f4\u7ed5GUIAdapter.add()
\u51fd\u6570\u5bf9\u4e0a\u9762\u63d0\u5230\u7684\u529f\u80fd\u8fdb\u884c\u8be6\u7ec6\u8bf4\u660e\u3002
"},{"location":"multiple-functions/#_2","title":"\uff08\u4e8c\uff09\u6dfb\u52a0\u591a\u4e2a\u51fd\u6570","text":"\u5728\u8c03\u7528GUIAdapter.run()
\u51fd\u6570\u524d\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7\u591a\u6b21\u8c03\u7528GUIAdapter.add()
\u5c06\u591a\u4e2a\u51fd\u6570\u6dfb\u52a0\u5230GUIAdapter
\u5b9e\u4f8b\u4e2d\uff1a
examples/multiple_function_example.py
from pyguiadapter.adapter import GUIAdapter\n\n\ndef function_1(arg: int):\n \"\"\"\n description of function_1\n \"\"\"\n pass\n\n\ndef function_2(arg: int):\n \"\"\"\n description of function_2\n \"\"\"\n pass\n\n\ndef function_3(arg: int):\n \"\"\"\n description of function_3\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(function_1)\n adapter.add(function_2)\n adapter.add(function_3)\n adapter.run()\n
\u6240\u6709\u6dfb\u52a0\u5230GUIAdapter
\u5b9e\u4f8b\u4e2d\u7684\u51fd\u6570\u90fd\u4f1a\u663e\u793a\u5728\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\u5de6\u4fa7\u7684\u51fd\u6570\u5217\u8868\u4e2d\u3002\u51fd\u6570\u5217\u8868\u5c06\u540c\u65f6\u663e\u793a\u51fd\u6570\u7684\u540d\u79f0\u53ca\u56fe\u6807\uff0c\u5982\u679c\u6ca1\u6709\u663e\u5f0f\u5730\u6307\u5b9a\u51fd\u6570\u7684\u56fe\u6807\u548c\u540d\u79f0\uff0cPyGUIAadpter
\u5c06\u4f7f\u7528\u9ed8\u8ba4\u7684\u56fe\u6807\uff0c\u663e\u793a\u7684\u540d\u79f0\u5219\u4e3a\u51fd\u6570\u540d\u3002
\u5f53\u7528\u6237\u9009\u4e2d\u51fd\u6570\u5217\u8868\u4e2d\u7684\u67d0\u4e2a\u6761\u76ee\uff0c\u53cc\u51fb\u5b83\u6216\u8005\u70b9\u51fb\u53f3\u4e0b\u65b9\u7684Select
\u6309\u94ae\uff0c\u5373\u53ef\u8fdb\u5165\u5bf9\u5e94\u7684\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow\uff09
\u3002\u5f53\u7528\u6237\u5173\u95ed\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnSelectWindow\uff09
\uff0c\u5c06\u56de\u5230\u51fd\u6570\u9009\u62e9\u754c\u9762\u3002
"},{"location":"multiple-functions/#icondisplay_name","title":"\uff08\u4e09\uff09\u81ea\u5b9a\u4e49\u51fd\u6570\u56fe\u6807\uff08icon
\uff09\u53ca\u540d\u79f0\uff08display_name
\uff09","text":"PyGUIAdapter
\u5141\u8bb8\u5f00\u53d1\u8005\u5bf9\u51fd\u6570\u7684\u56fe\u6807\uff08icon
\uff09\u53ca\u5176\u663e\u793a\u540d\u79f0\uff08display_name
\uff09\u8fdb\u884c\u81ea\u5b9a\u4e49\u3002\u4e3a\u51fd\u6570\u8bbe\u7f6e\u72ec\u7279\u7684\u56fe\u6807\uff0c\u8d4b\u4e88\u51fd\u6570\u4e00\u4e2a\u66f4\u5177\u53ef\u8bfb\u6027\u7684\u540d\u79f0\uff0c\u5c06\u6709\u52a9\u4e8e\u63d0\u9ad8\u754c\u9762\u7684\u89c2\u611f\u5e76\u589e\u5f3a\u7528\u6237\u7684\u4f53\u9a8c\u3002
examples/custom_icon_and_name_example.py
from pyguiadapter.adapter import GUIAdapter\n\n\ndef function_1(arg: int):\n \"\"\"\n description of function_1\n \"\"\"\n pass\n\n\ndef function_2(arg: int):\n \"\"\"\n description of function_2\n \"\"\"\n pass\n\n\ndef function_3(arg: int):\n \"\"\"\n description of function_3\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(function_1, display_name=\"Barcode Generator\", icon=\"ei.barcode\")\n adapter.add(function_2, display_name=\"QRCode Generator\", icon=\"ei.qrcode\")\n adapter.add(function_3, display_name=\"Generator Service\", icon=\"mdi.web\")\n adapter.run()\n
\u5728\u672c\u4f8b\u4e2d\uff0c\u4f7f\u7528\u4e86\u5b57\u4f53\u56fe\u6807\u540d\u79f0\u4f5c\u4e3a\u51fd\u6570\u7684icon
\uff0c\u5f00\u53d1\u8005\u4e5f\u53ef\u4ee5\u4f20\u5165\u56fe\u6807\u6587\u4ef6\u8def\u5f84\u3002\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\u53ef\u4ee5\u53c2\u8003\uff1a\u5173\u4e8e\u56fe\u6807\u3002
"},{"location":"multiple-functions/#_3","title":"\uff08\u56db\uff09\u8bbe\u7f6e\u51fd\u6570\u8bf4\u660e\u6587\u6863","text":"\u5728\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\u548c\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow\uff09
\u4e2d\u5747\u6709\u4e13\u95e8\u7684\u533a\u57df\u7528\u4e8e\u663e\u793a\u51fd\u6570\u7684\u8bf4\u660e\u6587\u6863\uff0c\u7528\u4e8e\u663e\u793a\u51fd\u6570\u6587\u6863\u7684\u7ec4\u4ef6\u88ab\u79f0\u4e3a\u6587\u6863\u6d4f\u89c8\u5668\uff08DocumentBrowser\uff09
\u3002
"},{"location":"multiple-functions/#1docstring","title":"1\u3001docstring
\u4f5c\u4e3a\u8bf4\u660e\u6587\u6863","text":"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cPyGUIAdapter
\u4f1a\u81ea\u52a8\u63d0\u53d6\u51fd\u6570\u6587\u6863\u5b57\u7b26\u4e32\uff08docstring
\uff09\u4e2d\u5bf9\u4e8e\u51fd\u6570\u7684\u63cf\u8ff0\uff08\u5305\u62eclong description
\u548cshort description
\uff0c\u4f46\u4e00\u822c\u4e0d\u5305\u62ec\u53c2\u6570\u7684\u63cf\u8ff0\u90e8\u5206\u548c@params...@end
\u5757\uff09\u4f5c\u4e3a\u8bf4\u660e\u6587\u6863\uff0c\u683c\u5f0f\u9ed8\u8ba4\u4e3aMarkdown
\u3002\u6bd4\u5982\uff1a
examples/html_docstring_document_example.py
from pyguiadapter.adapter import GUIAdapter\n\n\ndef function_1(arg1: int, arg2: str, arg3: bool):\n \"\"\"\n ### Description\n This is the document of the **function_1**. And by default this document will automatically\n appear in the `document area`.\n\n The format of the document is **Markdown** by default. The **plaintext** and **html** formats are also\n supported.\n\n ---\n\n ### Arguments\n This function needs 3 arguments:\n - **arg1**: Balabala....\n - **arg2**: Balabala....\n - **arg3**: Balabala....\n\n @param arg1:\n @param arg2:\n @param arg3:\n @return:\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(function_1)\n adapter.run()\n
\u9664\u4e86markdown
\uff0c\u4e5f\u53ef\u4ee5\u5c06\u6587\u6863\u7684\u683c\u5f0f\u6307\u5b9a\u4e3ahtml
\u6216plaintext
\u3002\u6bd4\u5982\uff1a
from pyguiadapter.adapter import GUIAdapter\n\n\ndef function_2(arg1: int, arg2: str, arg3: bool):\n \"\"\"\n <h3>Description</h3>\n <p>\n This is the document of the <b>function_2</b>. And by default this document will automatically\n appear in the <strong>document area</strong>.\n </p>\n <p>\n The format of the document is <b>Markdown</b> by default.\n The <b>plaintext</b> and <b>html</b> formats are also supported.\n </p>\n <hr>\n <h3>Arguments</h3>\n <p>This function needs 3 arguments:</p>\n <ul>\n <li><b>arg1</b>: Balabala....</li>\n <li><b>arg2</b>: Balabala....</li>\n <li><b>arg3</b>: Balabala....</li>\n </ul>\n\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(function_2, document_format=\"html\")\n adapter.run()\n
\u63d0\u793a\uff1a\u6587\u6863\u6d4f\u89c8\u5668
\u5bf9html
\u7684\u652f\u6301\u6709\u9650\uff0c\u4ec5\u652f\u6301html4
\u7684\u5b50\u96c6\uff0c\u5177\u4f53\u53ef\u4ee5\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863\u7684\u8bf4\u660e\uff1aSupported HTML Subset | Qt GUI 5.15.17
"},{"location":"multiple-functions/#2","title":"2\u3001\u624b\u52a8\u8bbe\u7f6e\u8bf4\u660e\u6587\u6863\u5185\u5bb9","text":"\u5982\u679c\u5f00\u53d1\u8005\u4e0d\u60f3\u5c06\u5927\u6bb5\u6587\u672c\u653e\u5230\u51fd\u6570\u7684docstring
\u4e2d\uff0c\u4e5f\u53ef\u4ee5\u624b\u52a8\u6307\u5b9a\u51fd\u6570\u7684\u8bf4\u660e\u6587\u6863\uff0c\u6bd4\u5982\u5c06\u5916\u90e8\u6587\u4ef6\u4f5c\u4e3a\u8bf4\u660e\u6587\u6863\uff1a
examples/html_file_document_example.py
from pyguiadapter import utils\nfrom pyguiadapter.adapter import GUIAdapter\n\n\ndef function_3(arg1: int, arg2: str, arg3: bool):\n \"\"\"\n\n @param arg1:\n @param arg2:\n @param arg3:\n @return:\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n html_doc = utils.read_text_file(\"document.html\")\n adapter.add(function_3, document=html_doc, document_format=\"html\")\n adapter.run()\n
"},{"location":"multiple-functions/#3","title":"3\u3001\u8bf4\u660e\u6587\u6863\u4e2d\u7684\u7279\u6b8a\u201c\u951a\u70b9\u201d\u94fe\u63a5","text":"\u5728\u51fd\u6570\u7684\u8bf4\u660e\u6587\u6863\u4e2d\uff0c\u5b58\u5728\u4e24\u79cd\u7279\u6b8a\u7684\u201d\u951a\u70b9\u201c\u94fe\u63a5\uff0c\u4e00\u79cd\u662f\u201dParameter\u951a\u70b9\uff08parameter anchor\uff09\u201c\uff0c\u53e6\u4e00\u79cd\u662fGroup\u951a\u70b9\uff08group anchor\uff09\uff0c\u8fd9\u4e24\u79cd\u951a\u70b9\u94fe\u63a5\u7684\u4f5c\u7528\u662f\u4e0e\u6307\u5b9a\u7684\u51fd\u6570\u53c2\u6570\u6216\u51fd\u6570\u53c2\u6570\u5206\u7ec4\u76f8\u951a\u5b9a\uff0c\u5728\u7528\u6237\u70b9\u51fb\u8fd9\u4e9b\u94fe\u63a5\u65f6\u5feb\u901f\u5bfc\u822a\u5230\u6307\u5b9a\u53c2\u6570\u63a7\u4ef6\u6216\u53c2\u6570\u5206\u7ec4\uff0c\u5177\u4f53\u6765\u8bb2\uff1a
\u5bf9\u4e8eParameter\u951a\u70b9\uff08parameter anchor\uff09\uff0cPyGUIAdapter
\u9996\u5148\u4f1a\u67e5\u627e\u5bf9\u5e94\u53c2\u6570\u7684\u63a7\u4ef6\u4f4d\u4e8e\u54ea\u4e2a\u51fd\u6570\u5206\u7ec4\uff0c\u7136\u540e\u5c55\u5f00\u5176\u6240\u5728\u7684\u51fd\u6570\u5206\u7ec4\uff0c\u63a5\u7740\u8c03\u6574\u6eda\u52a8\u6761\u4f4d\u7f6e\uff0c\u786e\u4fdd\u8be5\u53c2\u6570\u63a7\u4ef6\u5bf9\u7528\u6237\u53ef\u89c1\uff0c\u7136\u540e\u9ad8\u4eae\u663e\u793a\u8be5\u63a7\u4ef6\u3002\u6548\u679c\u5982\u56fe\u6240\u793a\uff1a
\u5bf9\u4e8eGroup\u951a\u70b9\uff08group anchor\uff09\uff0cPyGUIAdapter
\u5219\u4f1a\u5728\u7528\u6237\u70b9\u51fb\u951a\u70b9\u94fe\u63a5\u65f6\u5c55\u5f00\u5bf9\u4e8e\u7684\u51fd\u6570\u5206\u7ec4\u3002\u6548\u679c\u5982\u4e0b\u56fe\u6240\u793a\uff1a
\u5728\u51fd\u6570\u53c2\u6570\u975e\u5e38\u591a\u65f6\uff0cParameter\u951a\u70b9\uff08parameter anchor\uff09\u4e0eGroup\u951a\u70b9\uff08group anchor\uff09\u975e\u5e38\u6709\u7528\u3002\u5f00\u53d1\u8005\u5728\u51fd\u6570\u8bf4\u660e\u6587\u6863\u4e2d\u63cf\u8ff0\u53c2\u6570\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e9b\u951a\u70b9\u4ee5\u5e2e\u52a9\u7528\u6237\u5feb\u901f\u5b9a\u4f4d\u5230\u5bf9\u5e94\u7684\u63a7\u4ef6\uff0c\u8fd9\u5927\u5927\u589e\u52a0\u4e86\u7a0b\u5e8f\u7684\u6613\u7528\u6027\u3002
Parameter\u951a\u70b9\uff08parameter anchor\uff09\u4e0eGroup\u951a\u70b9\uff08group anchor\uff09\u7279\u6027\u9ed8\u8ba4\u662f\u5173\u95ed\u7684\uff0c\u9700\u8981\u5728FnExecuteWindowConfig
\u4e2d\u5f00\u542f\uff0c\u65b9\u6cd5\u5982\u4e0b\uff1a
\u4ee5\u4e0b\u662f\u4e00\u4e2a\u5b8c\u6574\u7684\u4f8b\u5b50\uff1a
\u6e90\u7801\u4ee5\u53ca\u51fd\u6570\u6587\u6863\u7684\u8def\u5f84
- \u6e90\u7801\uff1aexamples/anchors_in_document.py
- \u51fd\u6570\u6587\u6863\uff1aexamples/anchors_in_document.md
import os\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.utils import read_text_file\nfrom pyguiadapter.windows import DocumentBrowserConfig\nfrom pyguiadapter.windows.fnexec import FnExecuteWindowConfig\n\nDOCUMENT_PATH = os.path.join(os.path.dirname(__file__), \"anchors_in_document.md\")\n\n\ndef anchors_in_document(\n a: str,\n b: str,\n c: str,\n d: str,\n e: str,\n f: str,\n g: str,\n h: str,\n i: str,\n j: str,\n k: str,\n l: str,\n m: str,\n n: str,\n o: str,\n p: str,\n):\n \"\"\"\n This is an example demonstrating how to use parameter anchors and group anchors in the document of function.\n\n Args:\n a: description of parameter a.\n b: description of parameter b.\n c: description of parameter c.\n d: description of parameter d.\n e: description of parameter e.\n f: description of parameter f.\n g: description of parameter g.\n h: description of parameter h.\n i: description of parameter i.\n j: description of parameter j.\n k: description of parameter k.\n l: description of parameter l.\n m: description of parameter m.\n n: description of parameter n.\n o: description of parameter o.\n p: description of parameter p.\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n\n widget_configs = {\n # parameters in Group-A\n \"a\": {\"group\": \"Group-A\"},\n \"b\": {\"group\": \"Group-A\"},\n \"c\": {\"group\": \"Group-A\"},\n \"d\": {\"group\": \"Group-A\"},\n # parameters in Group-B\n \"e\": {\"group\": \"Group-B\"},\n \"f\": {\"group\": \"Group-B\"},\n \"g\": {\"group\": \"Group-B\"},\n \"h\": {\"group\": \"Group-B\"},\n # parameters in Group-C\n \"i\": {\"group\": \"Group-C\"},\n \"j\": {\"group\": \"Group-C\"},\n \"k\": {\"group\": \"Group-C\"},\n \"l\": {\"group\": \"Group-C\"},\n # parameters in default group\n \"m\": {\"group\": None},\n \"n\": {\"group\": None},\n \"o\": {\"group\": None},\n \"p\": {\"group\": None},\n }\n\n document = read_text_file(DOCUMENT_PATH)\n adapter = GUIAdapter()\n adapter.add(\n anchors_in_document,\n document=document,\n document_format=\"markdown\",\n widget_configs=widget_configs,\n window_config=FnExecuteWindowConfig(\n document_browser_config=DocumentBrowserConfig(\n parameter_anchor=True, group_anchor=True\n )\n ),\n )\n adapter.run()\n
"},{"location":"multiple-functions/#_4","title":"\uff08\u4e94\uff09\u5bf9\u51fd\u6570\u8fdb\u884c\u5206\u7ec4","text":"\u5f00\u53d1\u8005\u5728\u8c03\u7528GUIAdapter.add()
\u65b9\u6cd5\u6dfb\u52a0\u51fd\u6570\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7group
\u53c2\u6570\u6307\u5b9a\u51fd\u6570\u7684\u5206\u7ec4\uff0cPyGUIAdapter
\u4f1a\u5c06\u76f8\u540cgroup
\u7684\u51fd\u6570\u805a\u5408\u5230\u4e00\u8d77\uff1b\u5bf9\u4e8e\u672a\u6307\u5b9agroup
\u7684\u51fd\u6570\uff0cPyGUIAdapter
\u5219\u4f1a\u5c06\u5176\u653e\u7f6e\u5728\u9ed8\u8ba4\u5206\u7ec4\u4e2d\uff0c\u8be5\u5206\u7ec4\u7684\u9ed8\u8ba4\u540d\u79f0\u4e3a\"Main Functions\"
\u3002
\u6bd4\u5982\u4e0b\u9762\u8fd9\u4e2a\u793a\u4f8b\uff0c\u5c06\u51fd\u6570\u6309\u7167\u529f\u80fd\u5206\u6210\u4e86\u4e09\u7ec4\uff1a\u7f16\u7801\u5668\u51fd\u6570Encoders
\u3001\u89e3\u7801\u5668\u51fd\u6570Decoders
\u548c\u5176\u4ed6\u51fd\u6570\uff08\u9ed8\u8ba4\u5206\u7ec4\uff09Main Functions
\u3002
examples/function_groups_example.py
from pyguiadapter.adapter import GUIAdapter\n\n\ndef mp4_encoder():\n \"\"\"\n MP4 Encoder\n \"\"\"\n pass\n\n\ndef mp3_encoder():\n \"\"\"\n MP3 Encoder\n \"\"\"\n pass\n\n\ndef avi_encoder():\n \"\"\"\n AVI Encoder\n \"\"\"\n pass\n\n\ndef ogg_encoder():\n \"\"\"\n OGG Encoder\n \"\"\"\n pass\n\n\ndef avi_decoder():\n \"\"\"\n AVI Decoder\n \"\"\"\n pass\n\n\ndef ogg_decoder():\n \"\"\"\n OGG Decoder\n \"\"\"\n pass\n\n\ndef mp3_decoder():\n \"\"\"\n MP3 Decoder\n \"\"\"\n pass\n\n\ndef mp4_decoder():\n \"\"\"\n MP4 Decoder\n \"\"\"\n pass\n\n\ndef universal_settings():\n \"\"\"\n Universal Settings\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(universal_settings)\n adapter.add(mp4_encoder, group=\"Encoders\")\n adapter.add(mp3_encoder, group=\"Encoders\")\n adapter.add(avi_encoder, group=\"Encoders\")\n adapter.add(ogg_encoder, group=\"Encoders\")\n adapter.add(avi_decoder, group=\"Decoders\")\n adapter.add(ogg_decoder, group=\"Decoders\")\n adapter.add(mp3_decoder, group=\"Decoders\")\n adapter.add(mp4_decoder, group=\"Decoders\")\n adapter.run()\n
"},{"location":"packaging/","title":"\u5e94\u7528\u6253\u5305","text":""},{"location":"packaging/#_1","title":"\uff08\u4e00\uff09\u524d\u8a00","text":"\u4e3a\u4e86\u4fbf\u4e8e\u5206\u53d1\u548c\u90e8\u7f72\uff0c\u53ef\u4ee5\u5c06\u5f00\u53d1\u597d\u7684\u5e94\u7528\u6253\u5305\u6210\u4e8c\u8fdb\u5236\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u8fd9\u6837\u7528\u6237\u53ef\u4ee5\u5728\u4e0d\u5b89\u88c5Python\u89e3\u91ca\u5668\u548c\u76f8\u5173\u7a0b\u5e8f\u5e93\u7684\u73af\u5883\u4e0b\u8fd0\u884c\u7a0b\u5e8f\u3002\u7b14\u8005\u6d4b\u8bd5\u4e86pyinstaller
\u6253\u5305\u5de5\u5177\uff0c\u53d1\u73b0\u5176\u53ef\u4ee5\u5e94\u7528\u8fdb\u884c\u6253\u5305\uff0c\u4e0b\u9762\u4ee5\u4e00\u4e2a\u5177\u4f53\u7684Demo\u9879\u76ee\u4e3a\u4f8b\uff0c\u5bf9\u4f7f\u7528pyinstaller
\u6253\u5305\u8fdb\u884c\u8bb2\u89e3\u3002\u672c\u6587\u4e2d\u6d89\u53ca\u7684\u6240\u6709\u4ee3\u7801\u3001\u8d44\u6e90\u6587\u4ef6\u3001\u6253\u5305\u914d\u7f6e\u6587\u4ef6\u7b49\u5747\u53ef\u4ee5\u5728\u4ee5\u4e0b\u76ee\u5f55\u4e2d\u627e\u5230\uff1a
- examples/packaging/
\u6b64\u5916\uff0c\u5f3a\u70c8\u5efa\u8bae\u5f00\u53d1\u8005\u5728python\u865a\u62df\u73af\u5883\u4e2d\u5bf9\u5e94\u7528\u8fdb\u884c\u6253\u5305\uff0c\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u5c06\u8bb8\u591a\u672a\u7528\u5230\u7684\u5e93\u548c\u6587\u4ef6\u6253\u5305\u5230\u6700\u7ec8\u7684\u4ea7\u7269\u4e2d\uff0c\u4ece\u800c\u51cf\u5c11\u53ef\u6267\u884c\u6587\u4ef6\u7684\u4f53\u79ef\u3002
"},{"location":"packaging/#_2","title":"\uff08\u4e8c\uff09\u51c6\u5907\u5de5\u4f5c","text":"\u9996\u5148\uff0c\u9700\u8981\u5b89\u88c5pyinstaller
\u6253\u5305\u5de5\u5177\uff1a
"},{"location":"packaging/#1pip","title":"1\u3001\u4f7f\u7528pip","text":"pip install pyinstaller\n
"},{"location":"packaging/#2poetry","title":"2\u3001\u4f7f\u7528poetry","text":"poetry add pyinstaller --group dev\n
\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u4f1a\u56e0\u4e3apython
\u7248\u672c\u95ee\u9898\uff0c\u5bfc\u81f4\u5b89\u88c5\u5931\u8d25\u3002\u63d0\u793a\u4fe1\u606f\u5927\u6982\u5982\u4e0b\uff1a
The current project's supported Python range (>=3.8,<4.0) is not compatible with some of the required packages Python requirement:\n - pyinstaller requires Python <3.14,>=3.8, so it will not be satisfied for Python >=3.14,<4.0\n\nBecause no versions of pyinstaller match >6.10.0,<7.0.0\n and pyinstaller (6.10.0) requires Python <3.14,>=3.8, pyinstaller is forbidden.\nSo, because pyguiadapter depends on pyinstaller (^6.10.0), version solving failed.\n\n \u2022 Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties\n\n For pyinstaller, a possible solution would be to set the `python` property to \">=3.8,<3.14\"\n\n https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,\n https://python-poetry.org/docs/dependency-specification/#using-environment-markers\n https://python-poetry.org/docs/dependency-specification/#using-environment-markers \n
\u6b64\u65f6\uff0c\u9700\u8981\u5c06pyproject.toml
\u6587\u4ef6\u4e2dpython
\u4f9d\u8d56\u9879\u7684\u7248\u672c\u8bbe\u7f6e\u5230\u6b63\u786e\u7684\u8303\u56f4\uff0c\u6bd4\u5982\uff1a
...\n[tool.poetry.dependencies]\npython = \"^3.8, <3.14\"\n...\n
\u7136\u540e\u518d\u6b21\u8fd0\u884cpoetry add pyinstaller --group dev
\u3002
"},{"location":"packaging/#_3","title":"\uff08\u4e09\uff09\u5f00\u59cb\u6253\u5305","text":"\u9996\u5148\u9700\u8981\u8fdb\u5165examples/packaging/\u76ee\u5f55\uff0c\u4ee5\u4e0b\u547d\u4ee4\u884c\u5747\u5728\u6b64\u76ee\u5f55\u4e0b\u5b8c\u6210\u3002
cd example/packaging/\n
"},{"location":"packaging/#1","title":"1\u3001\u57fa\u7840\u547d\u4ee4","text":"pyinstaller
\u7684\u547d\u4ee4\u8bed\u6cd5\u5982\u4e0b\uff1a
pyinstaller [options] script [script \u2026] | specfile\n
\u9996\u5148\uff0c\u8ba9\u6211\u4eec\u5c1d\u8bd5\u4e0d\u52a0\u4efb\u4f55\u9009\u9879\u6765\u6253\u5305\u6211\u4eec\u7684\u5e94\u7528\uff0c\u5728\u547d\u4ee4\u884c\u4e0b\u8f93\u5165\uff1a
pyinstaller app.py\n
\u4e0d\u51fa\u610f\u5916\uff0c\u6211\u4eec\u5c06\u770b\u5230\u7c7b\u4f3c\u4e0b\u9762\u7684\u8f93\u51fa\uff1a
...\n20490 INFO: Fixing EXE headers\n20566 INFO: Building EXE from EXE-00.toc completed successfully.\n20569 INFO: checking COLLECT\n20571 INFO: Building COLLECT COLLECT-00.toc\n20786 INFO: Building COLLECT COLLECT-00.toc completed successfully.\n
\u8fd9\u8868\u660e\u6253\u5305\u5df2\u7ecf\u6210\u529f\u4e86\uff0c\u6b64\u65f6\uff0cexamples/packaging/
\u76ee\u5f55\u4e0b\u4f1a\u51fa\u73b0\u4e24\u4e2a\u65b0\u7684\u76ee\u5f55build
\u548cdist
\uff0c\u4ee5\u53ca\u4e00\u4e2a\u65b0\u7684\u6587\u4ef6app.spec
\uff1a
build/
\uff1a\u8be5\u76ee\u5f55\u7528\u4e8e\u5b58\u653e\u6253\u5305\u8fc7\u7a0b\u4e2d\u751f\u6210\u7684\u4e00\u4e9b\u4e2d\u95f4\u6587\u4ef6\uff0c\u4e00\u822c\u65e0\u9700\u8fc7\u591a\u5173\u6ce8\u3002 dist/
\uff1a\u8be5\u76ee\u5f55\u7528\u4e8e\u5b58\u653e\u6253\u5305\u7684\u7ed3\u679c\u4ea7\u7269\uff0c\u6211\u4eec\u9700\u8981\u7684\u4e8c\u8fdb\u5236\u53ef\u6267\u884c\u6587\u4ef6\u5c31\u5c06\u88ab\u653e\u5230\u8fd9\u4e2a\u547d\u4ee4\u4e0b app.spec
\uff1a*.spec
\u6587\u4ef6\u65f6\u6253\u5305\u914d\u7f6e\u6587\u4ef6\uff0c\u8be5\u6587\u4ef6\u8bb0\u5f55\u4e86\u6253\u5305\u6240\u4f7f\u7528\u7684\u53c2\u6570\uff0c\u8fd0\u884c\u6253\u5305\u547d\u4ee4\u540e\u5c06\u81ea\u52a8\u751f\u6210\u8be5\u6587\u4ef6\u3002\u540e\u7eed\u53ef\u4ee5\u76f4\u63a5\u8f93\u5165pyinstaller app.spec
\u547d\u4ee4\u6253\u5305\u5e94\u7528\uff0c\u800c\u65e0\u9700\u6bcf\u6b21\u90fd\u624b\u52a8\u8f93\u5165\u53c2\u6570\u3002
\u73b0\u5728\u8ba9\u6211\u4eec\u67e5\u770bdist
\u76ee\u5f55\uff0c\u91cc\u9762\u5305\u542b\u4e00\u4e2a\u540d\u4e3aapp
\u7684\u5b50\u76ee\u5f55\uff0c\u6700\u7ec8\u7684\u53ef\u6267\u884c\u6587\u4ef6\u5c31\u5728\u8be5\u76ee\u5f55\u4e0b\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cpyinstaller
\u4f1a\u751f\u6210\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u53ca\u4e00\u4e2a_internal/
\u76ee\u5f55\uff1a
_internal/
\u76ee\u5f55\u4e0b\u5b58\u653e\u7740\u8fd9\u53ef\u6267\u884c\u6587\u4ef6\u8fd0\u884c\u65f6\u4f9d\u8d56\u7684\u5e93\u548c\u5176\u4ed6\u6587\u4ef6\uff1a
"},{"location":"packaging/#2","title":"2\u3001\u6253\u5305\u8d44\u6e90\uff08\u6570\u636e\uff09\u6587\u4ef6","text":""},{"location":"packaging/#1_1","title":"\uff081\uff09\u7b2c\u4e09\u65b9\u4f9d\u8d56\u4e2d\u7684\u8d44\u6e90\u6587\u4ef6","text":"\u73b0\u5728\uff0c\u8ba9\u6211\u4eec\u8fd0\u884capp.exe
\uff0c\u7ed3\u679c\u53d1\u73b0\u53ea\u6709\u4e00\u4e2a\u547d\u4ee4\u884c\u7a97\u53e3\u4e00\u95ea\u800c\u8fc7\uff0c\u7a0b\u5e8f\u6ca1\u6709\u542f\u52a8\u6210\u529f\u3002\u8fd9\u8bf4\u660e\u6253\u5305\u8fd8\u5b58\u5728\u4e00\u4e9b\u95ee\u9898\uff0c\u5e76\u6ca1\u6709\u771f\u6b63\u6210\u529f\u3002\u8ba9\u6211\u4eec\u901a\u8fc7\u547d\u4ee4\u884c\u518d\u6b21\u542f\u52a8app.exe
\uff0c\u5c1d\u8bd5\u4ece\u5176\u547d\u4ee4\u884c\u8f93\u51fa\u4e2d\u5b9a\u4f4d\u95ee\u9898\u6240\u5728\u3002
./dist/app/app.exe\n
\u7a0b\u5e8f\u8f93\u51fa\u4e86\u5927\u6bb5\u7684\u5f02\u5e38\u56de\u6eaf\u4fe1\u606f\uff0c\u8ba9\u6211\u4eec\u622a\u53d6\u5176\u4e2d\u5173\u952e\u7684\u90e8\u5206\uff1a
Traceback (most recent call last):\n ...\n File \"yapf_third_party\\_ylib2to3\\pygram.py\", line 29, in <module>\n File \"yapf_third_party\\_ylib2to3\\pgen2\\driver.py\", line 237, in load_grammar\n File \"pkgutil.py\", line 637, in get_data\n File \"PyInstaller\\loader\\pyimod02_importers.py\", line 509, in get_data\nFileNotFoundError: [Errno 2] No such file or directory: '...\\\\dist\\\\app\\\\_internal\\\\yapf_third_party\\\\_ylib2to3\\\\Grammar.txt'\n
\u4ece\u5f02\u5e38\u4fe1\u606f\u4e2d\u4e0d\u96be\u53d1\u73b0\uff0c\u4e00\u4e9b\u7a0b\u5e8f\u8fd0\u884c\u6240\u5fc5\u987b\u7684\u6587\u4ef6\u6ca1\u6709\u88ab\u6253\u5305\u5230_internal/
\u76ee\u5f55\u4e0b\uff0c\u5177\u4f53\u800c\u8a00\uff0c\u8be5\u6587\u4ef6\u88ab\u7b2c\u4e09\u65b9\u5305yapf_third_party
\u5f15\u7528\u3002
PyGUIAdapter
\u4f9d\u8d56yapf
\u5b9e\u73b0\u4ee3\u7801\u683c\u5f0f\u5316\u529f\u80fd\uff0c\u800cyapf
\u5728\u5185\u90e8\u4f9d\u8d56\u53c8\u4e86yapf_third_party
\u3002\u663e\u7136\uff0c\u76ee\u524dpyinstaller
\u8fd8\u65e0\u6cd5\u5904\u7406yapf
\u8fd9\u79cd\u4f9d\u8d56\u5173\u7cfb\uff0c\u65e0\u6cd5\u81ea\u52a8\u6536\u96c6\u5e76\u6253\u5305\u5176\u6240\u9700\u7684\u6587\u4ef6\u3002\u4e3a\u4e86\u5904\u7406\u7c7b\u4f3c\u7684\u9519\u8bef\uff0c\u6211\u4eec\u53ef\u4ee5\u624b\u52a8\u6307\u5b9a\u9700\u8981\u6536\u96c6\u7684\u6587\u4ef6\u7684\u5305\u6216\u6a21\u5757\uff0cpyinstanller
\u63d0\u4f9b\u4e86\u4ee5\u4e0b\u9009\u9879\uff1a
--hidden-import MODULENAME
\u6216 --hiddenimport MODULENAME
\uf0c1
\u7528\u4e8e\u544a\u8bc9pyInstaller
\u5728\u6253\u5305\u8fc7\u7a0b\u4e2d\u5305\u542b\u90a3\u4e9b\u53ef\u80fd\u6ca1\u6709\u88ab\u81ea\u52a8\u8bc6\u522b\u4e3a\u4f9d\u8d56\u7684\u989d\u5916python\u5305\uff0c\u5373\u90a3\u4e9b\u901a\u8fc7importlib
\u7b49\u65b9\u5f0f\u9690\u5f0f\u5bfc\u5165\u7684\u5305\u3002
--collect-submodules MODULENAME
\uf0c1
\u7528\u4e8e\u6536\u96c6\u6307\u5b9a\u5305\u6216\u6a21\u5757\u7684\u6240\u6709\u5b50\u6a21\u5757\u3002
--collect-data MODULENAME
\u6216--collect-datas MODULENAME
\uf0c1
\u7528\u4e8e\u6536\u96c6\u6307\u5b9a\u5305\u6216\u6a21\u5757\u4e0b\u7684\u6570\u636e\u6587\u4ef6\u3002
--collect-binaries MODULENAME
\uf0c1
\u7528\u4e8e\u6536\u96c6\u6307\u5b9a\u5305\u6216\u6a21\u5757\u4e0b\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002
--collect-all MODULENAME
\uf0c1
\u7528\u4e8e\u6307\u5b9a\u5305\u6216\u6a21\u5757\u4e0b\u7684\u6240\u6709\u5b50\u6a21\u5757\u3001\u6570\u636e\u6587\u4ef6\u3001\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002
\u73b0\u5728\uff0c\u8ba9\u6211\u4eec\u624b\u52a8\u6307\u5b9a\u9700\u8981\u6536\u96c6\u8d44\u6e90\u6587\u4ef6\u7684\u7b2c\u4e09\u65b9\u4f9d\u8d56\u3002\u9664\u4e86yapf_third_party
\uff0c\u8fd8\u6709pyqcodeeditor
\u3002
pyqcodeeditor
\u662f\u4f5c\u8005\u79fb\u690d\u7684\u4e00\u4e2a\u4ee3\u7801\u7f16\u8f91\u5668\u63a7\u4ef6\uff0cPyGUIAdapter
\u4f7f\u7528\u4e86\u8be5\u63a7\u4ef6\u3002pyqcodeeditor
\u5185\u7f6e\u4e86\u4e00\u4e9b\u7528\u4e8e\u5b9a\u4e49\u8bed\u6cd5\u548c\u9ad8\u4eae\u89c4\u5219\u7684json
\u6587\u4ef6\uff0cpyinstaller
\u8fd8\u6ca1\u529e\u6cd5\u81ea\u52a8\u6536\u96c6\u8fd9\u4e9b\u6587\u4ef6\uff0c\u56e0\u6b64\u4e5f\u9700\u8981\u624b\u52a8\u6536\u96c6\u8fd9\u4e9b\u6587\u4ef6\u3002
pyinstaller app.py --collect-data yapf_third_party --collect-data pyqcodeeditor -y --clean\n
\u8fd9\u91cc\u4f7f\u7528\u4e86\u4e24\u4e2a\u65b0\u7684\u9009\u9879-y
\u548c--clean
\u3002\u5176\u542b\u4e49\u548c\u7528\u9014\u5982\u4e0b\uff1a
-y
\u6307\u5b9a\u8be5\u9009\u9879\u540e\uff0c\u5982\u679c\u5b58\u5728\u4e4b\u524d\u751f\u6210\u7684\u6587\u4ef6\uff0c\u76f4\u63a5\u8fdb\u884c\u8986\u76d6\uff0c\u4e0d\u4f1a\u8be2\u95ee\u662f\u5426\u8981\u79fb\u9664\u5b83\u4eec\u3002
--clean
\u6e05\u9664\u7f13\u5b58\uff0c\u5e76\u79fb\u9664\u4e4b\u524d\u6784\u5efa\u65f6\u4ea7\u751f\u7684\u4e34\u65f6\u6587\u4ef6\u3002
\u6253\u5305\u5b8c\u6210\u540e\u3002\u53ef\u4ee5\u53d1\u73b0\uff0cyapf_third_party
\u548cpyqcodeeditor
\u4e2d\u7684\u8d44\u6e90\u6587\u4ef6\u6253\u5305\u5230_internal
\u76ee\u5f55\u4e0b\u4e86\u3002
\u8ba9\u6211\u4eec\u518d\u6b21\u8fd0\u884capp.exe
\uff0c\u5df2\u7ecf\u53ef\u4ee5\u6b63\u5e38\u663e\u793a\u7a0b\u5e8f\u754c\u9762\u4e86\u3002
\u5c0f\u7ed3\uff1a\u5982\u679c\u7a0b\u5e8f\u5f15\u7528\u4e86\u4e00\u4e9b\u7b2c\u4e09\u65b9\u5e93\uff0c\u800cpyinstaller
\u76ee\u524d\u8fd8\u65e0\u6cd5\u81ea\u52a8\u6536\u96c6\u8fd9\u4e9b\u5e93\u6216\u662f\u5176\u8d44\u6e90\u6587\u4ef6\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528--collect-xxx
\u9009\u9879\u624b\u52a8\u5305\u542b\u9700\u8981\u7684\u6587\u4ef6\u3002
"},{"location":"packaging/#1_2","title":"\uff081\uff09\u9879\u76ee\u8d44\u6e90\u6587\u4ef6","text":"\u73b0\u5728\uff0c\u6211\u4eec\u7684\u5e94\u7528\u4ecd\u7136\u5b58\u5728\u4e00\u4e2a\u5c0f\u95ee\u9898\uff1a\u5f53\u6211\u4eec\u5355\u51fbHelp
\u83dc\u5355\u4e0b\u7684About
\u83dc\u5355\u9879\uff0c\u672c\u5e94\u5f39\u51fa\u4e00\u4e2a\u5173\u4e8e\u5bf9\u8bdd\u6846\uff0c\u4f46\u662f\uff0c\u4ec0\u4e48\u90fd\u6ca1\u6709\u53d1\u751f\u3002
\u8ba9\u6211\u4eec\u4ece\u547d\u4ee4\u884c\u8f93\u51fa\u4e2d\u5b9a\u4f4d\u95ee\u9898\uff1a
Traceback (most recent call last):\n File \"pyguiadapter\\window.py\", line 361, in _on_triggered\n File \"app.py\", line 40, in on_action_about\n File \"pyguiadapter\\utils\\messagebox.py\", line 264, in show_text_file\n File \"pyguiadapter\\utils\\io.py\", line 2, in read_text_file\nFileNotFoundError: [Errno 2] No such file or directory: '...\\\\dist\\\\app\\\\_internal\\\\about.html'\n
\u975e\u5e38\u6e05\u6670\u7684\u9519\u8bef\u6d88\u606f\uff1aapp.py
\u7684\u7b2c40\u884c
\u7528\u5230\u4e86\u4e00\u4e2a\u6587\u4ef6about.html
\uff0c\u4f46\u8be5\u6587\u4ef6\u5e76\u4e0d\u5b58\u5728\u3002
about.html
\u4e0eapp.py
\u5728\u540c\u4e00\u76ee\u5f55\u4e0b\uff0cpyinstaller
\u5728\u6253\u5305\u65f6\u5374\u6ca1\u6709\u5c06about.html
\u6253\u5305\u5230_internal
\u76ee\u5f55\u4e0b\uff0c\u8fd9\u5c31\u662f\u95ee\u9898\u7684\u6839\u6e90\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u9700\u8981\u624b\u52a8\u6307\u5b9a\u9879\u76ee\u4e2d\u54ea\u4e9b\u8d44\u6e90\u6587\u4ef6\u9700\u8981\u88ab\u6253\u5305\u5230\u6700\u7ec8\u4ea7\u7269\u4e2d\u3002\u5bf9\u6b64\uff0cpyinstaller
\u63d0\u4f9b\u4e86--add-data
\u9009\u9879\u3002
--add-data SOURCE:DEST
\uf0c1
Additional data files or directories containing data files to be added to the application. The argument value should be in form of \u201csource:dest_dir\u201d, where source is the path to file (or directory) to be collected, dest_dir is the destination directory relative to the top-level application directory, and both paths are separated by a colon (:). To put a file in the top-level application directory, use . as a dest_dir. This option can be used multiple times.
\u8ba9\u6211\u4eec\u6dfb\u52a0\u9700\u8981\u6253\u5305\u7684\u6587\u4ef6\uff0c\u7136\u540e\u518d\u6b21\u8fdb\u884c\u6253\u5305\uff1a
pyinstaller app.py --collect-data yapf_third_party --collect-data pyqcodeeditor --add-data \"./about.html:./\" -y --clean\n
--add-data \"./about.html:./\"
\u7684\u542b\u4e49\u662f\uff1a\u628a\u5f53\u524d\u76ee\u5f55\uff08./\uff09
\u4e0b\u7684about.html
\u6587\u4ef6\u6253\u5305\u5230\u76ee\u6807\u4ea7\u7269\u7684\u6839\u76ee\u5f55(./)
\u4e0b
\u800c\u5728\u65b0\u7248\u672c\u7684pyinstaller
\u4e2d\uff0c\u6700\u7ec8\u4ea7\u7269\u7684\u6839\u76ee\u5f55\u5c31\u662f_internal
\u76ee\u5f55\u3002
\u6253\u5305\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u53d1\u73b0about.html
\u5df2\u7ecf\u88ab\u6253\u5305\u5230_internal
\u76ee\u5f55\u4e0b\u4e86\u3002
\u518d\u6b21\u8fd0\u884capp.exe
\uff0c\u73b0\u5728\u7ec8\u4e8e\u53ef\u4ee5\u6b63\u5e38\u5f39\u51fa\u5bf9\u8bdd\u6846\u4e86\uff1a
"},{"location":"packaging/#3","title":"\uff083\uff09\u5173\u4e8e\u6587\u4ef6\u8def\u5f84\u7684\u4e00\u4e9b\u63d0\u793a","text":"\u4e3a\u4e86\u5728\u7a0b\u5e8f\u6253\u5305\u540e\u4ecd\u7136\u53ef\u4ee5\u8bbf\u95ee\u5230\u9879\u76ee\u4e2d\u7684\u8d44\u6e90\u6587\u4ef6\uff0c\u9700\u8981\u5728\u4ee3\u7801\u4e2d\u5fc5\u987b\u975e\u5e38\u5c0f\u5fc3\u7684\u9664\u4e86\u8def\u5f84\u95ee\u9898\uff0c\u5c24\u5176\u662f\u91c7\u7528\u76f8\u5bf9\u8def\u5f84
\u65f6\uff0c\u6e90\u7801\u72b6\u6001\u4e0b\u548c\u6253\u5305\u72b6\u6001\u4e0b\u76f8\u5bf9\u8def\u5f84
\u4e2d\u201c\u76f8\u5bf9\u201d\u7684\u542b\u4e49\u662f\u4e0d\u540c\u7684\uff0c\u5177\u4f53\u800c\u8a00\uff0c\u201c\u76f8\u5bf9\u201d\u7684\u8d77\u70b9\u4e0d\u540c\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u4e00\u79cd\u53ef\u884c\u7684\u65b9\u6cd5\u662f\uff0c\u4ee5__file__
\u4e3a\u8d77\u70b9\u5bf9\u8def\u5f84\u8fdb\u884c\u5b9a\u4f4d\uff0c\u672c\u4f8b\u4e2d\u5c31\u662f\u91c7\u7528\u8fd9\u79cd\u505a\u6cd5\u3002
"},{"location":"packaging/#_4","title":"\uff08\u56db\uff09\u4fee\u6539\u53ef\u6267\u884c\u6587\u4ef6\u540d\u79f0\u3001\u56fe\u6807","text":""},{"location":"packaging/#1_3","title":"1\u3001\u4fee\u6539\u53ef\u6267\u884c\u6587\u4ef6\u540d","text":"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cpyinstaller
\u751f\u6210\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u540d\u79f0\u5c06\u4e0e\u8f93\u5165\u7684\u6e90\u7801\u6587\u4ef6\u540d\u79f0\u4e00\u81f4\u3002\u6bd4\u5982\uff0c\u5728windows
\u5e73\u53f0\u4e0b\uff0capp.py
\u6253\u5305\u540e\u7684\u4e8c\u8fdb\u5236\u53ef\u6267\u884c\u6587\u4ef6\u540d\u9ed8\u8ba4\u4e3aapp.exe
\u3002\u5f53\u7136\uff0cpyinstaller
\u5141\u8bb8\u6211\u4eec\u6307\u5b9a\u53ef\u6267\u884c\u6587\u4ef6\u7684\u540d\u79f0\uff0c\u65b9\u6cd5\u662f\u4f7f\u7528--name
\u9009\u9879\u3002
-n NAME
, --name NAME
\uf0c1
Name to assign to the bundled app and spec file (default: first script\u2019s basename)
\u73b0\u5728\uff0c\u8ba9\u6211\u4eec\u628a\u7a0b\u5e8f\u540d\u79f0\u4fee\u6539\u4e3aEquation-Solver
\u3002
\u9996\u5148\uff0c\u628a\u4e4b\u524d\u751f\u6210\u7684dist
\u3001build
\u3001app.spec
\u6587\u4ef6\u5220\u9664\u3002\u7136\u540e\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a
pyinstaller app.py --name \"Equation-Solver\" --collect-data yapf_third_party --collect-data pyqcodeeditor --add-data \"./about.html:./\" -y --clean\n
\u6253\u5305\u5b8c\u6210\u540e\uff0c\u91cd\u65b0\u751f\u6210\u4e86\u4e00\u4e2a.spec
\u6587\u4ef6\uff0c\u540d\u79f0\u4e3aEquation-Solver.spec
\u3002\u5728dist/Equation-Solver
\u76ee\u5f55\u4e0b\uff0c\u751f\u6210\u4e86\u4e00\u4e2a\u540d\u4e3aEquation-Solver.exe
\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002
"},{"location":"packaging/#2_1","title":"2\u3001\u4fee\u6539\u53ef\u6267\u884c\u6587\u4ef6\u7684\u56fe\u6807","text":"pyinstaller
\u751f\u6210\u7684\u53ef\u6267\u884c\u6587\u4ef6\u5177\u6709\u4e00\u4e2a\u9ed8\u8ba4\u7684\u56fe\u6807\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u5176\u66ff\u6362\u6210\u81ea\u5df1\u7684\u56fe\u6807\uff0c\u65b9\u6cd5\u662f\u4f7f\u7528--icon
\u9009\u9879\u3002
-i <FILE.ico or FILE.exe,ID or FILE.icns or Image or \"NONE\">
, --icon <FILE.ico or FILE.exe,ID or FILE.icns or Image or \"NONE\">
\uf0c1
FILE.ico: apply the icon to a Windows executable. FILE.exe,ID: extract the icon with ID from an exe. FILE.icns: apply the icon to the .app bundle on Mac OS. If an image file is entered that isn\u2019t in the platform format (ico on Windows, icns on Mac), PyInstaller tries to use Pillow to translate the icon into the correct format (if Pillow is installed). Use \u201cNONE\u201d to not apply any icon, thereby making the OS show some default (default: apply PyInstaller\u2019s icon). This option can be used multiple times.
\u9996\u5148\uff0c\u9700\u8981\u51c6\u5907\u597d\u56fe\u6807\u6587\u4ef6\uff08.ico
\u6216.icns
\u683c\u5f0f\uff09\uff0c\u5e76\u5c06\u5176\u653e\u5230app.py
\u540c\u76ee\u5f55\u4e0b\u3002
\u6267\u884c\u4ee5\u4e0b\u6253\u5305\u547d\u4ee4\uff1a
pyinstaller app.py --name \"Equation-Solver\" --icon \"./icon.ico\" --collect-data yapf_third_party --collect-data pyqcodeeditor --add-data \"./about.html:./\" -y --clean\n
\u6253\u5305\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u5c31\u5f97\u5230\u4e86\u4e00\u4e2a\u5e26\u81ea\u5b9a\u4e49\u56fe\u6807\u7684\u53ef\u6267\u884c\u6587\u4ef6\u4e86\uff1a
"},{"location":"packaging/#_5","title":"\uff08\u4e94\uff09\u7a97\u53e3\u6a21\u5f0f","text":"pyinstaller
\u6253\u5305\u5e94\u7528\u7a0b\u5e8f\u7684\u65f6\u5019\u9ed8\u8ba4\u4f7f\u7528-c
\u9009\u9879\uff0c\u56e0\u6b64\u6253\u5f00\u751f\u6210\u7684\u53ef\u6267\u884c\u6587\u4ef6\u65f6\u5c06\u540c\u65f6\u6253\u5f00\u4e00\u4e2a\u63a7\u5236\u53f0\u7a97\u53e3\u4f5c\u4e3a\u5176\u6807\u51c6io\u3002\u82e5\u8981\u9690\u85cf\u8be5\u7a97\u53e3\uff0c\u53ef\u4ee5\u4f7f\u7528-w
\u9009\u9879\u3002
-w
, --windowed
, --noconsole
\uf0c1
Windows and Mac OS X: do not provide a console window for standard i/o. On Mac OS this also triggers building a Mac OS .app bundle. On Windows this option is automatically set if the first script is a \u2018.pyw\u2019 file. This option is ignored on *NIX systems.
pyinstaller app.py -w --name \"Equation-Solver\" --icon \"./icon.ico\" --collect-data yapf_third_party --collect-data pyqcodeeditor --add-data \"./about.html:./\" -y --clean\n
"},{"location":"packaging/#_6","title":"\uff08\u516d\uff09\u5355\u6587\u4ef6\u6a21\u5f0f","text":"pyinstaller
\u5728\u6253\u5305\u65f6\uff0c\u9ed8\u8ba4\u4f1a\u751f\u6210\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u4ee5\u53ca\u4e00\u4e2a\u7528\u4e8e\u5b58\u653e\u5176\u4ed6\u6587\u4ef6\u7684\u76ee\u5f55\uff08\u9ed8\u8ba4\u4e3a_internal
\uff09\u3002pyinstaller
\u4e5f\u652f\u6301\u5c06\u6240\u6709\u6587\u4ef6\u6253\u5305\u6210\u5355\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u65b9\u6cd5\u662f\u4f7f\u7528-F
\u9009\u9879\u3002
-F
, --onefile
\uf0c1
Create a one-file bundled executable.
\u9996\u5148\uff0c\u5c06dist/
\u76ee\u5f55\u6e05\u7a7a\u3002\u7136\u540e\u6267\u884c\u4e0b\u5217\u547d\u4ee4\u3002
pyinstaller app.py -F -w --name \"Equation-Solver\" --icon \"./icon.ico\" --collect-data yapf_third_party --collect-data pyqcodeeditor --add-data \"./about.html:./\" -y --clean\n
\u6253\u5305\u5b8c\u6210\u540e\uff0cdist/
\u76ee\u5f55\u4e0b\u53ea\u6709\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u5176\u4ed6\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u6253\u5305\u5230\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u4e86\u3002
\u73b0\u5728\u53ea\u9700\u8981\u4e00\u4e2a\u6587\u4ef6\u5c31\u53ef\u4ee5\u5b8c\u6210\u7a0b\u5e8f\u7684\u5206\u53d1\u4e86\u3002
\u76f8\u6bd4\u591a\u6587\u4ef6\u6a21\u5f0f\uff0c\u5355\u6587\u4ef6\u6253\u5305\u7684\u4f18\u52bf\u4e3b\u8981\u5305\u62ec\u4ee5\u4e0b\u4e24\u70b9\uff1a
- \u65b9\u4fbf\u90e8\u7f72\u548c\u5206\u53d1
- \u603b\u7684\u4f53\u79ef\u66f4\u5c0f
\u4e0d\u8db3\u5728\u4e8e\u5e94\u7528\u542f\u52a8\u7684\u901f\u5ea6\u53ef\u80fd\u4f1a\u7a0d\u6162\u4e00\u4e9b\uff08\u8fd0\u884c\u901f\u5ea6\u4e0d\u53d7\u5f71\u54cd\uff09\uff0c\u4f46\u662f\u4e00\u822c\u4e0d\u662f\u5f88\u660e\u663e\u3002
\u5c31\u672c\u793a\u4f8b\u6765\u8bf4\uff0c\u5728\u542f\u7528\u5355\u6587\u4ef6\u6a21\u5f0f\u524d\uff0c\u6240\u6709\u6587\u4ef6\u4f53\u79ef\u52a0\u8d77\u6765\u6709114MB
\u5de6\u53f3\uff0c\u800c\u91c7\u7528\u5355\u6587\u4ef6\u6a21\u5f0f\u540e\uff0c\u6587\u4ef6\u4f53\u79ef\u88ab\u538b\u7f29\u523046.5MB
\uff0c\u53ef\u4ee5\u8bf4\u6548\u679c\u663e\u8457\u3002
"},{"location":"packaging/#_7","title":"\uff08\u4e03\uff09\u8fdb\u4e00\u6b65\u538b\u7f29\u4f53\u79ef\u7684\u65b9\u6cd5","text":""},{"location":"packaging/#1-strip","title":"1\u3001\u4f7f\u7528--strip
\u9009\u9879","text":"\u6309\u7167pyinstaller
\u5b98\u65b9\u7684\u8bf4\u6cd5\uff0c\u8be5\u9009\u9879\u53ef\u7528\u4e8e\u53bb\u9664\u53ef\u6267\u884c\u6587\u4ef6\u548c\u5171\u4eab\u5e93\u4e2d\u7684\u7b26\u53f7\u8868\uff08\u5728Windows
\u4e0b\u4e0d\u63a8\u8350\u4f7f\u7528\uff09\uff0c\u8fd9\u53ef\u80fd\u6709\u52a9\u4e8e\u51cf\u5c11\u751f\u6210\u6587\u4ef6\u7684\u4f53\u79ef\u3002
-s
, --strip
\uf0c1
Apply a symbol-table strip to the executable and shared libs (not recommended for Windows)
"},{"location":"packaging/#2upx","title":"2\u3001\u4f7f\u7528upx
","text":"\u7b14\u8005\u6ca1\u6709\u5b9e\u9645\u5c1d\u8bd5\u8fd9\u79cd\u65b9\u6cd5\uff0c\u5177\u4f53\u7684\u65b9\u6cd5\u53ef\u4ee5\u53c2\u8003pyinstaller
\u7684\u5b98\u65b9\u6587\u6863\uff1aUsing Upx\u3002
"},{"location":"packaging/#_8","title":"\uff08\u516b\uff09\u7ed3\u8bed","text":"pyinstaller
\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u6253\u5305\u9009\u9879\uff0c\u672c\u6587\u4ec5\u4ec5\u5bf9\u5e38\u7528\u7684\u51e0\u4e2a\u9009\u9879\u8fdb\u884c\u4e00\u4e9b\u8bf4\u660e\u548c\u6f14\u793a\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u8fdb\u4e00\u6b65\u9605\u8bfb\u5b98\u65b9\u6587\u6863\uff0c\u4e86\u89e3\u66f4\u591a\u7ec6\u8282\u4e86\uff0c\u6253\u5305\u8fc7\u7a0b\u4e2d\u9047\u5230\u7684\u7edd\u5927\u591a\u6570\u95ee\u9898\u90fd\u53ef\u4ee5\u5728\u5176\u4e2d\u627e\u5230\u89e3\u51b3\u65b9\u6cd5\uff0c\u4ee5\u4e0b\u662fpyinstaller
\u5b98\u65b9\u6587\u6863\u7684\u5730\u5740\uff1aPyInstaller Manual \u2014 PyInstaller 6.10.0 documentation\u3002
\u8fd9\u91cc\uff0c\u4e5f\u8d34\u51fa\u672c\u6b21\u6f14\u793a\u6700\u7ec8\u7684spec
\u6587\u4ef6\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u8fd9\u4e2a\u6587\u4ef6\u57fa\u7840\u4e0a\u8fdb\u884c\u4fee\u6539\uff0c\u4ece\u800c\u5feb\u901f\u5f97\u5230\u7b26\u5408\u81ea\u5df1\u9879\u76ee\u5b9e\u9645\u7684\u6253\u5305\u914d\u7f6e\u6587\u4ef6\u3002
examples/packaging/Equation-Solver.spec
# -*- mode: python ; coding: utf-8 -*-\nfrom PyInstaller.utils.hooks import collect_data_files\n\ndatas = [('./about.html', './')]\ndatas += collect_data_files('yapf_third_party')\ndatas += collect_data_files('pyqcodeeditor')\n\n\na = Analysis(\n ['app.py'],\n pathex=[],\n binaries=[],\n datas=datas,\n hiddenimports=[],\n hookspath=[],\n hooksconfig={},\n runtime_hooks=[],\n excludes=[],\n noarchive=False,\n optimize=0,\n)\npyz = PYZ(a.pure)\n\nexe = EXE(\n pyz,\n a.scripts,\n a.binaries,\n a.datas,\n [],\n name='Equation-Solver',\n debug=False,\n bootloader_ignore_signals=False,\n strip=False,\n upx=True,\n upx_exclude=[],\n runtime_tmpdir=None,\n console=False,\n disable_windowed_traceback=False,\n argv_emulation=False,\n target_arch=None,\n codesign_identity=None,\n entitlements_file=None,\n icon=['icon.ico'],\n)\n
"},{"location":"progressbar/","title":"\u8fdb\u5ea6\u6761\u4e0e\u8fdb\u5ea6\u5bf9\u8bdd\u6846","text":""},{"location":"progressbar/#_1","title":"\u8fdb\u5ea6\u6761","text":""},{"location":"progressbar/#_2","title":"\uff08\u4e00\uff09\u6982\u8ff0","text":"PyGUIAdapter
\u63d0\u4f9b\u4e86\u8fdb\u5ea6\u6761\u529f\u80fd\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u663e\u793a\u3001\u9690\u85cf\u548c\u66f4\u65b0\u8fdb\u5ea6\u6761\u3002
\u8fdb\u5ea6\u6761\u4f4d\u4e8e\u51fd\u6570\u6267\u884c\u7a97\u53e3Ouput Dock
\u4e2d\uff0c\u5728\u8f93\u51fa\u6d4f\u89c8\u5668\u4e0b\u65b9\uff0c\u4e3b\u8981\u5305\u62ec\u4e09\u4e2a\u90e8\u5206\uff1a
-
Progress Bar\uff1a\u8fdb\u5ea6\u6761\u672c\u4f53\u3002
-
Message\uff1a\u8fdb\u5ea6\u6761\u4e0a\u663e\u793a\u7684\u8fdb\u5ea6\u4fe1\u606f\u3002
-
Info\uff1a\u989d\u5916\u663e\u793a\u7684\u4fe1\u606f\u3002
\u76f8\u5173\u7684API\u5728pyguiadapter.adapter.uprogress
\u6a21\u5757\u4e2d\uff0c\u4e3b\u8981\u5305\u542b\u4ee5\u4e0b\u4e09\u4e2a\u63a5\u53e3\uff1a
-
show_progressbar()
\uff1a\u7528\u4e8e\u663e\u793a\u8fdb\u5ea6\u6761\u3002
-
hide_progressbar()
\uff1a\u7528\u4e8e\u9690\u85cf\u8fdb\u5ea6\u6761\u3002
-
update_progress()
\uff1a\u7528\u4e8e\u66f4\u65b0\u8fdb\u5ea6\u4fe1\u606f\u548c\u989d\u5916\u663e\u793a\u7684\u4fe1\u606f\u3002
\u5404\u4e2a\u51fd\u6570\u5177\u4f53\u4fe1\u606f\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.adapter.uprogress
"},{"location":"progressbar/#_3","title":"\uff08\u4e8c\uff09\u793a\u4f8b","text":"import time\n\nfrom pyguiadapter.adapter import GUIAdapter, udialog\nfrom pyguiadapter.adapter import uprogress\nfrom pyguiadapter.adapter.ucontext import is_function_cancelled\nfrom pyguiadapter.adapter.uoutput import uprint\n\n\ndef progressbar_example(total: int = 100, delay: float = 0.5):\n \"\"\"\n example for **progressbar** and **cancellable function**\n\n @param total: how many task will be processed\n @param delay: how much time will be consumed per task\n @return:\n \"\"\"\n uprogress.show_progressbar(0, total, message_visible=True)\n cancelled = False\n task_processed = 0\n for i in range(total):\n if is_function_cancelled():\n uprint(\"Cancelled!\")\n cancelled = True\n break\n task_processed = i + 1\n uprint(f\"[Processed] {task_processed}\")\n uprogress.update_progress(\n task_processed, info=f\"[{task_processed}/{total}] please wait...\"\n )\n time.sleep(delay)\n if cancelled:\n udialog.show_warning_messagebox(\n f\"{task_processed} task(s) processed!\", title=\"Cancelled\"\n )\n else:\n udialog.show_info_messagebox(\n f\"{task_processed} task(s) processed!\", title=\"Completed\"\n )\n uprogress.hide_progressbar()\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(progressbar_example, cancelable=True)\n adapter.run()\n
\u6548\u679c\u5982\u4e0b\uff1a
"},{"location":"progressbar/#_4","title":"\u8fdb\u5ea6\u5bf9\u8bdd\u6846","text":""},{"location":"progressbar/#_5","title":"\uff08\u4e00\uff09\u6982\u8ff0","text":"\u9664\u4e86\u96c6\u6210\u5728Ouput Dock
\u4e2d\u7684\u8fdb\u5ea6\u6761\uff0cPyGUIAdapter
\u8fd8\u63d0\u4f9b\u4e86\u72ec\u7acb\u8fdb\u5ea6\u5bf9\u8bdd\u6846\u529f\u80fd\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u663e\u793a\u3001\u9690\u85cf\u548c\u66f4\u65b0\u8fdb\u5ea6\u5bf9\u8bdd\u6846\u3002
\u8fdb\u5ea6\u5bf9\u8bdd\u6846
\u4e3b\u8981\u5305\u62ec\u4ee5\u4e0b\u56db\u4e2a\u90e8\u5206\uff1a
-
Progress Bar\uff1a\u8fdb\u5ea6\u6761\u3002
-
Message\uff1a\u8fdb\u5ea6\u6761\u4e0a\u663e\u793a\u7684\u8fdb\u5ea6\u4fe1\u606f\u3002
-
Info\uff1a\u989d\u5916\u663e\u793a\u7684\u4fe1\u606f\u3002
-
Cancel Button\uff1a\u53d6\u6d88\u6309\u94ae\u3002\u4ec5\u5728function\u88ab\u6807\u8bb0\u4e3acancelable=True
\u65f6\u663e\u793a\u3002\u4e0e\u6267\u884c\u7a97\u53e3\u754c\u9762\u4e0a\u7684\u53d6\u6d88\u6309\u94ae\u529f\u80fd\u4e00\u81f4\uff0c\u7528\u4e8e\u8bf7\u6c42\u53d6\u6d88\u5f53\u524d\u6b63\u5728\u6267\u884c\u7684\u51fd\u6570\u3002
\u76f8\u5173\u7684API\u5728pyguiadapter.adapter.uprogress
\u6a21\u5757\u4e2d\uff0c\u4e3b\u8981\u5305\u542b\u4ee5\u4e0b\u4e09\u4e2a\u63a5\u53e3\uff1a
-
show_progress_dialog()
\uff1a\u7528\u4e8e\u663e\u793a\u8fdb\u5ea6\u5bf9\u8bdd\u6846\u3002
-
dismiss_progress_dialog()
\uff1a\u7528\u4e8e\u53d6\u6d88\u8fdb\u5ea6\u5bf9\u8bdd\u6846\u3002
-
update_progress_dialog()
\uff1a\u7528\u4e8e\u66f4\u65b0\u8fdb\u5ea6\u5bf9\u8bdd\u6846\u4e2d\u8fdb\u5ea6\u6761\u7684\u8fdb\u5ea6\u4fe1\u606f\u548c\u989d\u5916\u663e\u793a\u7684\u4fe1\u606f\u3002
\u5404\u4e2a\u51fd\u6570\u5177\u4f53\u4fe1\u606f\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.adapter.uprogress
"},{"location":"progressbar/#_6","title":"\uff08\u4e8c\uff09\u793a\u4f8b","text":"import time\n\nfrom pyguiadapter.adapter import GUIAdapter, udialog\nfrom pyguiadapter.adapter import uprogress\nfrom pyguiadapter.adapter.ucontext import is_function_cancelled\nfrom pyguiadapter.adapter.uoutput import uprint\n\n\ndef progress_dialog_example(total: int = 100, delay: float = 0.5):\n \"\"\"\n An example for **progress dialog** features\n\n @param total: how many task will be processed\n @param delay: how much time will be consumed per task\n @return:\n \"\"\"\n cancelled = False\n task_processed = 0\n # use this function to show a progress dialog\n uprogress.show_progress_dialog(\n 0, total, message_visible=True, info_visible=True, modal=False\n )\n for i in range(total):\n if is_function_cancelled():\n uprint(\"Cancelled!\")\n cancelled = True\n break\n task_processed = i + 1\n uprint(f\"[Processed] {task_processed}\")\n # use this function to update the progressbar and info message in the progress dialog\n uprogress.update_progress_dialog(\n task_processed, info=f\"[{task_processed}/{total}] please wait...\"\n )\n time.sleep(delay)\n if cancelled:\n udialog.show_warning_messagebox(\n f\"{task_processed} task(s) processed!\", title=\"Cancelled\"\n )\n else:\n udialog.show_info_messagebox(\n f\"{task_processed} task(s) processed!\", title=\"Completed\"\n )\n # use this function to dismiss the progress dialog after the task is done\n uprogress.dismiss_progress_dialog()\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(progress_dialog_example, cancelable=True)\n adapter.run()\n
\u6548\u679c\u5982\u4e0b\uff1a
"},{"location":"quickstart/","title":"\u5feb\u901f\u5f00\u59cb","text":""},{"location":"quickstart/#_1","title":"\uff08\u4e00\uff09\u524d\u7f6e\u6761\u4ef6","text":"\u8981\u4f7f\u7528PyGUIAdapter
\u5f00\u53d1\u5e94\u7528\u7a0b\u5e8f\uff0c\u9700\u6ee1\u8db3\u4ee5\u4e0b\u6761\u4ef6\uff1a
Python
\u7248\u672c >= 3.8
- \u5b89\u88c5
PyGUIAdapter
- \u5b89\u88c5Qt\u7684\u7ed1\u5b9a\u5e93\u4e4b\u4e00\uff0c\u53ef\u9009\uff1a
PyQt5
\u3001PyQt6
\u3001PySide2
\u3001PySide6
"},{"location":"quickstart/#_2","title":"\uff08\u4e8c\uff09\u5b89\u88c5\u4f9d\u8d56","text":"1\u3001\u5b89\u88c5PyGUIAdapter
pip install PyGUIAdapter\n
2\u3001\u5b89\u88c5Qt\u7684\u7ed1\u5b9a\u5e93\uff0c\u8fd9\u91cc\u4ee5PySide2
\u4e3a\u4f8b\uff1a
pip install pyside2\n
\u5982\u679c\u4f60\u7684\u73af\u5883\u4e0b\u540c\u65f6\u5b89\u88c5\u4e86\u591a\u4e2aQt\u7ed1\u5b9a\u5e93\uff0cqtpy
\u9ed8\u8ba4\u4f1a\u4f7f\u7528PyQt5
(\u5982\u679c\u5b58\u5728\u7684\u8bdd)\u3002\u53ef\u4ee5\u901a\u8fc7\u73af\u5883\u53d8\u91cfQT_API
\u660e\u786e\u6307\u5b9a\u8981\u4f7f\u7528\u7684\u7ed1\u5b9a\u5e93\uff0c\u53ef\u4ee5\u6307\u5b9a\u4ee5\u4e0b\u503c\uff1a
pyqt5
pyside2
pyqt6
pyside6
\u53ef\u4ee5\u53c2\u89c1qtpy\u5b98\u65b9\u8bf4\u660e\u3002
"},{"location":"quickstart/#_3","title":"\uff08\u4e09\uff09\u7f16\u5199\u4ee3\u7801","text":""},{"location":"quickstart/#1","title":"1\u3001\u5b9e\u73b0\u4e1a\u52a1\u903b\u8f91\uff0c\u5e76\u5c01\u88c5\u4e3a\u51fd\u6570\u3002","text":"from typing import Optional\n\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.exceptions import ParameterError\n\n\ndef equation_solver(a: float = 1.0, b: float = 0.0, c: float = 0.0) -> Optional[tuple]:\n \"\"\"A simple equation solver for equations like:\n\n **ax^2 + bx + c = 0** (a, b, c \u2208 **R** and a \u2260 0)\n\n @param a: a \u2208 R and a \u2260 0\n @param b: b \u2208 R\n @param c: c \u2208 R\n @return:\n \"\"\"\n if a == 0:\n raise ParameterError(parameter_name=\"a\", message=\"a cannot be zero!\")\n uprint(f\"Equation:\")\n uprint(f\" {a}x\u00b2 + {b}x + {c} = 0\")\n delta = b**2 - 4 * a * c\n if delta < 0:\n return None\n x1 = (-b + delta**0.5) / (2 * a)\n if delta == 0:\n return x1, x1\n x2 = (-b - delta**0.5) / (2 * a)\n return x1, x2\n
"},{"location":"quickstart/#2gui","title":"2\u3001\u521b\u5efaGUI\u754c\u9762","text":"from pyguiadapter.adapter import GUIAdapter\n...\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(equation_solver)\n adapter.run()\n
\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a
from typing import Optional\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.exceptions import ParameterError\n\n\ndef equation_solver(a: float = 1.0, b: float = 0.0, c: float = 0.0) -> Optional[tuple]:\n \"\"\"A simple equation solver for equations like:\n\n **ax^2 + bx + c = 0** (a, b, c \u2208 **R** and a \u2260 0)\n\n @param a: a \u2208 R and a \u2260 0\n @param b: b \u2208 R\n @param c: c \u2208 R\n @return:\n \"\"\"\n if a == 0:\n raise ParameterError(parameter_name=\"a\", message=\"a cannot be zero!\")\n uprint(f\"Equation:\")\n uprint(f\" {a}x\u00b2 + {b}x + {c} = 0\")\n delta = b**2 - 4 * a * c\n if delta < 0:\n return None\n x1 = (-b + delta**0.5) / (2 * a)\n if delta == 0:\n return x1, x1\n x2 = (-b - delta**0.5) / (2 * a)\n return x1, x2\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(equation_solver)\n adapter.run()\n
\u754c\u9762\u6548\u679c\u5982\u4e0b\uff1a
"},{"location":"quickstart/#_4","title":"\uff08\u56db\uff09\u4e00\u4e9b\u8bf4\u660e","text":""},{"location":"quickstart/#1_1","title":"1\u3001\u539f\u7406","text":"\u5728PyGUIAdapter
\u4e2d\uff0c\u51fd\u6570\u662f\u754c\u9762\u7684\u57fa\u672c\u5355\u5143\uff0c\u4e00\u4e2a\u51fd\u6570\u5bf9\u5e94\u4e00\u4e2a\u7a97\u53e3\uff0c\u51fd\u6570\u7684\u53c2\u6570\u5217\u8868\u5219\u5b9a\u4e49\u4e86\u7a97\u53e3\u4e2d\u7684\u8f93\u5165\u63a7\u4ef6\u3002
\u5728\u57fa\u4e8e\u201c\u8f93\u5165\uff08Input\uff09-\u5904\u7406\uff08Process\uff09-\u8f93\u51fa\uff08Output\uff09
\u201d\u7684\u7a0b\u5e8f\u8bbe\u8ba1\u6a21\u578b\u4e2d\uff0cPyGUIAdapter
\u4e3a\u5f00\u53d1\u8005\u81ea\u52a8\u5b8c\u6210\u4e86\u201c\u8f93\u5165\uff08Input\uff09
\u201d\u548c\u201c\u8f93\u51fa\uff08Output\uff09
\u201d\u8fd9\u4e24\u4e2a\u73af\u8282\u3002\u56e0\u6b64\uff0c\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u5f00\u53d1\u8005\u552f\u4e00\u9700\u8981\u5173\u6ce8\u7684\u662f\u5982\u4f55\u5b9e\u73b0\u201c\u5904\u7406\uff08Process\uff09
\u201d\u73af\u8282\uff0c\u5373\u7a0b\u5e8f\u7684\u6838\u5fc3\u529f\u80fd\u6216\u8005\u8bf4\u4e1a\u52a1\u903b\u8f91\u3002
\u4e0e\u4f20\u7edfGUI\u7f16\u7a0b\u4e0d\u540c\uff0c\u5728PyGUIAdapter
\u4e2d\uff0c\u7a97\u53e3\u548c\u63a7\u4ef6\u7684\u521b\u5efa\u3001\u7ba1\u7406\u8fc7\u7a0b\u5bf9\u4e8e\u5f00\u53d1\u8005\u800c\u8a00\u662f\u900f\u660e\u7684\uff0c\u5f00\u53d1\u8005\u51e0\u4e4e\u4e0d\u4f1a\u611f\u77e5\u5230\u8fd9\u4e00\u8fc7\u7a0b\u7684\u5b58\u5728\u3002\u8fd9\u610f\u5473\u7740\uff0c\u5f00\u53d1\u8005\u4e0d\u4f1a\u88ab\u201c\u5982\u4f55\u521b\u5efa\u548c\u9500\u6bc1\u7a97\u53e3\u548c\u63a7\u4ef6\u201d
\u3001\u201c\u5982\u4f55\u5bf9\u63a7\u4ef6\u8fdb\u884c\u5e03\u5c40\u201d
\u3001\u201c\u5982\u4f55\u5904\u7406\u7528\u6237\u8f93\u5165\u201d
\u3001\u201c\u5982\u4f55\u54cd\u5e94\u4e8b\u4ef6\u201d
\u4e4b\u7c7b\u7ec6\u679d\u672b\u8282\u7684\u95ee\u9898\u5206\u6563\u6ce8\u610f\u529b\uff0c\u4ece\u800c\u80fd\u591f\u5c06\u5173\u6ce8\u70b9\u59cb\u7ec8\u805a\u7126\u5728\u6838\u5fc3\u529f\u80fd\u7684\u5b9e\u73b0\u4e0a\u3002
\u5c06\u754c\u9762\u4e0e\u903b\u8f91\u8fdb\u884c\u5206\u79bb\u88ab\u8ba4\u4e3a\u662f\u4e00\u79cd\u597d\u7684\u5b9e\u8df5\uff0c\u5982\u679c\u80fd\u591f\u5728\u5f00\u53d1\u8005\u65e0\u611f\u77e5\u7684\u60c5\u51b5\u4e0b\u5b8c\u6210\u5168\u90e8\uff08\u6216\u8005\u5927\u90e8\u5206\uff09GUI\u76f8\u5173\u7684\u7f16\u7a0b\u5de5\u4f5c\uff0c\u90a3\u4e48\u53ef\u4ee5\u8bf4\uff0c\u57fa\u4e8e\u8fd9\u79cd\u6784\u67b6\u7f16\u5199\u7684\u4ee3\u7801\u5929\u7136\u5c31\u662f\u903b\u8f91\u4e0e\u754c\u9762\u5206\u79bb\u7684\u3002\u8981\u5b9e\u73b0\u8fd9\u4e00\u70b9\uff0c\u5b9e\u9645\u4e0a\u4e0d\u4f1a\u975e\u5e38\u590d\u6742\uff0c\u4e5f\u65e0\u9700\u6240\u8c13\u7684\u201c\u9ed1\u9b54\u6cd5\u201d\uff0c\u53ea\u9700\u8981\u7528\u5230\u73b0\u4ee3Python\u7684\u4e00\u4e9b\u57fa\u672c\u7279\u6027\uff0c\u5305\u62ec\uff1a
- \u7c7b\u578b\u6ce8\u89e3\uff08type hint\uff09
- \u5185\u9192\u4e0e\u53cd\u5c04\uff08inspect\uff09
- \u6587\u6863\u5b57\u7b26\u4e32\uff08
docstring
\uff09
\u5177\u4f53\u800c\u8a00\uff0c\u5728\u8fd0\u884c\u65f6\uff0cPyGUIAdapter
\u4f1a\u4ece\u51fd\u6570\u7b7e\u540d\u4e2d\u8bfb\u53d6\u5176\u53c2\u6570\u5217\u8868\u4fe1\u606f\uff0c\u7136\u540e\u6839\u636e\u53c2\u6570\u7684\u7c7b\u578b\uff0c\u81ea\u52a8\u9009\u62e9\u6700\u5408\u9002\u63a7\u4ef6\u3002
\u4f8b\u5982\uff1a\u5bf9\u4e8eint
\u7c7b\u578b\u7684\u53c2\u6570\uff0c\u5c06\u9ed8\u8ba4\u521b\u5efaIntSpinBox
\uff1b\u5bf9\u4e8estr
\u7c7b\u578b\u7684\u53c2\u6570\uff0c\u5c06\u9ed8\u8ba4\u521b\u5efaLineEdit
\u7b49\u3002
\u540c\u65f6\uff0cPyGUIAdapter
\u8fd8\u5c06\u4ece\u51fd\u6570\u7684\u7b7e\u540d\u3001docstring
\u4e2d\uff0c\u5206\u6790\u3001\u6536\u96c6\u5176\u4ed6\u6709\u7528\u7684\u4fe1\u606f\uff0c\u5e76\u6839\u636e\u8fd9\u4e9b\u4fe1\u606f\uff0c\u81ea\u5b8c\u6210\u7a97\u53e3\u521b\u5efa\u3001\u754c\u9762\u5e03\u5c40\u548c\u4e8b\u4ef6\u7ed1\u5b9a\u7b49\u5de5\u4f5c\u3002
\u5f53\u7528\u6237\u70b9\u51fbExecute
\u6309\u94ae\u65f6\uff0cPyGUIAdapter
\u5c06\u4ece\u63a7\u4ef6\u4e2d\u6536\u96c6\u7528\u6237\u8f93\u5165\u7684\u6570\u636e\uff0c\u5bf9\u8fd9\u4e9b\u6570\u636e\u8fdb\u884c\u5fc5\u8981\u8f6c\u6362\u548c\u5904\u7406\u4e4b\u540e\uff0c\u5c06\u5176\u4f5c\u4e3a\u53c2\u6570\u8c03\u7528\u51fd\u6570\uff0c\u7136\u540e\u7b49\u5f85\u51fd\u6570\u6267\u884c\u5b8c\u6bd5\uff0c\u83b7\u53d6\u51fd\u6570\u7684\u8fd4\u56de\u503c\u6216\u5904\u7406\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u53d1\u751f\u7684\u5f02\u5e38\u3002
PyGUIAdapter
\u5145\u5206\u5229\u7528\u4e86Python\u7684\u7c7b\u578b\u6ce8\u89e3\u673a\u5236\u3002\u5728PyGUIAdapter
\u4e2d\uff0c\u51fd\u6570\u53c2\u6570\u7684\u7c7b\u578b\u6ce8\u89e3\u4e0d\u662f\u53ef\u6709\u53ef\u65e0\u7684\u4e1c\u897f\uff0c\u5b83\u662f\u751f\u6210\u53c2\u6570\u63a7\u4ef6\u7684\u51b3\u5b9a\u56e0\u7d20\u4e4b\u4e00\u3002\u867d\u7136\u5e76\u975e\u8bf4\u4e0d\u4f7f\u7528\u7c7b\u578b\u6ce8\u89e3\u5c31\u5b8c\u5168\u65e0\u6cd5\u5229\u7528PyGUIAdapter
\u2014\u2014PyGUIAdapter
\u4e5f\u5141\u8bb8\u5f00\u53d1\u8005\u624b\u52a8\u4e3a\u6bcf\u4e2a\u53c2\u6570\u663e\u5f0f\u5730\u6307\u5b9a\u63a7\u4ef6\u2014\u2014\u4f46\u662f\uff0c\u8fd9\u6837\u505a\u5728\u5f88\u5927\u7a0b\u5ea6\u4e0a\u5931\u53bb\u4e86\u4f7f\u7528PyGUIAdapter
\u5e26\u6765\u7684\u65b9\u4fbf\u3002\u56e0\u6b64\uff0c\u5f3a\u70c8\u5efa\u8bae\u5f00\u53d1\u8005\u517b\u6210\u4f7f\u7528\u7c7b\u578b\u6ce8\u89e3\u7684\u4e60\u60ef\u3002
"},{"location":"quickstart/#2","title":"2\u3001\u53c2\u6570\u6821\u9a8c\u4e0e\u5f02\u5e38\u5904\u7406","text":"\u7a0b\u5e8f\u8fd0\u884c\u65f6\u7684\u9519\u8bef\u6216\u8005\u5f02\u5e38\uff0c\u5f88\u591a\u65f6\u5019\u6839\u6e90\u5728\u4e8e\u672a\u7ecf\u6821\u9a8c\u7684\u7528\u6237\u8f93\u5165\u3002\u5728\u7f16\u5199\u7a0b\u5e8f\u65f6\uff0c\u8981\u907f\u514d\u8fc7\u5ea6\u4e50\u89c2\uff0c\u5c24\u5176\u662f\u5728\u6d89\u53ca\u5230\u4e0e\u7528\u6237\u8f93\u5165\u6253\u4ea4\u9053\u7684\u573a\u5408\uff0c\u8981\u5c3d\u91cf\u8003\u8651\u201c\u6700\u574f\u201d\u7684\u60c5\u51b5\uff0c\u4e5f\u5c31\u662f\u6240\u8c13\u7684\u201c\u8fb9\u754c\u6761\u4ef6\u201d\u3002\u5f88\u591a\u65f6\u5019\uff0c\u5949\u884c\u201c\u6c38\u8fdc\u4e0d\u8981\u76f8\u4fe1\u7528\u6237\u7684\u8f93\u5165\u201d\u53ef\u4ee5\u907f\u514d\u5f88\u591a\u95ee\u9898\uff08\u6216\u8005\u8bf4\u7edd\u5927\u90e8\u5206\u95ee\u9898\uff09\u3002\u5bf9\u7528\u6237\u8f93\u5165\u8fdb\u884c\u6821\u9a8c\uff0c\u5c3d\u53ef\u80fd\u8fc7\u6ee4\u90a3\u4e9b\u201c\u975e\u6cd5\u201d\u7684\u503c\u662f\u589e\u5f3a\u7a0b\u5e8f\u5065\u58ee\u6027\u7684\u5173\u952e\u6240\u5728\u3002
\u56e0\u6b64\uff0cPyGUIAdapter
\u9f13\u52b1\u5f00\u53d1\u8005\u5bf9\u51fd\u6570\u53c2\u6570\uff08\u5373\u7528\u6237\u8f93\u5165\uff09\u8fdb\u884c\u6821\u9a8c\uff0c\u5e76\u4e3a\u6b64\u63d0\u4f9b\u4e86\u4e00\u79cd\u7b80\u5355\u4e14\u7b26\u5408\u76f4\u89c9\u7684\u673a\u5236\u3002 \u5728\u4e0a\u8ff0\u793a\u4f8b\u4ee3\u7801\u4e2d\uff0c\u6709\u4ee5\u4e0b\u51e0\u884c\u4ee3\u7801\uff0c\u6f14\u793a\u4e86\u6821\u9a8c\u53c2\u6570\u7684\u57fa\u672c\u65b9\u5f0f\uff1a
...\n if a == 0:\n raise ParameterError(parameter_name=\"a\", message=\"a cannot be zero!\")\n ...\n
\u5bf9\u4e8e\u975e\u6cd5\u7684\u51fd\u6570\u53c2\u6570\u503c\uff0c\u5f00\u53d1\u8005\u53ea\u9700\u629b\u51faParameterError
\u5f02\u5e38\uff0c\u5373\u5b8c\u6210\u4e86\u53c2\u6570\u7684\u6821\u9a8c\u5de5\u4f5c\u3002PyGUIAdapter
\u5c06\u81ea\u52a8\u63a5\u7ba1\u540e\u7eed\u7684\u5de5\u4f5c\u2014\u2014\u5305\u62ec\u4ee5\u4e00\u79cd\u5408\u9002\u7684\u65b9\u5f0f\u63d0\u9192\u7528\u6237\u54ea\u91cc\u53d1\u751f\u4f55\u79cd\u5f02\u5e38\u3002
\u5f53\u7136\uff0c\u5f00\u53d1\u8005\u5982\u679c\u504f\u7231\u6240\u8c13\u7684\u201cValidator\u201d\u6a21\u5f0f\uff0c\u6216\u8005\u60f3\u8981\u590d\u7528\u67d0\u4e9b\u6821\u9a8c\u903b\u8f91\uff0c\u4e5f\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\uff1a
def non_zero_validator(parameter_name: str, value: Union[int, float]):\n if not isinstance(value, (int, float)):\n raise ParameterError(parameter_name, message=\"must be a number!\")\n\n if value == 0:\n raise ParameterError(parameter_name, message=\"cannot be zero!\")\n\n\ndef your_function(a: int, b: int, c: float):\n non_zero_validator(\"a\", a)\n non_zero_validator(\"b\", b)\n non_zero_validator(\"c\", c)\n
\u4e8b\u5b9e\u4e0a\uff0cPyGUIAdapter
\u5bf9\u4e8eParameterError
\u7684\u5904\u7406\u53ef\u4ee5\u770b\u4f5c\u4e00\u822c\u5f02\u5e38\u5904\u7406\u673a\u5236\u7684\u4e00\u4e2a\u7279\u4f8b\u3002\u5c3d\u7ba1PyGUIAdapter
\u9f13\u52b1\u5f00\u53d1\u8005\u5c3d\u53ef\u80fd\u9884\u89c1\u7a0b\u5e8f\u53ef\u80fd\u53d1\u751f\u7684\u5f02\u5e38\u5e76\u63d0\u524d\u89c4\u907f\u5b83\u4eec\uff0c\u4f46\u4ece\u5ba2\u89c2\u4e0a\u770b\uff0c\u7a0b\u5e8f\u7684\u5f02\u5e38\u65e0\u6cd5\u4fdd\u8bc1\u5b8c\u5168\u6d88\u9664\u3002\u56e0\u6b64\uff0c\u5bf9\u4e8e\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u53d1\u751f\u7684\u5f02\u5e38\uff0cPyGUIAdapter
\u91c7\u53d6\u7684\u9ed8\u8ba4\u7b56\u7565\u662f\uff1a\u6355\u83b7\u5b83\u4eec\uff0c\u5e76\u4ee5\u4e00\u79cd\u5408\u9002\u7684\u65b9\u5f0f\u63d0\u9192\u7528\u6237\uff0c\u800c\u4e0d\u662f\u8ba9\u6574\u4e2a\u7a0b\u5e8f\u76f4\u63a5\u5d29\u6e83\u3002 \u8fd9\u6837\u7684\u8bbe\u8ba1\u4e3b\u8981\u662f\u51fa\u4e8e\u589e\u5f3a\u7a0b\u5e8f\u5065\u58ee\u6027\u7684\u8003\u8651\u3002
"},{"location":"quickstart/#3","title":"3\u3001\u63cf\u8ff0\u6027\u4fe1\u606f\uff08\u5e2e\u52a9\u4fe1\u606f\uff09","text":"\u65e0\u8bba\u662f\u547d\u4ee4\u884c\u7a0b\u5e8f\u8fd8\u662f\u56fe\u5f62\u754c\u9762\u7a0b\u5e8f\uff0c\u4e3a\u7a0b\u5e8f\u53ca\u5176\u53c2\u6570\u63d0\u4f9b\u63cf\u8ff0\u6027\u6587\u5b57\u90fd\u662f\u975e\u5e38\u6709\u5fc5\u8981\u7684\u4e00\u4ef6\u4e8b\u3002\u8fd9\u4e9b\u6587\u5b57\u4e00\u822c\u88ab\u79f0\u4e3a\u7a0b\u5e8f\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5bf9\u4e8eCLI
\u7a0b\u5e8f\uff0c\u4e00\u822c\u4f7f\u7528-h
\u6216--help
\u6765\u83b7\u53d6\u5176\u5e2e\u52a9\u4fe1\u606f\uff0c\u4f8b\u5982\uff0c\u4e0b\u56fe\u662fpyhton -h
\u547d\u4ee4\u6253\u5370\u51fa\u7684Python
\u89e3\u91ca\u5668\u7a0b\u5e8f\u7684\u90e8\u5206\u5e2e\u52a9\u4fe1\u606f\u3002
PyGUIAdapter
\u540c\u6837\u652f\u6301\u4e3a\u51fd\u6570\u53c2\u6570\u4ee5\u53ca\u51fd\u6570\u672c\u8eab\u6dfb\u52a0\u63cf\u8ff0\u4fe1\u606f\u3002
\u5bf9\u4e8e\u51fd\u6570\u7684\u53c2\u6570\uff0cPyGUIAdapter
\u5728\u5176\u8f93\u5165\u63a7\u4ef6\u7684\u4e0a\u65b9\u9884\u7559\u4e86\u7528\u4e8e\u663e\u793a\u63cf\u8ff0\u4fe1\u606f\u7684\u7a7a\u95f4\uff1a
\u5bf9\u4e8e\u51fd\u6570\u672c\u8eab\uff0cPyGUIAdapter
\u5219\u63d0\u4f9b\u4e86\u4e13\u95e8\u7684\u6587\u6863\u6d4f\u89c8\u5668\uff08Document Browser\uff09
\u6765\u5c55\u793a\u5176\u8bf4\u660e\u4fe1\u606f\uff0c\u51fd\u6570\u7684\u63cf\u8ff0\u4fe1\u606f\uff0c\u4e00\u822c\u4e5f\u88ab\u79f0\u4e3a\u51fd\u6570\u7684\u8bf4\u660e\u6587\u6863\uff1a
\u56de\u770b\u793a\u4f8b\u4ee3\u7801\uff0c\u6211\u4eec\u4f3c\u4e4e\u5e76\u4f7f\u7528\u901a\u8fc7\u7279\u6b8a\u7684\u65b9\u6cd5\u8bbe\u7f6e\u8fd9\u4e9b\u4fe1\u606f\uff0c\u90a3\u4e48\u8fd9\u4e9b\u4fe1\u606f\u662f\u4ece\u4f55\u800c\u6765\u5462\uff1f\u4ed4\u7ec6\u9605\u8bfb\u4ee3\u7801\uff0c\u4e0d\u96be\u53d1\u73b0\uff0c\u8fd9\u4e9b\u4fe1\u606f\u5b9e\u9645\u4e0a\u6765\u81ea\u4e8e\u51fd\u6570\u7684\u6587\u6863\u5b57\u7b26\u4e32\uff08
docstring\uff09
\u3002
\u201c\u5c3d\u53ef\u80fd\u5229\u7528\u73b0\u6709\u4fe1\u606f\uff0c\u964d\u4f4e\u5f00\u53d1\u8005\u7684\u5b66\u4e60\u548c\u4f7f\u7528\u6210\u672c\u201d\u662fPyGUIAdapter
\u7684\u91cd\u8981\u8bbe\u8ba1\u601d\u60f3\u3002PyGUIAdapter
\u4f1a\u81ea\u52a8\u4ece\u51fd\u6570\u7684docstring
\u4e2d\u63d0\u53d6\u51fd\u6570\u548c\u53c2\u6570\u7684\u63cf\u8ff0\u4fe1\u606f\uff0c\u5e76\u5c06\u5176\u663e\u793a\u5728\u6b63\u786e\u4f4d\u7f6e\u3002\u5f53\u7136\uff0c\u8fd9\u8981\u6c42\u5f00\u53d1\u8005\u5c3d\u53ef\u80fd\u89c4\u8303\u5730\u7f16\u5199\u51fd\u6570\u7684docstring
\uff0c\u8003\u8651\u5230\u4e0d\u540c\u5f00\u53d1\u8005\u53ef\u80fd\u4e60\u60ef\u4e8e\u4e0d\u540c\u7684docstring
\uff0cPyGUIAdapter
\u5bf9\u591a\u79cd\u5e38\u7528\u7684\u683c\u5f0f\u8fdb\u884c\u4e86\u652f\u6301\uff0c\u5305\u62ec\uff1a
ReST
Google
Numpydoc-style
Epydoc
\u9664\u4e86\u4ece\u51fd\u6570\u7684docstring
\u4e2d\u81ea\u52a8\u63d0\u53d6\u63cf\u8ff0\u4fe1\u606f\uff0cPyGUIAdapter
\u4e5f\u5141\u8bb8\u5f00\u53d1\u8005\u624b\u52a8\u8bbe\u7f6e\u8fd9\u4e9b\u4fe1\u606f\u3002\u8fd9\u5728\u4e00\u4e9b\u573a\u5408\u4e0b\u975e\u5e38\u6709\u7528\u3002\u6bd4\u5982\u63cf\u8ff0\u4fe1\u606f\u592a\u957f\u4e0d\u5b9c\u653e\u5230docstring
\u4e2d\uff0c\u6216\u8005\u9700\u8981\u5bf9\u63cf\u8ff0\u4fe1\u606f\u8fdb\u884c\u56fd\u9645\u5316\u7b49\u60c5\u51b5\u3002\u5173\u4e8e\u5982\u4f55\u624b\u52a8\u751a\u81f3\u63a7\u4ef6\u6216\u51fd\u6570\u7684\u63cf\u8ff0\u4fe1\u606f\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- \u5173\u4e8e\u5982\u4f55\u624b\u52a8\u8bbe\u7f6e\u53c2\u6570\u7684\u63cf\u8ff0\u4fe1\u606f\uff0c\u53c2\u89c1\uff1a\u914d\u7f6e\u63a7\u4ef6\u5c5e\u6027\u3002
- \u5173\u4e8e\u5982\u4f55\u624b\u52a8\u8bbe\u7f6e\u51fd\u6570\u7684\u63cf\u8ff0\u4fe1\u606f\uff08\u8bf4\u660e\u6587\u6863\uff09\uff0c\u53c2\u89c1\uff1a\u6dfb\u52a0\u591a\u4e2a\u51fd\u6570\u3002
"},{"location":"quickstart/#4","title":"4\u3001\u6253\u5370\u6d88\u606f","text":"print()
\u662fPython\u5f00\u53d1\u8005\u975e\u5e38\u719f\u6089\u7684\u4e00\u4e2a\u51fd\u6570\uff0c\u5e38\u88ab\u7528\u4e8e\u5411\u7528\u6237\u5c55\u793a\u7a0b\u5e8f\u8fd0\u884c\u4fe1\u606f\u3002\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u901a\u8fc7print()
\u6253\u5370\u7684\u4fe1\u606f\u4f1a\u88ab\u8f93\u51fa\u5230\u7a0b\u5e8f\u7684\u6807\u51c6\u8f93\u51fa\u4e0a\uff0c\u4e3a\u4e86\u4f7f\u5f00\u53d1\u8005\u80fd\u591f\u5c06\u4fe1\u606f\u6253\u5370\u5230\u7a97\u53e3\u7684\u8f93\u51fa\u6d4f\u89c8\u5668\uff08Output Browser\uff09
\u4e2d\uff0cPyGUIAdapter
\u63d0\u4f9b\u4e86uprint()
\u51fd\u6570\u3002
\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u5bfc\u5165uprint()
\u51fd\u6570\uff1a
from pyguiadapter.adapter.uoutput import uprint\n
\u8be5\u51fd\u6570\u7684\u7528\u6cd5\u540cprint()
\u7c7b\u4f3c\uff0c\u5176\u539f\u578b\u5982\u4e0b\uff1a
uprint()
\u652f\u6301\u8f93\u51fahtml
\u683c\u5f0f\u7684\u5bcc\u6587\u672c\u5185\u5bb9\uff0c\u6bd4\u5982\u56fe\u7247\u3002\u9700\u8981\u6307\u51fa\u7684\u662f\uff0c\u8f93\u51fa\u6d4f\u89c8\u5668
\u5bf9\u4e8ehtml
\u7684\u652f\u6301\u662f\u6709\u9650\u7684\uff0c\u5177\u4f53\u53ef\u4ee5\u53c2\u8003QT\u7684\u5b98\u65b9\u6587\u6863\uff1aSupported HTML Subset
\u9664\u4e86uprint()
\uff0cpyguiadapter.adapter.uoutput
\u4e2d\u8fd8\u5b9e\u73b0\u4e86\u8bb8\u591a\u7528\u4e8e\u8f93\u51fa\u4fe1\u606f\u7684\u51fd\u6570\uff0c\u501f\u52a9\u8fd9\u4e9b\u51fd\u6570\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u8f93\u51fa\u683c\u5f0f\u66f4\u52a0\u4e30\u5bcc\u7684\u5185\u5bb9\uff0c\u53ef\u4ee5\u67e5\u770b\u4ee5\u4e0b\u6587\u6863\u83b7\u53d6\u66f4\u591a\u4fe1\u606f\uff1apyguiadapter.adapter.uoutput
"},{"location":"quickstart/#pyguiadapter.adapter.uoutput.uprint","title":"uprint(*args: Any, sep: str = ' ', end: str = '\\n', html: bool = False, scroll_to_bottom: bool = True) -> None
","text":"\u6253\u5370\u4fe1\u606f\u5230\u8f93\u51fa\u6d4f\u89c8\u5668
Parameters:
Name Type Description Default *args
Any
\u8981\u6253\u5370\u7684\u4fe1\u606f
()
sep
str
\u6bcf\u6761\u4fe1\u606f\u4e4b\u95f4\u7684\u5206\u9694\u5b57\u7b26\u4e32
' '
end
str
\u6dfb\u52a0\u5230\u6700\u540e\u4e00\u6761\u4fe1\u606f\u540e\u9762\u7684\u5b57\u7b26\u4e32
'\\n'
html
bool
\u8981\u6253\u5370\u7684\u4fe1\u606f\u662f\u5426\u4e3ahtml
\u683c\u5f0f
False
scroll_to_bottom
bool
\u6253\u5370\u4fe1\u606f\u540e\u662f\u5426\u5c06\u8f93\u51fa\u6d4f\u89c8\u5668
\u6eda\u52a8\u5230\u6700\u5e95\u90e8
True
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"quickstart/#_5","title":"\uff08\u4e94\uff09\u793a\u4f8b\u8fdb\u9636","text":"PyGUIAdapter
\u7684\u9ad8\u5ea6\u7075\u6d3b\u6027\u4f53\u73b0\u5728\u5141\u8bb8\u5f00\u53d1\u8005\u5bf9\u751f\u6210\u7684\u754c\u9762\u8fdb\u884c\u914d\u7f6e\uff0c\u5f00\u53d1\u8005\u4e0d\u4ec5\u53ef\u4ee5\u914d\u7f6e\u7a97\u53e3\u7684\u5c5e\u6027\u548c\u5916\u89c2\uff0c\u800c\u4e14\u53ef\u4ee5\u5bf9\u51fd\u6570\u6bcf\u4e2a\u53c2\u6570\u5bf9\u5e94\u7684\u63a7\u4ef6\u8fdb\u884c\u7cbe\u7ec6\u5316\u7684\u8c03\u6574\uff0c\u6539\u53d8\u5176\u9ed8\u8ba4\u7684\u884c\u4e3a\u3002
\u4e0b\u9762\uff0c\u5c06\u9010\u6b65\u5b8c\u5584\u4e0a\u8ff0\u793a\u4f8b\u4ee3\u7801\uff0c\u5e76\u5728\u6b64\u8fc7\u7a0b\u4e2d\u6f14\u793a\u914d\u7f6e\u7a97\u53e3\u548c\u63a7\u4ef6\u5c5e\u6027\u7684\u65b9\u6cd5\u3002
"},{"location":"quickstart/#1_2","title":"1\u3001\u914d\u7f6e\u7a97\u53e3\u5c5e\u6027","text":"\u9996\u5148\uff0c\u6211\u4eec\u5c06\u5bf9\u793a\u4f8b\u7a0b\u5e8f\u7684\u7a97\u53e3\u8fdb\u884c\u914d\u7f6e\uff0c\u5305\u62ec\uff1a
- \u8c03\u6574\u7a97\u53e3\u5927\u5c0f
- \u8bbe\u7f6e\u7a97\u53e3\u6807\u9898\u548c\u56fe\u6807
- \u9690\u85cf
\u6587\u6863\u6d4f\u89c8\u5668
- \u6539\u53d8\u51fd\u6570\u8fd4\u56de\u503c\u7684\u6d88\u606f\u683c\u5f0f
- \u5f39\u51fa\u5bf9\u8bdd\u6846\u663e\u793a\u51fd\u6570\u8fd4\u56de\u503c
- ......
\u5bf9\u7a97\u53e3\u5c5e\u6027\u7684\u8c03\u6574\u9700\u8981\u501f\u52a9\u7a97\u53e3\u914d\u7f6e\u7c7b
\u5bf9\u8c61\u3002\u5bf9\u4e8e\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff0c\u5176\u7a97\u53e3\u914d\u7f6e\u7c7b\u4e3aFnExecuteWindowConfig
\uff0c\u8be5\u7c7b\u4e2d\u5b9a\u4e49\u4e86\u51fd\u6570\u6267\u884c\u7a97\u53e3\u7684\u53ef\u914d\u7f6e\u5c5e\u6027\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u5bf9\u7a97\u53e3\u8fdb\u884c\u914d\u7f6e\uff1a
\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a
from typing import Optional\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.exceptions import ParameterError\nfrom pyguiadapter.windows.fnexec import FnExecuteWindowConfig\n\n\ndef equation_solver_2(\n a: float = 1.0, b: float = 0.0, c: float = 0.0\n) -> Optional[tuple]:\n \"\"\"A simple equation solver for equations like:\n\n **ax^2 + bx + c = 0** (a, b, c \u2208 **R** and a \u2260 0)\n\n @param a: a \u2208 R and a \u2260 0\n @param b: b \u2208 R\n @param c: c \u2208 R\n @return:\n \"\"\"\n if a == 0:\n raise ParameterError(parameter_name=\"a\", message=\"a cannot be zero!\")\n uprint(f\"Equation:\")\n uprint(f\" {a}x\u00b2 + {b}x + {c} = 0\")\n delta = b**2 - 4 * a * c\n if delta < 0:\n return None\n x1 = (-b + delta**0.5) / (2 * a)\n if delta == 0:\n return x1, x1\n x2 = (-b - delta**0.5) / (2 * a)\n return x1, x2\n\n\nif __name__ == \"__main__\":\n window_config = FnExecuteWindowConfig(\n title=\"Equation Solver\",\n icon=\"mdi6.function-variant\",\n execute_button_text=\"Solve\",\n size=(350, 550),\n document_dock_visible=False,\n output_dock_initial_size=(None, 100),\n show_function_result=True,\n function_result_message=\"roots: {}\",\n default_parameter_group_name=\"Equation Parameters\",\n )\n\n adapter = GUIAdapter()\n adapter.add(equation_solver_2, window_config=window_config)\n adapter.run()\n
\u6548\u679c\u5982\u4e0b\uff1a
FnExecuteWindowConfig
\u5b9a\u4e49\u4e86\u5927\u91cf\u53ef\u914d\u7f6e\u5c5e\u6027\uff0c\u8fd9\u91cc\u4ec5\u4ec5\u6f14\u793a\u4e86\u5176\u4e2d\u4e00\u5c0f\u90e8\u5206\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\u83b7\u53d6\u5b8c\u6574\u7684\u53ef\u914d\u7f6e\u5c5e\u6027\u5217\u8868\uff1apyguiadapter.windows.fnexec.FnExecuteWindowConfig
"},{"location":"quickstart/#2_1","title":"2\u3001\u914d\u7f6e\u63a7\u4ef6\u5c5e\u6027","text":"\u5728\u76ee\u524d\u7684\u793a\u4f8b\u7a0b\u5e8f\u4e2d\uff0c\u53c2\u6570a
\u3001b
\u3001c
\u7684\u8f93\u5165\u63a7\u4ef6\u53ea\u80fd\u8f93\u5165\u5c0f\u6570\u70b9\u540e2\u4f4d\uff0c\u4e14\u6bcf\u6b21\u8c03\u6574\u7684\u6b65\u8fdb\u503c\u4e3a1\u3002
\u539f\u56e0\u5728\u4e8efloat
\u7c7b\u578b\u5bf9\u5e94\u7684FloatSpinBox
\u63a7\u4ef6\uff0c\u5176step
\uff08\u5355\u6b21\u6b65\u8fdb\u503c\uff09\u5c5e\u6027\u548cdecimals
\uff08\u5c0f\u6570\u70b9\u4f4d\u6570\uff09\u5c5e\u6027\u5206\u522b\u88ab\u914d\u7f6e\u4e3a1.0
\u548c2
\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u4fee\u6539\u63a7\u4ef6\u7684\u9ed8\u8ba4\u5c5e\u6027\u914d\u7f6e\uff0c\u4ee5\u8fbe\u5230\u6539\u53d8\u63a7\u4ef6\u7684\u9ed8\u8ba4\u884c\u4e3a\u7684\u76ee\u7684\u3002
\u73b0\u5728\u6211\u4eec\u5c06\u5bf9\u4e0a\u8ff0\u793a\u4f8b\u505a\u8fdb\u4e00\u6b65\u4fee\u6539\uff0c\u5c06\u53c2\u6570a
\u3001b
\u3001c
\u5bf9\u5e94\u63a7\u4ef6\u7684decimals
\uff08\u5c0f\u6570\u70b9\u4f4d\u6570\uff09\u914d\u7f6e\u4e3a5
\uff0cstep
\uff08\u5355\u6b21\u6b65\u8fdb\u503c\uff09\u914d\u7f6e\u4e3a0.00005
\u3002
"},{"location":"quickstart/#1paramsend","title":"\u65b9\u6cd51\uff1a\u5229\u7528@params...@end
\u914d\u7f6e\u5757","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u51fd\u6570\u7684docstring
\u4e2d\u914d\u7f6e\u53c2\u6570\u7684\u63a7\u4ef6\u3002PyGUIAdapter
\u5c06docstring
\u4e2d\u4f7f\u7528@params
\u548c@end
\u5305\u88f9\u8d77\u6765\u6587\u672c\u5757\u89c6\u4e3a\u63a7\u4ef6\u7684\u914d\u7f6e\u5757\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u8be5\u533a\u57df\u5bf9\u63a7\u4ef6\u7684\u5c5e\u6027\u8fdb\u884c\u914d\u7f6e\u3002\u914d\u7f6e\u5757\u7684\u683c\u5f0f\u4e3aTOML
\u3002\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u683c\u5f0f\u914d\u7f6e\u6307\u5b9a\u63a7\u4ef6\u7684\u6307\u5b9a\u5c5e\u6027\uff1a
[\u53c2\u6570\u540d\u79f0]\n\u5c5e\u6027\u540d\u79f01 = \u5c5e\u6027\u503c1\n\u5c5e\u6027\u540d\u79f02 = \u5c5e\u6027\u503c2\n\u5c5e\u6027\u540d\u79f0N = \u5c5e\u6027\u503cN\n
\u6bd4\u5982\u8981\u914d\u7f6e\u4e0a\u8ff0\u793a\u4f8b\u4e2d\u53c2\u6570a
\u3001b
\u3001c
\u5bf9\u5e94\u63a7\u4ef6\u7684step
\u5c5e\u6027\u548cdecimals
\u5c5e\u6027\uff0c\u53ef\u4ee5\u8fd9\u6837\u505a\uff1a
\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a
from typing import Optional\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.exceptions import ParameterError\nfrom pyguiadapter.windows.fnexec import FnExecuteWindowConfig\n\n\ndef equation_solver_3(\n a: float = 1.0, b: float = 0.0, c: float = 0.0\n) -> Optional[tuple]:\n \"\"\"A simple equation solver for equations like:\n\n **ax^2 + bx + c = 0** (a, b, c \u2208 **R** and a \u2260 0)\n\n @param a: a \u2208 R and a \u2260 0\n @param b: b \u2208 R\n @param c: c \u2208 R\n @return:\n\n @params\n [a]\n decimals = 5\n step = 0.00005\n\n [b]\n decimals = 5\n step = 0.00005\n\n [c]\n decimals = 5\n step = 0.00005\n @end\n\n \"\"\"\n if a == 0:\n raise ParameterError(parameter_name=\"a\", message=\"a cannot be zero!\")\n uprint(f\"Equation:\")\n uprint(f\" {a}x\u00b2 + {b}x + {c} = 0\")\n delta = b**2 - 4 * a * c\n if delta < 0:\n return None\n x1 = (-b + delta**0.5) / (2 * a)\n if delta == 0:\n return x1, x1\n x2 = (-b - delta**0.5) / (2 * a)\n return x1, x2\n\n\nif __name__ == \"__main__\":\n window_config = FnExecuteWindowConfig(\n title=\"Equation Solver\",\n icon=\"mdi6.function-variant\",\n execute_button_text=\"Solve\",\n size=(350, 550),\n document_dock_visible=False,\n output_dock_initial_size=(None, 100),\n show_function_result=True,\n function_result_message=\"roots: {}\",\n default_parameter_group_name=\"Equation Parameters\",\n )\n\n adapter = GUIAdapter()\n adapter.add(equation_solver_3, window_config=window_config)\n adapter.run()\n
"},{"location":"quickstart/#2_2","title":"\u65b9\u6cd52\uff1a\u4f7f\u7528\u914d\u7f6e\u7c7b\u5bf9\u8c61","text":"\u5728@params...@end
\u5757\u4e2d\u914d\u7f6e\u53c2\u6570\u7684\u63a7\u4ef6\uff0c\u4f18\u70b9\u662f\u7b80\u5355\u3001\u5feb\u901f\uff0c\u4f46\u4e5f\u5e76\u975e\u4e07\u80fd\u3002\u4e00\u65b9\u9762\uff0c\u7531\u4e8e\u914d\u7f6e\u5757\u7684\u683c\u5f0f\u4e3aTOML
\uff0c\u5176\u652f\u6301\u7684\u6570\u636e\u7c7b\u578b\u6709\u9650\uff0c\u67d0\u4e9b\u63a7\u4ef6\u7684\u4e00\u4e9b\u5c5e\u6027\u53ef\u80fd\u4f7f\u7528\u4e86\u8d85\u51fa\u5176\u8868\u8fbe\u80fd\u529b\u8303\u56f4\u7684\u6570\u636e\u7c7b\u578b\uff1b\u53e6\u4e00\u65b9\u9762\uff0c\u5982\u679c\u8981\u914d\u7f6e\u7684\u53c2\u6570\u5f88\u591a\uff0c\u6216\u8005\u8981\u8bbe\u7f6e\u7684\u5c5e\u6027\u5f88\u591a\uff0c\u53ef\u80fd\u4f1a\u4f7fdocstring
\u53d8\u5f97\u975e\u5e38\u5197\u957f\u3002\u5728docstring
\u4e2d\u7f16\u5199\u53c2\u6570\u914d\u7f6e\u4ee3\u7801\u4e5f\u5c06\u5931\u53bb\u73b0\u4ee3IDE
\u6216\u8005\u4ee3\u7801\u7f16\u8f91\u6240\u5e26\u6765\u79cd\u79cd\u4fbf\u5229\uff0c\u6bd4\u5982\u4ee3\u7801\u63d0\u793a\u3001\u81ea\u52a8\u5b8c\u6210\u7b49\u3002
\u603b\u4e4b\uff0c\u5728@params...@end
\u4e2d\u914d\u7f6e\u63a7\u4ef6\u53c2\u6570\u662f\u4e00\u79cd\u5f88\u4fbf\u6377\u7684\u624b\u6bb5\uff0c\u4f46\u5b83\u65e0\u6cd5\u89e3\u51b3\u6240\u6709\u7684\u95ee\u9898\uff0c\u56e0\u6b64\uff0cPyGUIAdapter
\u63d0\u4f9b\u4e86\u53e6\u4e00\u79cd\u66f4\u52a0\u901a\u7528\u7684\u914d\u7f6e\u63a7\u4ef6\u5c5e\u6027\u7684\u65b9\u6cd5\uff0c\u90a3\u5c31\u662f\u4f7f\u7528\u63a7\u4ef6\u7684\u914d\u7f6e\u7c7b\u5bf9\u8c61\uff08\u5b9e\u9645\u4e0a\uff0c\u5728@params...@end
\u4e2d\u7f16\u5199\u7684\u914d\u7f6e\uff0c\u6700\u7ec8\u4e5f\u4f1a\u88ab\u8f6c\u6362\u4e3a\u5bf9\u5e94\u7684\u914d\u7f6e\u7c7b\u5bf9\u8c61\uff09\u3002
\u5728PyGUIAdapter
\uff0c\u51fd\u6570\u53c2\u6570\u7684\u63a7\u4ef6\uff0c\u5176\u7c7b\u578b\u4e00\u822c\u7531\u53c2\u6570\u7684\u6570\u636e\u7c7b\u578b\u51b3\u5b9a\uff0c\u800c\u63a7\u4ef6\u7684\u5c5e\u6027\uff0c\u5219\u7531\u5176\u5bf9\u5e94\u7684\u914d\u7f6e\u7c7b\u5b9a\u4e49\u3002\u6bd4\u5982\uff1a
-
int
-> IntSpinBox
-> IntSpinBoxConfig
-
float
-> FloatSpinBox
-> FloatSpinBox
str
-> LineEdit
-> LineEditConfig
- ......
\u786e\u5b9a\u4e86\u53c2\u6570\u5bf9\u5e94\u63a7\u4ef6\u7684\u7c7b\u578b\uff0c\u4fbf\u53ef\u4ee5\u521b\u5efa\u5bf9\u5e94\u914d\u7f6e\u7c7b\u5bf9\u8c61\u6765\u5bf9\u5176\u5c5e\u6027\u8fdb\u884c\u914d\u7f6e\uff0c\u4ee5\u4e0a\u8ff0\u793a\u4f8b\u4ee3\u7801\u4e3a\u4f8b\uff0c\u53ef\u4ee5\u8fd9\u6837\u914d\u7f6e\u5176\u5c5e\u6027\uff1a
\u4f7f\u7528\u914d\u7f6e\u7c7b\u5bf9\u8c61\u65f6\uff0c\u5f00\u53d1\u8005\u5728\u51fd\u6570\u7b7e\u540d\u4e2d\u6307\u5b9a\u7684\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u5c06\u4f1a\u88ab\u8986\u76d6\uff0c\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u7c7b\u5bf9\u8c61\u7684default_value
\u5c5e\u6027\u91cd\u65b0\u6307\u5b9a
\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b
from typing import Optional\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.exceptions import ParameterError\nfrom pyguiadapter.widgets import FloatSpinBoxConfig\nfrom pyguiadapter.windows.fnexec import FnExecuteWindowConfig\n\n\ndef equation_solver_4(\n a: float = 1.0, b: float = 0.0, c: float = 0.0\n) -> Optional[tuple]:\n \"\"\"A simple equation solver for equations like:\n\n **ax^2 + bx + c = 0** (a, b, c \u2208 **R** and a \u2260 0)\n\n @param a: a \u2208 R and a \u2260 0\n @param b: b \u2208 R\n @param c: c \u2208 R\n @return:\n \"\"\"\n if a == 0:\n raise ParameterError(parameter_name=\"a\", message=\"a cannot be zero!\")\n uprint(f\"Equation:\")\n uprint(f\" {a}x\u00b2 + {b}x + {c} = 0\")\n delta = b**2 - 4 * a * c\n if delta < 0:\n return None\n x1 = (-b + delta**0.5) / (2 * a)\n if delta == 0:\n return x1, x1\n x2 = (-b - delta**0.5) / (2 * a)\n return x1, x2\n\n\nif __name__ == \"__main__\":\n window_config = FnExecuteWindowConfig(\n title=\"Equation Solver\",\n icon=\"mdi6.function-variant\",\n execute_button_text=\"Solve\",\n size=(350, 550),\n document_dock_visible=False,\n output_dock_initial_size=(None, 100),\n show_function_result=True,\n function_result_message=\"roots: {}\",\n default_parameter_group_name=\"Equation Parameters\",\n )\n\n adapter = GUIAdapter()\n adapter.add(\n equation_solver_4,\n window_config=window_config,\n widget_configs={\n \"a\": FloatSpinBoxConfig(\n default_value=1.0,\n decimals=5,\n step=0.00005,\n ),\n \"b\": FloatSpinBoxConfig(decimals=5, step=0.00005),\n \"c\": FloatSpinBoxConfig(decimals=5, step=0.00005),\n },\n )\n adapter.run()\n
-
\u4f7f\u7528\u914d\u7f6e\u7c7b\u5bf9\u8c61\u5bf9\u63a7\u4ef6\u8fdb\u884c\u914d\u7f6e\uff0c\u9996\u5148\u9700\u8981\u77e5\u9053\u53c2\u6570\u5bf9\u5e94\u63a7\u4ef6\u7684\u63a7\u4ef6\u914d\u7f6e\u7c7b\u662f\u4ec0\u4e48\uff0c\u4e0b\u9762\u7684\u94fe\u63a5\u5c55\u793a\u4e86\u53c2\u6570\u6570\u636e\u7c7b\u578b
\u3001\u63a7\u4ef6\u7c7b\u578b
\u3001\u63a7\u4ef6\u914d\u7f6e\u5bf9\u8c61\u7c7b\u578b
\u4e09\u8005\u4e4b\u95f4\u7684\u6620\u5c04\u5173\u7cfb\uff0c\u5f00\u53d1\u8005\u82e5\u4e0d\u6e05\u695a\u67d0\u4e2a\u6570\u636e\u7c7b\u578b\u5bf9\u5e94\u7684\u63a7\u4ef6\u7c7b\u578b
\u6216\u63a7\u4ef6\u914d\u7f6e\u5bf9\u8c61\u7c7b\u578b
\uff0c\u53ef\u4ee5\u53c2\u8003\u8be5\u6587\u6863\uff1a\u63a7\u4ef6\u4e0e\u53c2\u6570\u6570\u636e\u7c7b\u578b\u3002
-
\u5f00\u53d1\u8005\u53ef\u4ee5\u9605\u8bfb\u4ee5\u4e0b\u6587\u6863\uff0c\u4ee5\u83b7\u53d6\u5173\u4e8e\u63a7\u4ef6\u5c5e\u6027\u914d\u7f6e\u66f4\u4e3a\u8be6\u7ec6\u7684\u8bf4\u660e\uff1a\u914d\u7f6e\u63a7\u4ef6\u5c5e\u6027\u3002
"},{"location":"quickstart/#3_1","title":"3\u3001\u6dfb\u52a0\u83dc\u5355","text":"\u53ef\u4ee5\u4e3a\u7a97\u53e3\u6dfb\u52a0\u83dc\u5355\u680f\uff0c\u5e76\u5411\u83dc\u5355\u680f\u6dfb\u52a0\u83dc\u5355\u548c\u83dc\u5355\u9879\uff0c\u4e3a\u83dc\u5355\u9879\u8bbe\u7f6e\u4e8b\u4ef6\u56de\u8c03\u3002\u4e0b\u9762\uff0c\u5728\u4e0a\u8ff0\u793a\u4f8b\u4ee3\u7801\u57fa\u7840\u4e0a\uff0c\u6f14\u793a\u5982\u4f55\u6dfb\u52a0\u83dc\u5355\u5e76\u54cd\u5e94\u4e8b\u4ef6\u3002
from typing import Optional\n\nfrom pyguiadapter.action import Action\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.exceptions import ParameterError\nfrom pyguiadapter.menu import Menu\nfrom pyguiadapter.utils import messagebox\nfrom pyguiadapter.widgets import FloatSpinBoxConfig\nfrom pyguiadapter.windows.fnexec import FnExecuteWindowConfig, FnExecuteWindow\n\n\ndef equation_solver_5(\n a: float = 1.0, b: float = 0.0, c: float = 0.0\n) -> Optional[tuple]:\n \"\"\"A simple equation solver for equations like:\n\n **ax^2 + bx + c = 0** (a, b, c \u2208 **R** and a \u2260 0)\n\n @param a: a \u2208 R and a \u2260 0\n @param b: b \u2208 R\n @param c: c \u2208 R\n @return:\n \"\"\"\n if a == 0:\n raise ParameterError(parameter_name=\"a\", message=\"a cannot be zero!\")\n uprint(f\"Equation:\")\n uprint(f\" {a}x\u00b2 + {b}x + {c} = 0\")\n delta = b**2 - 4 * a * c\n if delta < 0:\n return None\n x1 = (-b + delta**0.5) / (2 * a)\n if delta == 0:\n return x1, x1\n x2 = (-b - delta**0.5) / (2 * a)\n return x1, x2\n\n\nif __name__ == \"__main__\":\n window_config = FnExecuteWindowConfig(\n title=\"Equation Solver\",\n icon=\"mdi6.function-variant\",\n execute_button_text=\"Solve\",\n size=(350, 450),\n document_dock_visible=False,\n show_function_result=True,\n function_result_message=\"roots: {}\",\n default_parameter_group_name=\"Equation Parameters\",\n # \u9690\u85cf`OutputDock`\u7a97\u53e3\n output_dock_visible=False,\n # \u56e0\u4e3a\u9690\u85cf\u4e86`OutputDock`\u7a97\u53e3\uff0c\u6240\u4ee5\u65e0\u9700\u5c06\u51fd\u6570\u8c03\u7528\u7ed3\u679c\u53ca\u51fd\u6570\u5f02\u5e38\u4fe1\u606f\u6253\u5370\u5230\u8f93\u51fa\u6d4f\u89c8\u5668\u4e2d\n print_function_error=False,\n print_function_result=False,\n )\n\n def on_action_about(wind: FnExecuteWindow, action: Action):\n messagebox.show_text_file(\n wind,\n text_file=\"./about.html\",\n text_format=\"html\",\n title=\"About\",\n )\n\n action_about = Action(text=\"About\", on_triggered=on_action_about)\n menu_help = Menu(title=\"Help\", actions=[action_about])\n\n adapter = GUIAdapter()\n adapter.add(\n equation_solver_5,\n window_menus=[menu_help],\n window_config=window_config,\n widget_configs={\n \"a\": FloatSpinBoxConfig(\n default_value=1.0,\n decimals=5,\n step=0.00005,\n ),\n \"b\": FloatSpinBoxConfig(decimals=5, step=0.00005),\n \"c\": FloatSpinBoxConfig(decimals=5, step=0.00005),\n },\n )\n adapter.run()\n
\u6548\u679c\u5982\u4e0b\uff1a
\u4ee3\u7801\u8bf4\u660e\uff1a
\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u6dfb\u52a0\u4e86\u4e00\u4e2a\u52a8\u4f5c\uff08Action
\uff09\uff1aaction_about
\uff0c\u5e76\u4e3a\u5176\u6307\u5b9a\u4e86triggered
\u4e8b\u4ef6\u54cd\u5e94\u51fd\u6570\uff1aon_action_about
\uff0c\u8be5\u51fd\u6570\u5c06\u5728\u52a8\u4f5c\u88ab\u89e6\u53d1\u65f6\u8c03\u7528\u3002
\u5728action_about
\u7684\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\uff0c\u6211\u4eec\u8c03\u7528pyguiadapter.utils.messagebox
\u6a21\u5757\u4e2d\u7684show_text_file()
\u51fd\u6570\uff0c\u5f39\u7a97\u5c55\u793a\u5f53\u524d\u76ee\u5f55\u4e0b\u7684about.html
\u6587\u4ef6\uff1a
\u7136\u540e\uff0c\u521b\u5efa\u4e86\u4e00\u4e2aMenu
\u5bf9\u8c61\uff1amenu_help
\uff0c\u5c06\u5176\u6807\u9898\u8bbe\u7f6e\u4e3a\"Help\"\uff0c\u5e76\u5c06action_about
\u6dfb\u52a0\u5230\u5176actions
\u4e2d\uff1a
\u6700\u540e\uff0c\u5c06menu_help
\u5bf9\u8c61\u6dfb\u52a0\u5230window_menus
\u4e2d\uff0c\u8fd9\u6837\u4fbf\u5b8c\u6210\u4e86\u521b\u5efa\u548c\u6dfb\u52a0\u83dc\u5355\u7684\u5168\u8fc7\u7a0b\uff1a
- \u6240\u8c13\u201c\u52a8\u4f5c\u201d\uff08
Action
\uff09\uff0c\u5c31\u662f\u5177\u6709\u6587\u5b57\u3001\u56fe\u6807\u7b49\u4e00\u7cfb\u5217\u5c5e\u6027\uff0c\u53ef\u4ee5\u54cd\u5e94\u7279\u5b9a\u9f20\u6807\u3001\u5feb\u6377\u952e\u4e8b\u4ef6\u7684\u7ec4\u4ef6\u3002\u5b83\u53ef\u4ee5\u88ab\u6dfb\u52a0\u5230\u83dc\u5355\u3001\u5de5\u5177\u680f\u4e2d\uff0c\u5f53\u5176\u88ab\u6dfb\u52a0\u5230\u83dc\u5355\u4e2d\uff0c\u5176\u8868\u73b0\u4e3a\u83dc\u5355\u9879\uff1b\u5f53\u5176\u88ab\u6dfb\u52a0\u5230\u5de5\u5177\u680f\u65f6\uff0c\u5176\u8868\u73b0\u4e3a\u5de5\u5177\u680f\u6309\u94ae\u3002\u6bd4\u5982\u4e0b\u56fe\u4e2d\u7ea2\u8272\u65b9\u6846\u6807\u8bb0\u7684\u662f\u540c\u4e00\u7ec4Action
\u5206\u522b\u5728\u83dc\u5355\u548c\u5de5\u5177\u680f\u4e2d\u7684\u6837\u5b50\u3002
- \u53ef\u4ee5\u901a\u8fc7\u9f20\u6807\u5355\u51fb\u6216\u5feb\u6377\u952e\u6765\u201c\u89e6\u53d1\u201d\u52a8\u4f5c\u3002
\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff0c\u83b7\u53d6\u5173\u4e8e\u7a97\u53e3\u83dc\u5355\u680f\u4e0e\u5de5\u5177\u680f\u7684\u8be6\u7ec6\u8bf4\u660e\uff1a
- \u7a97\u53e3\u5de5\u5177\u680f
- \u7a97\u53e3\u83dc\u5355\u680f
"},{"location":"schema-object/","title":"\u7ed3\u6784\u5316\u5bf9\u8c61\uff08Schema Object\uff09\u53ca\u5176\u7f16\u8f91\u5668","text":""},{"location":"schema-object/#schema-object_1","title":"\u4e00\u3001\u4ec0\u4e48\u662f\u7ed3\u6784\u5316\u5bf9\u8c61\uff08schema object\uff09","text":"\u6211\u4eec\u8fd9\u91cc\u5c06\u7ed3\u6784\u5316\u5bf9\u8c61\u79f0\u4e3a\u201cschema object\u201d\uff0c\u56e0\u4e3a\u5b83\u6307\u7684\u662f\u8fd9\u6837\u4e00\u7c7b\u5bf9\u8c61\uff1a\u672c\u8d28\u4e0a\u5b83\u662f\u4e00\u4e2adict\uff0c\u4f46\u4e0e\u4e00\u822c\u7684dict\u4e0d\u540c\u7684\u662f\uff0c\u5b83\u5177\u6709\u4e00\u7ec4\u56fa\u5b9a\u7684\u201c\u952e\u201d\uff0c\u4e14\u6bcf\u4e2a\u952e\u6240\u5bf9\u5e94\u7684 \u503c\u5177\u6709\u786e\u5b9a\u7684\u7c7b\u578b\uff0c\u7528\u4e8e\u63cf\u8ff0\u4e00\u4e2a\u5bf9\u8c61\u5e94\u5f53\u5177\u6709\u54ea\u4e9b\u952e\u4ee5\u53ca\u8fd9\u4e9b\u952e\u53ef\u4ee5\u88ab\u8d4b\u4e88\u4ec0\u4e48\u7c7b\u578b\u7684\u503c\u7684\u4e1c\u897f\u5c31\u88ab\u79f0\u4e3a\"schema\"\u3002\u7b80\u5355\u6765\u8bf4\uff0c\u6240\u8c13\u7ed3\u6784\u5316\u5bf9\u8c61\uff0c\u5c31\u662f\u4e00\u4e2a\u4f7f\u7528schema \u6765\u9650\u5236\u5176\u952e\u7684\u8303\u56f4\u548c\u503c\u7684\u7c7b\u578b\u7684\u666e\u901adict\u3002
\u4f8b\u5982\uff0c\u4ee5\u4e0b\u5bf9\u8c61\uff1a
{\n \"name\": \"Alice\",\n \"age\": 25,\n \"scores\": 90.5,\n \"grade\": \"A\",\n \"photo\": \"images/alice.jpg\"\n}\n
\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0bschema\u6765\u63cf\u8ff0\uff1a
{\n \"name\": StringValue(),\n \"age\": IntValue(),\n \"password\": StringValue(),\n \"scores\": FloatValue(),\n \"grade\": ChoiceValue(\"A\", [\"A\", \"B\", \"C\", \"D\", \"E\"]),\n \"photo\": FileValue()\n}\n
\u53ef\u4ee5\u770b\u5230\uff0c\u6211\u4eec\u4f7f\u7528StrValue
\u3001IntValue
\u3001FloatValue
\u3001ChoiceValue
\u3001FileValue
\u6765\u63cf\u8ff0\u6bcf\u4e2a\u952e\u6240\u5bf9\u5e94\u503c\u7684\u7c7b\u578b\uff08 \u8fd9\u4e9b\u7c7b\u90fd\u7ee7\u627f\u81eapyguiadapter.itemseditor.schema.ValueType
\u7c7b\uff09\uff0c\u800c\u4e0d\u662f\u4f7f\u7528int
\u3001str
\u3001float
\u7b49\u5185\u7f6e\u7684\u7c7b\u578b\uff0c \u4e3b\u8981\u662f\u662f\u56e0\u4e3aValueType
\u53ef\u4ee5\u63d0\u4f9b\u66f4\u591a\u7684\u4fe1\u606f\u3002
\u6bd4\u5982\uff0c\u5bf9\u4e8eIntValue
\u7c7b\u578b\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u5b83\u7684\u4e0a\u4e0b\u9650\uff1a
{ \n \"age\": IntValue(min_value=0, max_value=20)\n}\n
\u53c8\u6bd4\u5982\uff0c\u53ef\u4ee5\u901a\u8fc7FileValue
\u8bbe\u7f6e\u6587\u4ef6\u540d\u8fc7\u6ee4\u5668\uff1a
{\n \"photo\": FileValue(file_filters=\"JPG Files (*.jpg);;PNG Files (*.png)\")\n}\n
\u540c\u65f6\uff0c\u6709\u4e9bValueType
\u8fd8\u5b9a\u4e49\u4e86\u4e00\u4e9b\u53ef\u4ee5\u5f71\u54cd\u5176\u7f16\u8f91\u63a7\u4ef6\u7684\u5916\u89c2\u548c\u884c\u4e3a\u7684\u5c5e\u6027\uff0c\u6bd4\u5982\uff0c\u53ef\u4ee5\u901a\u8fc7StrValue
\u8bbe\u7f6e\u6587\u672c\u8f93\u5165\u6846\u7684\u5360\u4f4d\u6587\u672c\u3001\u56de\u663e\u6a21\u5f0f\u3001\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae\u7b49\uff1a
{\n \"password\": StringValue(\n default_value=\"123456\",\n display_name=\"Password\",\n placeholder=\"Enter Password\",\n echo_mode=PasswordEchoOnEditMode,\n clear_button=True,\n ),\n}\n
\u5bf9\u4e8e\u5e38\u7528\u7684\u503c\u7c7b\u578b\uff0cpyguiadapter
\u5df2\u7ecf\u5b9e\u73b0\u4e86\u76f8\u5e94\u7684ValueType
\uff0c\u5305\u62ec\uff1a
- IntValue
- FloatValue
- StringValue
- BoolValue
- ChoiceValue
- ColorValue
- DateTimeValue
- DateValue
- DateTimeValue
- TimeValue
- FileValue
- DirectoryValue
- GenericPathValue
- VariantValue
- ListValue
- TupleValue
- DictValue
\u8fd9\u4e9b\u7c7b\u578b\u5747\u5728pyguiadapter.itemseditor.valuetypes
\u5305\u4e2d\u5b9a\u4e49\u548c\u5b9e\u73b0\uff0c\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u65b9\u5f0f\u5bfc\u5165\uff1a
from pyguiadapter.itemseditor.valuetypes import <Value-Type-Name>\n
\u4f8b\u5982\uff1a
from pyguiadapter.itemseditor.valuetypes import (\n StringValue,\n PasswordEchoOnEditMode,\n BoolValue,\n ChoiceValue,\n)\n
\u5982\u679c\u5185\u7f6e\u7684ValueType
\u65e0\u6cd5\u6ee1\u8db3\u9700\u6c42\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u7ee7\u627fValueType
\u7c7b\u6765\u5b9e\u73b0\u81ea\u5b9a\u4e49\u7684\u7c7b\u578b\u3002
\u6240\u6709\u7684ValueType
\u5747\u5177\u6709\u4ee5\u4e0b\u5c5e\u6027\uff1a
default_value
\uff1a\u8be5\u7c7b\u578b\u7684\u9ed8\u8ba4\u503c\u3002 display_name
\uff1a\u7528\u4e8e\u6307\u5b9a\u663e\u793a\u5728\u754c\u9762\u4e0a\u7684\u540d\u79f0\uff0c\u5982\u679c\u4e0d\u6307\u5b9a\uff08None\uff09\uff0c\u5219\u4f7f\u7528\u952e\u540d\u4f5c\u4e3a\u663e\u793a\u540d\u79f0\u3002
\u9664\u4e86\u4ee5\u4e0a\u516c\u5171\u5c5e\u6027\uff0c\u4e0d\u540c\u7c7b\u578b\u7684ValueType
\u8fd8\u5b9a\u4e49\u4e00\u4e9b\u4e13\u5c5e\u7684\u5c5e\u6027\uff0c\u8fd9\u4e9b\u5c5e\u6027\u6216\u8bb8\u7528\u4e8e\u503c\u7684\u6821\u9a8c\uff0c\u6216\u8005\u7528\u4e8e\u914d\u7f6e\u754c\u9762\u7684\u5916\u89c2\u548c\u884c\u4e3a\u3002\u53ef\u4ee5\u53c2\u8003\u76f8\u5e94\u7684ValueType
\u7c7b\u7684 \u6784\u9020\u51fd\u6570\u6765\u4e86\u89e3\u8be5\u7c7b\u578b\u652f\u6301\u7684\u5c5e\u6027\u3002
"},{"location":"schema-object/#_1","title":"\u4e8c\u3001\u7ed3\u6784\u5316\u5bf9\u8c61\u7684\u7f16\u8f91\u5668","text":"\u76ee\u524d\uff0c\u6211\u4eec\u5b9e\u73b0\u4e86\u4e24\u79cd\u53ef\u89c6\u5316\u5de5\u5177\uff0c\u7528\u4e8e\u6d4f\u89c8\u548c\u7f16\u8f91\u7ed3\u6784\u5316\u5bf9\u8c61\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u83dc\u5355\u6216\u8005\u5de5\u5177\u680f\u6309\u94ae\u7684\u56de\u8c03\u51fd\u6570\u4e2d\u8c03\u51fa\u8fd9\u4e9b\u5de5\u5177\u3002
"},{"location":"schema-object/#show_schema_object_editor","title":"\uff08\u4e00\uff09show_schema_object_editor()
","text":"\u51fd\u6570show_schema_object_editor()
\u7528\u4e8e\u8c03\u51fa\u4e00\u4e2aTableView
\u98ce\u683c\u7684\u7ed3\u6784\u5316\u5bf9\u8c61\u7f16\u8f91\u5668:
\u5b83\u7684\u51fd\u6570\u7b7e\u540d\u5982\u4e0b\uff1a
\u4e0b\u9762\u662f\u4e00\u4e2a\u76f8\u5bf9\u5b8c\u6574\u7684\u793a\u4f8b\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u4f7f\u7528show_schema_object_editor()
\u6765\u7f16\u8f91\u4e00\u4e2a\u7ed3\u6784\u5316\u5bf9\u8c61\uff1a
from typing import Any, Dict\n\nfrom qtpy.QtWidgets import QWidget\n\nfrom pyguiadapter.action import Action\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.itemseditor.valuetypes import (\n StringValue,\n IntValue,\n ChoiceValue,\n PasswordEchoOnEditMode,\n FloatValue,\n BoolValue,\n FileValue,\n)\nfrom pyguiadapter.toolbar import ToolBar\nfrom pyguiadapter.utils import (\n messagebox,\n show_schema_object_editor,\n SchemaObjectEditorConfig,\n)\nfrom pyguiadapter.windows.fnexec import FnExecuteWindow\n\nstudent_profile_schema = {\n \"name\": StringValue(default_value=\"Undefined\", display_name=\"Name\"),\n \"age\": IntValue(default_value=16, display_name=\"Age\", min_value=16, max_value=20),\n \"grade\": ChoiceValue(\n default_value=\"A\",\n choices=[\"A\", \"B\", \"C\", \"D\", \"E\"],\n ),\n \"password\": StringValue(\n default_value=\"Admin123\",\n display_name=\"ID Password\",\n echo_mode=PasswordEchoOnEditMode,\n clear_button=True,\n password_symbol=\"*\",\n max_password_symbols=10,\n ),\n \"scores\": FloatValue(\n default_value=0.0,\n display_name=\"Average Scores\",\n min_value=0.0,\n max_value=100.0,\n step=0.5,\n suffix=\" (avg)\",\n display_affix=True,\n ),\n \"is_active\": BoolValue(\n default_value=True, display_name=\"Active\", true_text=\"Yes\", false_text=\"No\"\n ),\n \"photo\": FileValue(\n default_value=\"Not Provided\",\n display_name=\"Photo\",\n title=\"Select a photo\",\n file_filters=\"JPG Files (*.jpg);;PNG Files (*.png);;All Files (*.*)\",\n ),\n}\n\nstudent_profile = {\n \"name\": \"John Doe\",\n \"age\": 18,\n \"grade\": \"B\",\n \"password\": \"MyPassword123\",\n \"scores\": 99.5,\n \"is_active\": True,\n \"photo\": \"/path/to/john_doe.jpg\",\n}\n\n\ndef _accept_hook(editor: QWidget, obj: Dict[str, Any]) -> bool:\n password = obj.get(\"password\")\n if len(password) < 6:\n messagebox.show_warning_message(\n editor,\n message=\"Password should be at least 6 characters long.\",\n title=\"Warning\",\n )\n return False\n return True\n\n\ndef on_action_schema_object_editor(window: FnExecuteWindow, action: Action):\n _ = action # unused\n new_settings, ok = show_schema_object_editor(\n window,\n schema=student_profile_schema,\n obj=student_profile,\n config=SchemaObjectEditorConfig(\n title=\"Student Profile\",\n center_container_title=\"Personal Information\",\n icon=\"ei.adult\",\n # show_horizontal_header=False,\n ),\n accept_hook=_accept_hook,\n )\n if not ok:\n return\n student_profile.update(new_settings)\n\n\naction_profile = Action(\n text=\"Profile\",\n icon=\"ei.adult\",\n on_triggered=on_action_schema_object_editor,\n shortcut=\"Ctrl+O\",\n)\n\ntoolbar = ToolBar(actions=[action_profile], moveable=False, floatable=False)\n\n\ndef foo():\n uprint(\"current profile:\")\n uprint(student_profile)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(foo, window_toolbar=toolbar)\n adapter.run()\n
"},{"location":"schema-object/#pyguiadapter.utils.show_schema_object_editor","title":"show_schema_object_editor(parent: Optional[QWidget], schema: Dict[str, ValueType], obj: Dict[str, Any], config: SchemaObjectEditorConfig = SchemaObjectEditorConfig(), *, copy: bool = True, normalize_object: bool = True, validate: bool = True, accept_hook: Optional[Callable[[ObjectEditor, Dict[str, Any]], bool]] = None, reject_hook: Optional[Callable[[ObjectEditor], bool]] = None) -> Tuple[Dict[str, Any], bool]
","text":"\u5f39\u51fa\u4e00\u4e2a\u7ed3\u6784\u5316\u5bf9\u8c61\u7f16\u8f91\u5668
Parameters:
Name Type Description Default parent
Optional[QWidget]
\u7236\u7a97\u53e3
required schema
Dict[str, ValueType]
\u5bf9\u8c61\u7684Schema
required obj
Dict[str, Any]
\u8981\u7f16\u8f91\u7684\u5bf9\u8c61
required config
SchemaObjectEditorConfig
\u7f16\u8f91\u5668\u914d\u7f6e
SchemaObjectEditorConfig()
copy
bool
\u662f\u5426\u590d\u5236\u5bf9\u8c61
True
normalize_object
bool
\u662f\u5426\u89c4\u8303\u5316\u5bf9\u8c61\uff0c\u89c4\u8303\u5316\u5bf9\u8c61\u662f\u6307\uff1a\u5220\u9664obj\u4e2d\u4e0d\u5728schema\u672a\u5b9a\u4e49\u7684\u952e\uff0c\u5e76\u4e14\u4f7f\u7528\u9ed8\u8ba4\u503c\u586b\u5145\u7f3a\u5931\u7684\u952e
True
validate
bool
\u662f\u5426\u9a8c\u8bc1\u5bf9\u8c61\uff0c\u5373\u68c0\u67e5obj\u662f\u5426\u7b26\u5408schema\u5b9a\u4e49\u7684\u683c\u5f0f\uff0c\u5982\u679c\u4e0d\u7b26\u5408\u5219\u5f15\u53d1\u5f02\u5e38
True
accept_hook
Optional[Callable[[ObjectEditor, Dict[str, Any]], bool]]
\u70b9\u51fb\u7f16\u8f91\u5668Ok
\u6309\u94ae\u540e\u6267\u884c\u7684\u94a9\u5b50\u51fd\u6570\uff0c\u51fd\u6570\u7b7e\u540d\u4e3a(editor: ObjectEditor, obj: Dict[str, Any]) -> bool\uff0c\u8fd4\u56deTrue\u5219\u5173\u95ed\u7f16\u8f91\u5668\uff0c\u8fd4\u56deFalse\u5219\u4e0d\u5173\u95ed\u7f16\u8f91\u5668\u3002
None
reject_hook
Optional[Callable[[ObjectEditor], bool]]
\u70b9\u51fb\u7f16\u8f91\u5668Cancel
\u6309\u94ae\u6216\u5173\u95ed\u7f16\u8f91\u5668\u540e\u6267\u884c\u7684\u94a9\u5b50\u51fd\u6570\uff0c\u51fd\u6570\u7b7e\u540d\u4e3a(editor: ObjectEditor) -> bool\uff0c\u8fd4\u56deTrue\u5219\u5173\u95ed\u7f16\u8f91\u5668\uff0c\u8fd4\u56deFalse\u5219\u4e0d\u5173\u95ed\u7f16\u8f91\u5668\u3002
None
Returns:
Type Description Tuple[Dict[str, Any], bool]
\u8fd4\u56de\u4e00\u4e2a\u5143\u7ec4\uff0c\u8be5\u5143\u7ec4\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u662f\u7f16\u8f91\u540e\u7684\u5bf9\u8c61\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20\u7f16\u8f91\u5668\u662f\u5426accepted\uff08\u4e00\u822c\u662f\u70b9\u51fbOk
\u6309\u94ae\uff09\u3002
"},{"location":"schema-object/#show_schema_object_panel","title":"\uff08\u4e8c\uff09show_schema_object_panel()
","text":"\u51fd\u6570show_schema_object_panel()
\u7528\u4e8e\u8c03\u51fa\u4e00\u4e2aPanel
\u98ce\u683c\u7684\u7ed3\u6784\u5316\u5bf9\u8c61\u7f16\u8f91\u5668:
\u5176\u51fd\u6570\u7b7e\u540d\u5982\u4e0b\uff1a
\u4e0b\u9762\u662f\u4e00\u4e2a\u76f8\u5bf9\u5b8c\u6574\u7684\u793a\u4f8b\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u4f7f\u7528show_schema_object_editor()
\u6765\u7f16\u8f91\u4e00\u4e2a\u7ed3\u6784\u5316\u5bf9\u8c61\uff1a
from typing import Any, Dict\n\nfrom qtpy.QtWidgets import QWidget\n\nfrom pyguiadapter.action import Action\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.itemseditor.valuetypes import (\n StringValue,\n IntValue,\n ChoiceValue,\n PasswordEchoOnEditMode,\n FloatValue,\n BoolValue,\n FileValue,\n)\nfrom pyguiadapter.toolbar import ToolBar\nfrom pyguiadapter.utils import (\n messagebox,\n show_schema_object_panel,\n SchemaObjectPanelConfig,\n)\nfrom pyguiadapter.windows.fnexec import FnExecuteWindow\n\nstudent_profile_schema = {\n \"name\": StringValue(default_value=\"Undefined\", display_name=\"Name\"),\n \"age\": IntValue(default_value=16, display_name=\"Age\", min_value=16, max_value=20),\n \"grade\": ChoiceValue(\n default_value=\"A\",\n choices=[\"A\", \"B\", \"C\", \"D\", \"E\"],\n ),\n \"password\": StringValue(\n default_value=\"Admin123\",\n display_name=\"ID Password\",\n echo_mode=PasswordEchoOnEditMode,\n clear_button=True,\n password_symbol=\"*\",\n max_password_symbols=10,\n ),\n \"scores\": FloatValue(\n default_value=0.0,\n display_name=\"Average Scores\",\n min_value=0.0,\n max_value=100.0,\n step=0.5,\n suffix=\" (avg)\",\n display_affix=True,\n ),\n \"is_active\": BoolValue(\n default_value=True, display_name=\"Active\", true_text=\"Yes\", false_text=\"No\"\n ),\n \"photo\": FileValue(\n default_value=\"Not Provided\",\n display_name=\"Photo\",\n title=\"Select a photo\",\n file_filters=\"JPG Files (*.jpg);;PNG Files (*.png);;All Files (*.*)\",\n ),\n}\n\nstudent_profile = {\n \"name\": \"John Doe\",\n \"age\": 18,\n \"grade\": \"B\",\n \"password\": \"MyPassword123\",\n \"scores\": 99.5,\n \"is_active\": True,\n \"photo\": \"/path/to/john_doe.jpg\",\n}\n\n\ndef _accept_hook(editor: QWidget, obj: Dict[str, Any]) -> bool:\n password = obj.get(\"password\")\n if len(password) < 6:\n messagebox.show_warning_message(\n editor,\n message=\"Password should be at least 6 characters long.\",\n title=\"Warning\",\n )\n return False\n return True\n\n\ndef on_action_schema_object_panel(window: FnExecuteWindow, action: Action):\n _ = action # unused\n new_settings, ok = show_schema_object_panel(\n window,\n schema=student_profile_schema,\n obj=student_profile,\n config=SchemaObjectPanelConfig(\n title=\"Student Profile\",\n center_container_title=\"Personal Information\",\n icon=\"ei.adult\",\n ),\n accept_hook=_accept_hook,\n )\n if not ok:\n return\n student_profile.update(new_settings)\n\n\naction_profile = Action(\n text=\"Profile\",\n icon=\"ei.adult\",\n on_triggered=on_action_schema_object_panel,\n shortcut=\"Ctrl+O\",\n)\n\ntoolbar = ToolBar(actions=[action_profile], moveable=False, floatable=False)\n\n\ndef foo():\n uprint(\"current profile:\")\n uprint(student_profile)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(foo, window_toolbar=toolbar)\n adapter.run()\n
"},{"location":"schema-object/#pyguiadapter.utils.show_schema_object_panel","title":"show_schema_object_panel(parent: Optional[QWidget], schema: Dict[str, ValueType], obj: Dict[str, Any], config: SchemaObjectPanelConfig = SchemaObjectPanelConfig(), *, copy: bool = True, normalize_object: bool = True, validate: bool = True, accept_hook: Optional[Callable[[ObjectEditor, Dict[str, Any]], bool]] = None, reject_hook: Optional[Callable[[ObjectEditor], bool]] = None) -> Tuple[Dict[str, Any], bool]
","text":"\u5f39\u51fa\u4e00\u4e2a\u7ed3\u6784\u5316\u5bf9\u8c61\u7f16\u8f91\u9762\u677f
Parameters:
Name Type Description Default parent
Optional[QWidget]
\u7236\u7a97\u53e3
required schema
Dict[str, ValueType]
\u5bf9\u8c61\u7684Schema
required obj
Dict[str, Any]
\u8981\u7f16\u8f91\u7684\u5bf9\u8c61
required config
SchemaObjectPanelConfig
\u7f16\u8f91\u5668\u914d\u7f6e
SchemaObjectPanelConfig()
copy
bool
\u662f\u5426\u590d\u5236\u5bf9\u8c61
True
normalize_object
bool
\u662f\u5426\u89c4\u8303\u5316\u5bf9\u8c61\uff0c\u89c4\u8303\u5316\u5bf9\u8c61\u662f\u6307\uff1a\u5220\u9664obj\u4e2d\u4e0d\u5728schema\u672a\u5b9a\u4e49\u7684\u952e\uff0c\u5e76\u4e14\u4f7f\u7528\u9ed8\u8ba4\u503c\u586b\u5145\u7f3a\u5931\u7684\u952e
True
validate
bool
\u662f\u5426\u9a8c\u8bc1\u5bf9\u8c61\uff0c\u5373\u68c0\u67e5obj\u662f\u5426\u7b26\u5408schema\u5b9a\u4e49\u7684\u683c\u5f0f\uff0c\u5982\u679c\u4e0d\u7b26\u5408\u5219\u5f15\u53d1\u5f02\u5e38
True
accept_hook
Optional[Callable[[ObjectEditor, Dict[str, Any]], bool]]
\u70b9\u51fb\u7f16\u8f91\u5668Ok
\u6309\u94ae\u540e\u6267\u884c\u7684\u94a9\u5b50\u51fd\u6570\uff0c\u51fd\u6570\u7b7e\u540d\u4e3a(editor: ObjectEditor, obj: Dict[str, Any]) -> bool\uff0c\u8fd4\u56deTrue\u5219\u5173\u95ed\u7f16\u8f91\u5668\uff0c\u8fd4\u56deFalse\u5219\u4e0d\u5173\u95ed\u7f16\u8f91\u5668\u3002
None
reject_hook
Optional[Callable[[ObjectEditor], bool]]
\u70b9\u51fb\u7f16\u8f91\u5668Cancel
\u6309\u94ae\u6216\u5173\u95ed\u7f16\u8f91\u5668\u540e\u6267\u884c\u7684\u94a9\u5b50\u51fd\u6570\uff0c\u51fd\u6570\u7b7e\u540d\u4e3a(editor: ObjectEditor) -> bool\uff0c\u8fd4\u56deTrue\u5219\u5173\u95ed\u7f16\u8f91\u5668\uff0c\u8fd4\u56deFalse\u5219\u4e0d\u5173\u95ed\u7f16\u8f91\u5668\u3002
None
Returns:
Type Description Tuple[Dict[str, Any], bool]
\u8fd4\u56de\u4e00\u4e2a\u5143\u7ec4\uff0c\u8be5\u5143\u7ec4\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u662f\u7f16\u8f91\u540e\u7684\u5bf9\u8c61\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20\u7f16\u8f91\u5668\u662f\u5426accepted\uff08\u4e00\u822c\u662f\u70b9\u51fbOk
\u6309\u94ae\uff09\u3002
"},{"location":"schema-object/#_2","title":"\u4e09\u3001\u793a\u4f8b\uff1a\u4f7f\u7528\u7ed3\u6784\u5316\u5bf9\u8c61\u7f16\u8f91\u5668\u5b9e\u73b0\u914d\u7f6e\u754c\u9762","text":"\u6709\u4e9b\u5f00\u53d1\u8005\u53ef\u80fd\u5df2\u7ecf\u60f3\u5230\uff0c\u4f7f\u7528\u7ed3\u6784\u5316\u5bf9\u8c61\u548c\u7ed3\u6784\u5316\u5bf9\u8c61\u7f16\u8f91\u5668\uff0c\u53ef\u4ee5\u5f88\u5bb9\u6613\u5b9e\u73b0\u4e00\u4e2a\u8bbe\u7f6e\u754c\u9762
\uff0c\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a
from typing import Any, Dict\n\nfrom qtpy.QtWidgets import QWidget\n\nfrom pyguiadapter.action import Action, Separator\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.itemseditor.valuetypes import (\n StringValue,\n PasswordEchoOnEditMode,\n BoolValue,\n ChoiceValue,\n)\nfrom pyguiadapter.menu import Menu\nfrom pyguiadapter.utils import (\n messagebox,\n show_schema_object_editor,\n show_schema_object_panel,\n SchemaObjectEditorConfig,\n SchemaObjectPanelConfig,\n)\nfrom pyguiadapter.windows.fnselect import FnSelectWindow\n\nsetting_schema = {\n \"username\": StringValue(\n default_value=\"admin\", display_name=\"Username\", placeholder=\"Enter Username\"\n ),\n \"password\": StringValue(\n default_value=\"123456\",\n display_name=\"Password\",\n placeholder=\"Enter Password\",\n echo_mode=PasswordEchoOnEditMode,\n clear_button=True,\n ),\n \"remember_me\": BoolValue(\n default_value=True, display_name=\"Remember Me\", true_text=\"Yes\", false_text=\"No\"\n ),\n \"language\": ChoiceValue(\n default_value=0,\n choices=[\"English\", \"Chinese\", \"Japanese\", \"Korean\", \"French\"],\n display_name=\"Language\",\n ),\n \"theme\": ChoiceValue(\n default_value=\"light\",\n choices=[\"light\", \"dark\", \"system\"],\n display_name=\"Theme\",\n ),\n \"port\": StringValue(\n default_value=\"8080\",\n display_name=\"Port\",\n validator=\"^[0-9]+$\",\n max_length=5,\n placeholder=\"Enter Port\",\n ),\n \"host\": StringValue(\n default_value=\"localhost\",\n display_name=\"Host\",\n placeholder=\"Enter Host\",\n max_length=100,\n ),\n}\n\nsettings = {\n \"username\": \"admin\",\n \"password\": \"123456\",\n \"remember_me\": True,\n \"language\": 0,\n \"theme\": \"light\",\n \"port\": \"8080\",\n \"host\": \"localhost\",\n}\n\n\ndef _accept_hook(editor: QWidget, obj: Dict[str, Any]) -> bool:\n password = obj.get(\"password\")\n if len(password) < 6:\n messagebox.show_warning_message(\n editor,\n message=\"Password should be at least 6 characters long.\",\n title=\"Warning\",\n )\n return False\n return True\n\n\ndef on_action_settings(window: FnSelectWindow, action: Action):\n _ = action # unused\n new_settings, ok = show_schema_object_editor(\n window,\n schema=setting_schema,\n obj=settings,\n config=SchemaObjectEditorConfig(\n title=\"Settings\",\n center_container_title=\"configurations\",\n icon=\"ri.settings-5-fill\",\n ),\n accept_hook=_accept_hook,\n )\n if not ok:\n return\n settings.update(new_settings)\n\n\ndef on_action_settings_panel(window: FnSelectWindow, action: Action):\n _ = action # unused\n new_settings, ok = show_schema_object_panel(\n window,\n schema=setting_schema,\n obj=settings,\n config=SchemaObjectPanelConfig(\n title=\"Settings\",\n center_container_title=\"configurations\",\n icon=\"ri.settings-5-fill\",\n ),\n accept_hook=_accept_hook,\n )\n if not ok:\n return\n settings.update(new_settings)\n\n\ndef on_action_close(window: FnSelectWindow, _: Action):\n ret = messagebox.show_question_message(\n window,\n message=\"Are you sure to close the application?\",\n buttons=messagebox.Yes | messagebox.No,\n )\n if ret == messagebox.Yes:\n window.close()\n\n\naction_settings = Action(\n text=\"Settings\",\n icon=\"msc.settings-gear\",\n on_triggered=on_action_settings,\n shortcut=\"Ctrl+O\",\n)\naction_settings_panel = Action(\n text=\"Settings Panel\",\n icon=\"msc.settings-gear\",\n on_triggered=on_action_settings_panel,\n shortcut=\"Ctrl+P\",\n)\naction_close = Action(\n text=\"Close\", icon=\"fa.close\", on_triggered=on_action_close, shortcut=\"Ctrl+Q\"\n)\n\n\nmenu_file = Menu(\n title=\"File\",\n actions=[action_settings, action_settings_panel, Separator(), action_close],\n)\n\n\ndef foo():\n uprint(\"current settings:\")\n uprint(settings)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(foo)\n adapter.run(show_select_window=True, select_window_menus=[menu_file])\n
\u6548\u679c\u5982\u4e0b\uff1a
"},{"location":"style/","title":"\u754c\u9762\u7f8e\u5316","text":""},{"location":"style/#_1","title":"\uff08\u4e00\uff09\u6982\u8ff0","text":"PyGUIAdapter
\u5e95\u5c42\u4f7f\u7528Qt
\u6784\u5efaGUI\uff0c \u6240\u4ee5\u4e00\u4e9b\u9002\u7528\u4e8eQt
\u7684\u754c\u9762\u7f8e\u5316\u65b9\u6cd5\u540c\u6837\u4e5f\u9002\u7528\u4e8ePyGUIAdapter
\uff0c\u6bd4\u5982\u6837\u5f0f\u8868\u4ee5\u53ca\u7b2c\u4e09\u65b9\u7f8e\u5316\u5e93\u3002\u4e0b\u9762\u5c06\u5206\u522b\u4ecb\u7ecd\u8fd9\u4e24\u79cd\u754c\u9762\u7f8e\u5316\u7684\u65b9\u6cd5\u3002
"},{"location":"style/#_2","title":"\uff08\u4e8c\uff09\u4f7f\u7528\u6837\u5f0f\u8868","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528QT\u6837\u5f0f\u8868\uff08QSS
\uff09\u6765\u81ea\u5b9a\u4e49\u754c\u9762\u98ce\u683c\u3002\u6709\u51e0\u79cd\u65b9\u6cd5\u53ef\u4ee5\u8bbe\u7f6e\u6837\u5f0f\u8868\uff1a
"},{"location":"style/#1","title":"1\u3001\u8bbe\u7f6e\u5168\u5c40\u6837\u5f0f\u8868","text":"GUIAdapter
\u7c7b\u7684\u6784\u9020\u51fd\u6570\u4e2d\u6709\u4e00\u4e2aglobal_style
\u53c2\u6570\uff0c\u7528\u4e8e\u8bbe\u7f6e\u5168\u5c40\u6837\u5f0f\u8868\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u628a\u5168\u5c40\u6837\u5f0f\u8868\u7684\u5185\u5bb9\u6216\u8005\u4e00\u4e2a\u4ee5\u5168\u5c40\u6837\u5f0f\u8868\u5185\u5bb9\u4e3a\u8fd4\u56de\u503c\u7684\u51fd\u6570\u4f20\u9012\u7ed9\u8be5\u53c2\u6570\u3002
"},{"location":"style/#1_1","title":"\uff081\uff09\u4f20\u5165\u6837\u5f0f\u8868\u5185\u5bb9","text":"examples/global_style_example.py
import os.path\nfrom datetime import datetime\n\nfrom pyguiadapter import utils\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.extend_types import text_t\n\n\ndef app_style_example(\n arg1: str, arg2: int, arg3: float, arg4: bool, arg5: text_t, arg6: datetime\n):\n \"\"\"\n This example shows how to apply a global stylesheet to the application.\n\n First, read the stylesheet from a qss file. In this example, [Ubuntu.qss](https://github.com/GTRONICK/QSS/blob/master/Ubuntu.qss)\n will be used. This qss file is from GTRONICK's [QSS](https://github.com/GTRONICK/QSS) repo.\n\n Then, pass the qss content to the GUIAdapter constructor's **global_style** argument.\n\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n\n QSS_FILE = os.path.join(os.path.dirname(__file__), \"Ubuntu.qss\")\n global_stylesheet = utils.read_text_file(QSS_FILE)\n\n adapter = GUIAdapter(global_stylesheet=global_stylesheet)\n adapter.add(app_style_example)\n adapter.run()\n
"},{"location":"style/#2","title":"\uff082\uff09\u4f20\u5165\u6837\u5f0f\u8868\u52a0\u8f7d\u51fd\u6570","text":"examples/global_style_example_2.py
import os.path\nfrom datetime import datetime\n\nfrom pyguiadapter import utils\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.extend_types import text_t\n\n\ndef app_style_example(\n arg1: str, arg2: int, arg3: float, arg4: bool, arg5: text_t, arg6: datetime\n):\n \"\"\"\n This example shows how to apply a global stylesheet to the application.\n\n First, read the stylesheet from a qss file. In this example, [Ubuntu.qss](https://github.com/GTRONICK/QSS/blob/master/Ubuntu.qss)\n will be used. This qss file is from GTRONICK's [QSS](https://github.com/GTRONICK/QSS) repo.\n\n Then, pass the qss content to the GUIAdapter constructor's **global_style** argument.\n\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n\n QSS_FILE = os.path.join(os.path.dirname(__file__), \"Ubuntu.qss\")\n\n def load_stylesheet() -> str:\n \"\"\"\n This function will be called after the QApplication instance being created\n \"\"\"\n return utils.read_text_file(QSS_FILE)\n\n adapter = GUIAdapter(global_stylesheet=load_stylesheet)\n adapter.add(app_style_example)\n adapter.run()\n
"},{"location":"style/#2_1","title":"2\u3001\u624b\u52a8\u52a0\u8f7d\u5e76\u8bbe\u7f6e\u6837\u5f0f\u8868","text":"GUIAdapter
\u542f\u52a8\u65f6\u5185\u90e8\u5c06\u521b\u5efaQApplication
\u5b9e\u4f8b\u3002\u5c06\u56de\u8c03on_app_start()
\u65b9\u6cd5\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u8be5\u56de\u8c03\u51fd\u6570\u4e2d\u8bbf\u95ee\u5230\u5f53\u524dQApplication
\u5bf9\u8c61\uff0c\u4e4b\u540e\u4fbf\u53ef\u8c03\u7528\u5176setStyleSheet()
\u65b9\u6cd5\u8bbe\u7f6e\u6837\u5f0f\u8868\u3002
import os.path\nfrom datetime import datetime\n\nfrom qtpy.QtWidgets import QApplication\nfrom pyguiadapter import utils\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.extend_types import text_t\n\n\ndef app_style_example(\n arg1: str, arg2: int, arg3: float, arg4: bool, arg5: text_t, arg6: datetime\n):\n \"\"\"\n This example shows how to apply a global stylesheet to the application.\n\n In this example, [Ubuntu.qss](https://github.com/GTRONICK/QSS/blob/master/Ubuntu.qss)\n will be used. This qss file is from GTRONICK's [QSS](https://github.com/GTRONICK/QSS) repo.\n\n The QSS will be set in **on_app_start()** callback.\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n\n QSS_FILE = os.path.join(os.path.dirname(__file__), \"Ubuntu.qss\")\n\n def on_app_start(app: QApplication):\n assert isinstance(app, QApplication)\n print(\"on_app_start\")\n qss = utils.read_text_file(QSS_FILE)\n app.setStyleSheet(qss)\n print(\"app style applied\")\n\n adapter = GUIAdapter(on_app_start=on_app_start)\n adapter.add(app_style_example)\n adapter.run()\n
"},{"location":"style/#_3","title":"\uff08\u4e09\uff09\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93","text":"PyGUIAdapter
\u5185\u90e8\u4f7f\u7528qtpy
\u521b\u5efa\u7528\u6237\u754c\u9762\uff0c\u56e0\u6b64\u53ef\u4ee5\u65e0\u7f1d\u63a5\u5165\u4e00\u4e9b\u652f\u6301qtpy
\u7684\u7b2c\u4e09\u65b9\u7f8e\u5316\u5e93\u3002\u4e0b\u9762\u662f\u4e00\u4e9b\u521d\u6b65\u6d4b\u8bd5\u53ef\u7528\u7b2c\u4e09\u65b9\u5e93\u3002
"},{"location":"style/#1pyqtdarktheme","title":"1\u3001PyQtDarkTheme
","text":"\u8fd0\u884c\u793a\u4f8b\u4ee3\u7801\uff0c\u9700\u8981\u5148\u5b89\u88c5PyQtDarkTheme
\uff1a
pip install pyqtdarktheme\n
\"\"\"\nThis example requires PyQtDarkTheme. Please install it before you run this example.\n\"\"\"\n\nfrom datetime import datetime\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.extend_types import text_t\n\n\ndef app_style_example(\n arg1: str, arg2: int, arg3: float, arg4: bool, arg5: text_t, arg6: datetime\n):\n \"\"\"\n This example requires [PyQtDarkTheme](https://github.com/5yutan5/PyQtDarkTheme).\n Please install it before you run the example.\n\n <br />\n\n e.g. using `pip`:\n\n > `pip install pyqtdarktheme`\n\n @param arg1: arg1 description\n @param arg2: arg2 description\n @param arg3: arg3 description\n @param arg4: arg4 description\n @param arg5: arg5 description\n @param arg6: arg6 description\n @return:\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n import qdarktheme\n\n def on_app_start(app):\n # this will be called after the instantiation of QApplication.\n print(\"app started\")\n qdarktheme.setup_theme(\"dark\")\n\n adapter = GUIAdapter(on_app_start=on_app_start)\n adapter.add(app_style_example)\n adapter.run()\n
"},{"location":"style/#2qdarkstylesheet","title":"2\u3001QDarkStyleSheet","text":"\u8fd0\u884c\u793a\u4f8b\u4ee3\u7801\uff0c\u9700\u8981\u5148\u5b89\u88c5QDarkStyleSheet
\uff0c\u6bd4\u5982\uff1a
pip install qdarkstyle\n
from datetime import datetime\n\nfrom qtpy.QtWidgets import QApplication\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.extend_types import text_t\n\n\ndef app_style_example(\n arg1: str, arg2: int, arg3: float, arg4: bool, arg5: text_t, arg6: datetime\n):\n \"\"\"\n This example requires [QDarkStyleSheet](https://github.com/ColinDuquesnoy/QDarkStyleSheet).\n Please install it before you run the example.\n\n <br />\n\n e.g. using `pip`:\n\n > `pip install qdarkstyle`\n\n @param arg1: arg1 description\n @param arg2: arg2 description\n @param arg3: arg3 description\n @param arg4: arg4 description\n @param arg5: arg5 description\n @param arg6: arg6 description\n @return:\n\n @params\n [arg6]\n calendar_popup = true\n\n @end\n\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n import qdarkstyle\n\n def on_app_start(app: QApplication):\n # this will be called after the instantiation of QApplication.\n print(\"app started\")\n app.setStyleSheet(qdarkstyle.load_stylesheet())\n\n adapter = GUIAdapter(on_app_start=on_app_start)\n adapter.add(app_style_example)\n adapter.run()\n
"},{"location":"style/#3qtmodern","title":"3\u3001qtmodern","text":"\u8fd0\u884c\u793a\u4f8b\u4ee3\u7801\uff0c\u9700\u8981\u5148\u5b89\u88c5qtmodern
\uff0c\u6bd4\u5982\uff1a
pip install qtmodern\n
from datetime import datetime\n\nfrom qtpy.QtWidgets import QApplication\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.extend_types import text_t\n\n\ndef app_style_example(\n arg1: str, arg2: int, arg3: float, arg4: bool, arg5: text_t, arg6: datetime\n):\n \"\"\"\n This example requires [qtmodern](https://github.com/gmarull/qtmodern).\n Please install it before you run the example.\n\n <br />\n\n e.g. using `pip`:\n\n > `pip install qtmodern`\n\n @param arg1: arg1 description\n @param arg2: arg2 description\n @param arg3: arg3 description\n @param arg4: arg4 description\n @param arg5: arg5 description\n @param arg6: arg6 description\n @return:\n\n @params\n [arg6]\n calendar_popup = true\n\n @end\n\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n import qtmodern.styles\n\n def on_app_start(app: QApplication):\n # this will be called after the instantiation of QApplication.\n print(\"app started\")\n qtmodern.styles.light(app)\n\n adapter = GUIAdapter(on_app_start=on_app_start)\n adapter.add(app_style_example)\n adapter.run()\n
"},{"location":"style/#4qt-material","title":"4\u3001Qt-Material","text":"\u8fd0\u884c\u793a\u4f8b\u4ee3\u7801\uff0c\u9700\u8981\u5148\u5b89\u88c5Qt-Material
\uff0c\u6bd4\u5982\uff1a
pip install qt-material\n
from datetime import datetime\n\nfrom qtpy.QtWidgets import QApplication\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.extend_types import text_t, json_obj_t\n\n\ndef app_style_example(\n arg1: str,\n arg2: int,\n arg3: float,\n arg4: bool,\n arg5: text_t,\n arg6: datetime,\n arg7: json_obj_t,\n):\n \"\"\"\n This example requires [Qt-Material](https://github.com/UN-GCPDS/qt-material).\n Please install it before you run the example.\n\n <br />\n\n e.g. using `pip`:\n\n > `pip install qt-material`\n\n @param arg1: arg1 description\n @param arg2: arg2 description\n @param arg3: arg3 description\n @param arg4: arg4 description\n @param arg5: arg5 description\n @param arg6: arg6 description\n @param arg7: arg7 description\n @return:\n\n @params\n [arg6]\n calendar_popup = true\n\n @end\n\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n import qt_material\n\n def on_app_start(app: QApplication):\n # this will be called after the instantiation of QApplication.\n print(\"app started\")\n qt_material.apply_stylesheet(app, theme=\"light_teal.xml\")\n\n adapter = GUIAdapter(on_app_start=on_app_start)\n adapter.add(app_style_example)\n adapter.run()\n
"},{"location":"toolbar/","title":"\u7a97\u53e3\u5de5\u5177\u680f","text":""},{"location":"toolbar/#_1","title":"\uff08\u4e00\uff09\u6982\u8ff0","text":"BaseWindow
\u7684\u5b50\u7c7b\u7a97\u53e3\u5747\u53ef\u6dfb\u52a0\u5de5\u5177\u680f\uff0c\u5de5\u5177\u680f\u7684\u5178\u578b\u5916\u89c2\u5982\u4e0b\u56fe\u6240\u793a\uff1a
\u4e3a\u51fd\u6570\u9009\u62e9\u7a97\u53e3
\u548c\u51fd\u6570\u6267\u884c\u7a97\u53e3
\u6dfb\u52a0\u5de5\u5177\u680f\u7684\u5177\u4f53\u65b9\u6cd5\uff0c\u5728\u914d\u7f6e\u7a97\u53e3\u5c5e\u6027\u4e00\u7ae0\u5df2\u7ecf\u7ed9\u51fa\uff0c\u8fd9\u91cc\u4e0d\u518d\u8d58\u8ff0\uff0c\u672c\u7ae0\u8282\u4e3b\u8981\u4ecb\u7ecd\u5de5\u5177\u680f\u672c\u8eab\u7684\u5c5e\u6027\u3002
\u5de5\u5177\u680f\uff08ToolBar\uff09\u7684\u5c5e\u6027\u7531ToolBar\u7c7b\u5b9a\u4e49\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u5bfc\u5165\u8be5\u7c7b\uff1a
from pyguiadapter.toolbar import ToolBar\n
\u901a\u8fc7ToolBar
\u5bf9\u8c61\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u6307\u5b9a\u5de5\u5177\u680f\u7684\u521d\u59cb\u4f4d\u7f6e\u3001\u662f\u5426\u53ef\u62d6\u52a8\u3001\u662f\u5426\u53ef\u6f02\u6d6e\u3001\u52a8\u4f5c\u6309\u94ae\u7684\u5927\u5c0f\u548c\u6837\u5f0f\u4ee5\u53ca\u5305\u542b\u90a3\u4e9b\u52a8\u4f5c\u7b49\u3002
\u8981\u67e5\u770bToolBar
\u7c7b\u4e2d\u5b9a\u4e49\u4e86\u54ea\u4e9b\u5c5e\u6027\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.toolbar.ToolBar
"},{"location":"toolbar/#_2","title":"\uff08\u4e8c\uff09\u4e3b\u8981\u5c5e\u6027","text":"\u5de5\u5177\u680f\u4e0a\u7684\u52a8\u4f5c\uff08Action\uff09
\u53ef\u4ee5\u8bbe\u7f6e\u56fe\u6807\uff08icon
\uff09\u3001\u6587\u5b57\uff08text
\uff09\u3001\u5feb\u6377\u952e\uff08shortcut
\uff09\u7b49\u5c5e\u6027\uff0c\u4e5f\u53ef\u4ee5\u8bbe\u7f6eon_triggered
\u3001on_toggled
\u7b49\u4e8b\u4ef6\u76d1\u542c\u5668\u3002\u5173\u4e8eAction
\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.action.Action
\u53ef\u505c\u9760\u533a\u57df\u53ef\u4ee5\u4f7f\u7528\u5355\u4e2aToolBarArea
\u503c\uff0c\u4e5f\u53ef\u4ee5\u662fToolBarArea
\u7684\u7ec4\u5408\uff0c\u4f8b\u5982\uff1aTopToolBarArea | BottomToolBarArea
\u8868\u793a\u5de5\u5177\u680f\u53ef\u4ee5\u505c\u9760\u5728\u7a97\u53e3\u7684\u9876\u90e8\u6216\u5e95\u90e8\u3002
\u505c\u9760\u533a\u57df\u901a\u5e38\u4f7f\u7528\u4ee5\u4e0b\u5e38\u91cf\u6307\u5b9a\uff1a
-
TopToolBarArea
\uff08\u5728\u7a97\u53e3\u9876\u90e8\u653e\u7f6e\u5de5\u5177\u680f\uff09
-
BottomToolBarArea
\uff08\u5728\u7a97\u53e3\u5e95\u90e8\u653e\u7f6e\u5de5\u5177\u680f\uff09
-
LeftToolBarArea
\uff08\u5728\u7a97\u53e3\u5de6\u4fa7\u653e\u7f6e\u5de5\u5177\u680f\uff09
-
RightToolBarArea
\uff08\u5728\u7a97\u53e3\u53f3\u4fa7\u653e\u7f6e\u5de5\u5177\u680f\uff09
\u6309\u94ae\u6837\u5f0f\u4e3b\u8981\u5305\u62ec\u4ee5\u4e0b\u503c\uff1a
ToolButtonIconOnly
\uff08\u53ea\u663e\u793a\u56fe\u6807\uff09 ToolButtonTextBesideIcon
\uff08\u5728\u56fe\u6807\u65c1\u663e\u793a\u6587\u5b57\uff0c\u5373Action
\u5bf9\u8c61\u7684text
\u5c5e\u6027\uff09 ToolButtonTextUnderIcon
\uff08\u5728\u56fe\u6807\u4e0b\u65b9\u663e\u793a\u6587\u5b57\uff0c\u5373Action
\u5bf9\u8c61\u7684text
\u5c5e\u6027\uff09 ToolButtonTextOnly
\uff08\u53ea\u663e\u793a\u6587\u5b57\uff0c\u5373Action
\u5bf9\u8c61\u7684text
\u5c5e\u6027\uff09 ToolButtonFollowStyle
\uff08\u9075\u5faa\u7cfb\u7edf\u8bbe\u7f6e\uff09
"},{"location":"toolbar/#pyguiadapter.toolbar.ToolBar.actions","title":"actions: List[Union[Action, Separator]]
instance-attribute
","text":"\u8981\u6dfb\u52a0\u5230\u5de5\u5177\u680f\u4e2d\u7684\u52a8\u4f5c\uff08Action
\uff09\u6216\u5206\u9694\u7b26\uff08Separator
\uff09\u5217\u8868\u3002\u5728\u5de5\u5177\u680f\u4e2d\uff0c\u52a8\u4f5cAction
\u4ee5\u5de5\u5177\u680f\u6309\u94ae\u7684\u5f62\u5f0f\u51fa\u73b0\u3002
"},{"location":"toolbar/#pyguiadapter.toolbar.ToolBar.moveable","title":"moveable: bool = True
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u662f\u5426\u53ef\u4ee5\u79fb\u52a8\u3002
"},{"location":"toolbar/#pyguiadapter.toolbar.ToolBar.floatable","title":"floatable: bool = True
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u662f\u5426\u53ef\u4ee5\u6f02\u6d6e\u5728\u4e3b\u7a97\u53e3\u4e4b\u5916\u3002
"},{"location":"toolbar/#pyguiadapter.toolbar.ToolBar.allowed_areas","title":"allowed_areas: Optional[ToolBarAreas] = None
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u4e0a\u5141\u8bb8\u5de5\u5177\u680f\u505c\u9760\u7684\u4f4d\u7f6e\u3002
"},{"location":"toolbar/#pyguiadapter.toolbar.ToolBar.initial_area","title":"initial_area: Optional[ToolBarArea] = None
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u5728\u7a97\u53e3\u4e0a\u7684\u521d\u59cb\u4f4d\u7f6e\u3002
"},{"location":"toolbar/#pyguiadapter.toolbar.ToolBar.button_style","title":"button_style: Optional[ToolButtonStyle] = None
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u6309\u7684\u6837\u5f0f\u3002
"},{"location":"toolbar/#pyguiadapter.toolbar.ToolBar.icon_size","title":"icon_size: Union[int, Tuple[int, int], QSize, None] = None
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u6309\u94ae\u7684\u56fe\u6807\u5927\u5c0f\uff0c
"},{"location":"toolbar/#_3","title":"\uff08\u4e09\uff09\u793a\u4f8b","text":"import json\n\nfrom pyguiadapter.action import Action, Separator\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.toolbar import (\n ToolBar,\n RightToolBarArea,\n LeftToolBarArea,\n ToolButtonTextUnderIcon,\n TopToolBarArea,\n)\nfrom pyguiadapter.utils import filedialog, inputdialog, messagebox\nfrom pyguiadapter.window import SimpleWindowEventListener\nfrom pyguiadapter.windows.fnexec import FnExecuteWindow\n\n\ndef toolbar_example():\n pass\n\n\n###################Action Callbacks#########################\ndef on_action_open(window: FnExecuteWindow, _: Action):\n print(\"on_action_open()\")\n ret = filedialog.get_open_file(\n parent=window,\n title=\"Open File\",\n start_dir=\"./\",\n filters=\"JSON files(*.json);;All files(*.*)\",\n )\n if ret:\n messagebox.show_info_message(window, f\"File will be opened: {ret}\")\n\n\ndef on_action_save(window: FnExecuteWindow, _: Action):\n print(\"on_action_save()\")\n ret = filedialog.get_save_file(\n parent=window,\n title=\"Save File\",\n start_dir=\"./\",\n filters=\"JSON files(*.json);;All files(*.*)\",\n )\n if ret:\n messagebox.show_info_message(window, f\"File will be saved to: {ret}\")\n\n\ndef on_action_settings(window: FnExecuteWindow, _: Action):\n default_settings = {\n \"opt1\": 1,\n \"opt2\": \"2\",\n \"opt3\": True,\n }\n new_settings = inputdialog.input_json_object(\n parent=window,\n title=\"Settings\",\n icon=\"fa.cog\",\n size=(600, 400),\n ok_button_text=\"Save\",\n cancel_button_text=\"Cancel\",\n initial_text=json.dumps(default_settings, indent=4, ensure_ascii=False),\n auto_indent=True,\n indent_size=4,\n auto_parentheses=True,\n line_wrap_mode=inputdialog.LineWrapMode.WidgetWidth,\n line_wrap_width=88,\n )\n if isinstance(new_settings, dict):\n messagebox.show_info_message(window, f\"new settings: {new_settings}\")\n\n\ndef on_action_confirm_quit(window: FnExecuteWindow, _: Action, checked: bool):\n print(\"on_action_confirm_close(): \", checked)\n\n\ndef on_action_close(window: FnExecuteWindow, _: Action):\n print(\"on_action_close()\")\n window.close()\n\n\n###################~Action Callbacks#########################\n\n\nif __name__ == \"__main__\":\n ###################Actions#############################\n action_open = Action(\n text=\"Open\",\n icon=\"fa.folder-open\",\n on_triggered=on_action_open,\n shortcut=\"Ctrl+O\",\n )\n action_save = Action(\n text=\"Save\",\n icon=\"fa.save\",\n on_triggered=on_action_save,\n shortcut=\"Ctrl+S\",\n )\n\n action_settings = Action(\n text=\"Settings\",\n icon=\"fa.cog\",\n on_triggered=on_action_settings,\n shortcut=\"Ctrl+,\",\n )\n\n action_quit = Action(\n text=\"Quit\",\n icon=\"fa.power-off\",\n on_triggered=on_action_close,\n shortcut=\"Ctrl+Q\",\n )\n action_confirm_quit = Action(\n text=\"Confirm Quit\",\n icon=\"fa.question-circle\",\n checkable=True,\n checked=False,\n on_toggled=on_action_confirm_quit,\n )\n ###################~Actions#############################\n\n ####################ToolBar#############################\n toolbar = ToolBar(\n actions=[\n action_open,\n action_save,\n action_settings,\n Separator(),\n action_confirm_quit,\n action_quit,\n ],\n moveable=True,\n floatable=True,\n initial_area=RightToolBarArea,\n allowed_areas=RightToolBarArea | LeftToolBarArea | TopToolBarArea,\n button_style=ToolButtonTextUnderIcon,\n )\n ###################~ToolBar#############################\n\n ################Window Event Listener###################\n def on_window_create(window: FnExecuteWindow):\n print(\"on_window_create()\")\n # make action_confirm_quit checked after the select window is created\n window.set_action_state(action_confirm_quit, True)\n\n def on_window_close(window: FnExecuteWindow) -> bool:\n # get the state of action_confirm_quit\n # if it is checked, show a question message box to ask if the user really wants to close the window\n # if it is not checked, return True to close the window directly.\n state = window.get_action_state(action_confirm_quit)\n if state:\n # access the\n ret = messagebox.show_question_message(\n window,\n message=\"Do you really want to close the window?\",\n title=\"Quit\",\n buttons=messagebox.Yes | messagebox.No,\n )\n return ret == messagebox.Yes\n return True\n\n window_listener = SimpleWindowEventListener(\n on_create=on_window_create, on_close=on_window_close\n )\n #################Window Event Listener##################\n\n adapter = GUIAdapter()\n adapter.add(\n toolbar_example, window_toolbar=toolbar, window_listener=window_listener\n )\n adapter.run()\n
"},{"location":"user-interaction/","title":"\u4e0e\u7528\u6237\u4ea4\u4e92","text":""},{"location":"user-interaction/#_1","title":"\uff08\u4e00\uff09\u6982\u8ff0","text":"\u5f00\u53d1\u8005\u6709\u65f6\u9700\u8981\u5728\u51fd\u6570\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u4e0e\u7528\u6237\u8fdb\u884c\u4ea4\u4e92\uff0c\u6bd4\u5982\u5f39\u51fa\u6d88\u606f\u5bf9\u8bdd\u6846\uff0c\u5411\u7528\u6237\u5c55\u793a\u4e00\u4e9b\u4fe1\u606f\uff1b\u8bf7\u6c42\u7528\u6237\u5bf9\u67d0\u4e9b\u64cd\u4f5c\u8fdb\u884c\u786e\u8ba4\uff1b\u6216\u8005\u662f\u8981\u6c42\u7528\u6237\u8f93\u5165\u67d0\u4e9b\u6570\u636e\u3002\u5bf9\u6b64\uff0cPyGUIAdapter
\u63d0\u4f9b\u4e86\u652f\u6301\u3002
\u8fd0\u884c\u4e2d\u7684\u4ea4\u4e92\uff0c\u603b\u7684\u6765\u8bf4\uff0c\u53ef\u4ee5\u5206\u4e3a\u4e24\u7c7b\uff1a\u4e00\u662f\u5c55\u793a\u4fe1\u606f\uff0c\u4e8c\u662f\u8bf7\u6c42\u8f93\u5165\u6570\u636e\u3002\u4e0b\u9762\u5c06\u5206\u522b\u5bf9\u8fd9\u4e24\u65b9\u9762\u8fdb\u884c\u9610\u8ff0\u3002
"},{"location":"user-interaction/#_2","title":"\uff08\u4e8c\uff09\u6d88\u606f\u5bf9\u8bdd\u6846","text":"\u6d88\u606f\u5bf9\u8bdd\u6846\u76f8\u5173\u7684API\u5b9a\u4e49\u5728pyguiadapter.adapter.udialog
\u6a21\u5757\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u65b9\u5f0f\u5bfc\u5165\u8be5\u6a21\u5757
from pyguiadapter.adapter import udialog\n
\u6d88\u606f\u5bf9\u8bdd\u6846\u76f8\u5173\u7684API\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.adapter.udialog
"},{"location":"user-interaction/#1","title":"1\u3001\u6807\u51c6\u6d88\u606f\u5bf9\u8bdd\u6846","text":"PyGUIAdapter
\u63d0\u4f9b\u4e86\u56db\u79cd\u6807\u51c6\u7684\u6d88\u606f\u5bf9\u8bdd\u6846\uff0c\u53ef\u4ee5\u7528\u4e8e\u5c55\u793a\u4e0d\u540c\u7ea7\u522b\u7684\u6d88\u606f\u3002
- Information\u6d88\u606f\u5bf9\u8bdd\u6846\uff1a\u7528\u4e8e\u5c55\u793a\u4e00\u822c\u6027\u4fe1\u606f\u3002
show_info_messagebox()\n
- Warning\u6d88\u606f\u5bf9\u8bdd\u6846\uff1a\u7528\u4e8e\u5c55\u793a\u8b66\u544a\u4fe1\u606f\u3002
show_warning_messagebox()\n
- Critical\u6d88\u606f\u5bf9\u8bdd\u6846\uff1a\u7528\u4e8e\u5c55\u793a\u4e25\u91cd\u9519\u8bef\u4fe1\u606f\u3002
show_critical_messagebox()\n
- Question\u5bf9\u8bdd\u6846\uff1a\u7528\u4e8e\u5c55\u793a\u95ee\u8be2\u4fe1\u606f\uff0c\u5e76\u4e14\u53ef\u4ee5\u83b7\u5f97\u95ee\u8be2\u7ed3\u679c\u3002
show_question_messagebox()\n
\u4e0b\u9762\u662f\u4e00\u4e2a\u7efc\u5408\u7684\u793a\u4f8b\uff1a
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter import udialog\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import text_t\nfrom pyguiadapter.utils import messagebox\n\n\ndef dialog_example(\n info_message: text_t,\n warning_message: text_t,\n error_message: text_t,\n question_message: text_t,\n):\n if info_message:\n udialog.show_info_messagebox(\n text=info_message,\n title=\"Information\",\n buttons=messagebox.Ok | messagebox.No,\n default_button=messagebox.Ok,\n )\n\n if warning_message:\n udialog.show_warning_messagebox(\n text=warning_message,\n title=\"Warning\",\n buttons=messagebox.Ok | messagebox.No,\n default_button=messagebox.Ok,\n )\n\n if error_message:\n udialog.show_critical_messagebox(\n text=error_message,\n title=\"Error\",\n buttons=messagebox.Ok | messagebox.No,\n default_button=messagebox.Ok,\n )\n\n if question_message:\n answer = udialog.show_question_messagebox(\n text=question_message,\n title=\"Question\",\n buttons=messagebox.Yes | messagebox.No,\n default_button=messagebox.No,\n )\n if answer == messagebox.Yes:\n uprint(\"Your Choice: Yes\")\n udialog.show_info_messagebox(\"You Choose Yes!\", title=\"Answer\")\n else:\n uprint(\"Your Choice: No\")\n udialog.show_info_messagebox(\"You Choose No!\", title=\"Answer\")\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(dialog_example)\n adapter.run()\n
"},{"location":"user-interaction/#2","title":"2\u3001\u957f\u6587\u672c\u6d88\u606f\u5bf9\u8bdd\u6846","text":"PyGUIAdapter
\u8fd8\u63d0\u4f9b\u4e86\u4e24\u79cd\u7528\u4e8e\u5c55\u793a\u957f\u6587\u672c\u5185\u5bb9\u7684\u6d88\u606f\u5bf9\u8bdd\u6846\uff1a
- \u76f4\u63a5\u5c55\u793a\u957f\u6587\u672c\u5b57\u7b26\u4e32
show_text_content()\n
- \u5c55\u793a\u6587\u672c\u6587\u4ef6\u5185\u5bb9
show_text_file()\n
\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a
import os.path\nfrom typing import Literal\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter import udialog\nfrom pyguiadapter.exceptions import ParameterError\nfrom pyguiadapter.extend_types import text_t, file_t\nfrom pyguiadapter.utils import messagebox\n\n\ndef show_text_context_example(\n content: text_t, text_format: Literal[\"markdown\", \"plaintext\", \"html\"] = \"markdown\"\n):\n if content:\n udialog.show_text_content(\n title=\"Hello\",\n text_content=content,\n text_format=text_format,\n buttons=messagebox.DialogButtonYes | messagebox.DialogButtonNo,\n size=(600, 400),\n )\n\n\ndef show_text_file_example(\n text_file: file_t,\n text_format: Literal[\"markdown\", \"plaintext\", \"html\"] = \"markdown\",\n):\n \"\"\"\n Show text content of the file\n\n @param text_file: the path of the text file\n @param text_format: the format of the text file\n @return:\n\n @params\n [text_file]\n filters = \"Text files(*.txt);;Markdown files(*.md);;HTML files(*.html);;All files(*.*)\"\n @end\n \"\"\"\n text_file = text_file.strip()\n if not text_file:\n raise ParameterError(\"text_file\", \"text_file is empty!\")\n\n if not os.path.isfile(text_file):\n udialog.show_critical_messagebox(text=\"File not found\", title=\"Error\")\n return\n filename = os.path.basename(text_file)\n if text_file:\n udialog.show_text_file(\n text_file=text_file,\n text_format=text_format,\n title=f\"View - {filename}\",\n size=(600, 400),\n )\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(show_text_context_example)\n adapter.add(show_text_file_example)\n adapter.run()\n
"},{"location":"user-interaction/#3","title":"3\u3001\u81ea\u5b9a\u4e49\u6d88\u606f\u5bf9\u8bdd\u6846","text":"\u4e3a\u4e86\u5b9e\u73b0\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846\uff0c\u5f00\u53d1\u8005\u9700\u8981\u638c\u63e1\u4e00\u5b9apyqt
\u6216pyside
\u5f00\u53d1\u77e5\u8bc6
\u5982\u679cPyGUIAdapter
\u5185\u7f6e\u7684\u6d88\u606f\u5bf9\u8bdd\u6846\u4e0d\u80fd\u6ee1\u8db3\u9700\u8981\uff0c\u5f00\u53d1\u8005\u4e5f\u53ef\u4ee5\u81ea\u5b9a\u4e49\u6d88\u606f\u5bf9\u8bdd\u6846\u3002\u4e00\u822c\u6d41\u7a0b\u5982\u4e0b\uff1a
1\u3001\u5b50\u7c7b\u5316pyguiadater.adapter.BaseCustomDialog
\u7c7b\uff0c\u521b\u5efa\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846\u7c7b
\u5728\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846\u7c7b\u4e2d\uff0c\u5f00\u53d1\u8005\u9700\u5b9e\u73b0get_result()
\u62bd\u8c61\u65b9\u6cd5\uff0c\u540e\u7eed\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u8c03\u7528\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846\u540e\u83b7\u53d6\u8be5\u65b9\u6cd5\u7684\u8fd4\u56de\u503c\u3002
2\u3001\u8c03\u7528udialog.show_custom_dialog()
\u5f39\u51fa\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846
def show_custom_dialog(\n dialog_class: Type[BaseCustomDialog], **kwargs\n) -> Any:\n ...\n
udialog.show_custom_dialog()
\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846\u7c7b\uff0c\u7b2c\u4e00\u4e2a\u53c2\u6570\u4e4b\u540e\u7684\u5173\u952e\u5b57\u53c2\u6570\u5c06\u4f5c\u4e3a\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846__init__()
\u51fd\u6570\u7684\u53c2\u6570\u3002udialog.show_custom_dialog()
\u51fd\u6570\u5c06\u8fd4\u56deget_result()
\u65b9\u6cd5\u7684\u8fd4\u56de\u503c\u3002
\u4e0b\u9762\u7ed9\u51fa\u4e00\u4e2a\u81ea\u5b9a\u4e49\u6d88\u606f\u5bf9\u8bdd\u6846\u7684\u793a\u4f8b\uff1a
from datetime import date, datetime\nfrom typing import Any\nfrom uuid import uuid1\n\nfrom qtpy.QtWidgets import QWidget, QVBoxLayout, QLabel, QDialogButtonBox\n\nfrom pyguiadapter.adapter import GUIAdapter, BaseCustomDialog\nfrom pyguiadapter.adapter import udialog\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.exceptions import ParameterError\n\n\nclass UserInfoDialog(BaseCustomDialog):\n def __init__(\n self,\n parent: QWidget,\n username: str,\n nickname: str,\n user_id: str,\n birthdate: date,\n join_time: datetime,\n **kwargs,\n ):\n super().__init__(parent, **kwargs)\n\n self.setWindowTitle(\"Confirm\")\n\n self._confirmed = False\n self._user_info = {\n \"username\": username,\n \"nickname\": nickname,\n \"user_id\": user_id,\n \"birthdate\": birthdate,\n \"join_time\": join_time,\n }\n\n self._button_box = QDialogButtonBox(self)\n self._button_box.setStandardButtons(\n QDialogButtonBox.Ok | QDialogButtonBox.Cancel\n )\n self._button_box.accepted.connect(self._on_accepted)\n self._button_box.rejected.connect(self._on_rejected)\n\n layout = QVBoxLayout()\n username_label = QLabel(self)\n username_label.setText(f\"username: {username}\")\n layout.addWidget(username_label)\n nickname_label = QLabel(self)\n nickname_label.setText(f\"nickname: {nickname}\")\n layout.addWidget(nickname_label)\n user_id_label = QLabel(self)\n user_id_label.setText(f\"user_id: {user_id}\")\n layout.addWidget(user_id_label)\n birthdate_label = QLabel(self)\n birthdate_label.setText(f\"birthdate: {birthdate}\")\n layout.addWidget(birthdate_label)\n join_time_label = QLabel(self)\n join_time_label.setText(f\"join_time: {join_time}\")\n layout.addWidget(join_time_label)\n layout.addWidget(self._button_box)\n self.setLayout(layout)\n\n def get_result(self) -> Any:\n if self._confirmed:\n return self._user_info\n return None\n\n def _on_accepted(self) -> None:\n self._confirmed = True\n self.accept()\n\n def _on_rejected(self) -> None:\n self._confirmed = False\n self.reject()\n\n\ndef add_user_example(\n username: str,\n nickname: str,\n user_id: str,\n birth_date: date,\n join_time: datetime,\n):\n if not username:\n raise ParameterError(\"username\", \"username is empty\")\n\n if not user_id:\n udialog.show_warning_messagebox(\n \"user_id is empty, a random one will be generated!\"\n )\n user_id = uuid1().hex\n\n result = udialog.show_custom_dialog(\n UserInfoDialog,\n username=username,\n nickname=nickname,\n user_id=user_id,\n birthdate=birth_date,\n join_time=join_time,\n )\n if result is not None:\n udialog.show_info_messagebox(f\"user added!\")\n uprint(result)\n return\n udialog.show_info_messagebox(f\"user not added!\")\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(add_user_example)\n adapter.run()\n
"},{"location":"user-interaction/#_3","title":"\uff08\u4e09\uff09\u8f93\u5165\u5bf9\u8bdd\u6846","text":"\u8f93\u5165\u5bf9\u8bdd\u6846\u76f8\u5173API\u5728pyguiadapter.adapter.uinput
\u6a21\u5757\u4e2d\u5b9a\u4e49\u3002
\u8f93\u5165\u5bf9\u8bdd\u6846\u76f8\u5173\u7684API\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.adapter.uinput
"},{"location":"user-interaction/#1_1","title":"1\u3001\u5185\u7f6e\u8f93\u5165\u5bf9\u8bdd\u6846\u7c7b\u578b","text":"PyGUIAdapter
\u5185\u7f6e\u4e86\u591a\u79cd\u7c7b\u578b\u7684\u8f93\u5165\u5bf9\u8bdd\u6846\uff0c\u7528\u4ee5\u8f93\u5165\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u636e\uff0c\u5305\u62ec\uff1a
get_string()
get_text()
get_int()
get_float()
get_selected_item()
get_color()
get_json_object()
get_py_literal()
get_existing_directory()
get_open_file()
get_open_files()
get_save_file()
\u4e0b\u9762\u662f\u4e00\u4e2a\u7efc\u5408\u7684\u793a\u4f8b\uff1a
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter import uinput\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import choices_t\n\n\n# noinspection SpellCheckingInspection\ndef uinput_example(inputs: choices_t):\n \"\"\"\n Example of getting user inputs inside the function\n @param inputs: choose what you want to get from user\n @return:\n\n @params\n [inputs]\n choices = [\"int\", \"str\", \"text\", \"float\", \"item\", \"color\", \"dir\", \"file\", \"save_file\", \"files\", \"json object\", \"python literal\"]\n columns = 2\n @end\n \"\"\"\n if \"int\" in inputs:\n value = uinput.get_int(title=\"Input Integer\", label=\"Enter an integer:\")\n uprint(\"User inputs: \", value)\n if \"str\" in inputs:\n value = uinput.get_string(title=\"Input Text\", label=\"Enter a string:\")\n uprint(\"User inputs: \", value)\n if \"text\" in inputs:\n value = uinput.get_text(title=\"Input Text\", label=\"Enter a string:\")\n uprint(\"User inputs: \", value)\n if \"float\" in inputs:\n value = uinput.get_float(title=\"Input Float\", label=\"Enter a float:\")\n uprint(\"User inputs: \", value)\n\n if \"item\" in inputs:\n value = uinput.get_selected_item(\n items=[\"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\"],\n title=\"Select Item\",\n label=\"Select an item:\",\n )\n uprint(\"User inputs: \", value)\n if \"color\" in inputs:\n value = uinput.get_color(title=\"Select Color\", alpha_channel=True)\n uprint(\"User inputs: \", value)\n if \"dir\" in inputs:\n value = uinput.get_existing_directory(title=\"Select Directory\")\n uprint(\"User inputs: \", value)\n if \"file\" in inputs:\n value = uinput.get_open_file(title=\"Select File\")\n uprint(\"User inputs: \", value)\n if \"save_file\" in inputs:\n value = uinput.get_save_file(title=\"Select File\")\n uprint(\"User inputs: \", value)\n if \"files\" in inputs:\n value = uinput.get_open_files(title=\"Select Files\")\n uprint(\"User inputs: \", value)\n if \"json object\" in inputs:\n value = uinput.get_json_object(title=\"Input Json Object\")\n uprint(\"User inputs: \", value, f\" {type(value)}\")\n if \"python literal\" in inputs:\n value = uinput.get_py_literal(title=\"Input Python Literal\")\n uprint(\"User inputs: \", value, f\" {type(value)}\")\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(uinput_example)\n adapter.run()\n
"},{"location":"user-interaction/#2_1","title":"2\u3001\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846","text":"\u82e5\u5185\u7f6e\u7684\u8f93\u5165\u5bf9\u8bdd\u6846\u65e0\u6cd5\u6ee1\u8db3\u5f00\u53d1\u8005\u9700\u6c42\uff0c\u5f00\u53d1\u8005\u4e5f\u53ef\u4ee5\u521b\u5efa\u5e76\u4f7f\u7528\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u3002
"},{"location":"user-interaction/#1_2","title":"\uff081\uff09\u5927\u81f4\u6b65\u9aa4","text":"\u7b2c\u4e00\u6b65\uff1a\u5b9e\u73b0\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846
\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u7c7b\u9700\u7ee7\u627f\u81eapyguiadapter.utils.inputdialog.UniversalInputDialog
\u7c7b\u3002\u5f00\u53d1\u8005\u5fc5\u987b\u5b9e\u73b0\u4ee5\u4e0b\u4e24\u4e2a\u62bd\u8c61\u65b9\u6cd5\u3002
create_main_widget()
\u65b9\u6cd5
@abstractmethod\ndef create_main_widget(self) -> QWidget:\n pass\n
\u5f00\u53d1\u8005\u9700\u5728\u8be5\u65b9\u6cd5\u4e2d\u521b\u5efa\u8f93\u5165\u5bf9\u8bdd\u6846\u7684\u4e3b\u63a7\u4ef6\u5e76\u5c06\u5176\u8fd4\u56de\u3002\u6240\u8c13\u4e3b\u63a7\u4ef6\uff08main widget\uff09
\u662f\u6307\u4e0b\u56fe\u4e2d\u4f7f\u7528\u7ea2\u6846\u6807\u6ce8\u7684\u4f4d\u7f6e\uff1a
get_result()
\u65b9\u6cd5
\u8be5\u65b9\u6cd5\u7528\u4e8e\u8fd4\u56de\u7528\u6237\u5728\u5bf9\u8bdd\u6846\u4e2d\u8f93\u5165\u7684\u503c\u3002
@abstractmethod\n def get_result(self) -> Any:\n pass\n
\u7b2c\u4e8c\u6b65\uff1a\u5f39\u51fa\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846
\u5b9e\u73b0\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u540e\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u8c03\u7528uinput.get_custom_input()
\u51fd\u6570\u5f39\u51fa\u5bf9\u8bdd\u6846\u5e76\u83b7\u53d6\u7528\u6237\u8f93\u5165\u503c\u3002
def get_custom_input(\n input_dialog_class: Type[UniversalInputDialog],\n **input_dialog_args,\n) -> Any:\n ...\n
get_custom_input()
\u51fd\u6570\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570input_dialog_class
\u662f\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u7c7b\uff0c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u5219\u662f\u8981\u4f20\u9012\u7ed9\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u7c7b\u6784\u9020\u51fd\u6570\u7684\u53c2\u6570\u3002
\u5173\u4e8eget_custom_input()
\u51fd\u6570\u7684\u8fd4\u56de\u503c\uff0c\u5b58\u5728\u4ee5\u4e0b\u4e24\u79cd\u60c5\u51b5\uff1a
\uff081\uff09\u82e5\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u88abreject
\uff0c\u5219get_custom_input()
\u51fd\u6570\u8fd4\u56deNone
\uff082\uff09\u82e5\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u88abaccept
\uff0c\u5219get_custom_input()
\u51fd\u6570\u8fd4\u56deget_result()
\u65b9\u6cd5\u7684\u8fd4\u56de\u503c\u3002
"},{"location":"user-interaction/#2_2","title":"\uff082\uff09\u5b9e\u4f8b","text":"\u4e0b\u9762\uff0c\u901a\u8fc7\u4e00\u4e2a\u5b9e\u9645\u7684\u4f8b\u5b50\u6765\u6f14\u793a\u5982\u4f55\u521b\u5efa\u548c\u4f7f\u7528\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u3002\u8fd9\u6b21\u6211\u4eec\u9009\u62e9\u7528QT\u63d0\u4f9b\u7684\u53ef\u89c6\u5316\u8bbe\u8ba1\u5de5\u5177QT\u8bbe\u8ba1\u5e08
\u6765\u5b8c\u6210\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u7684\u4e3b\u63a7\u4ef6\u7684\u8bbe\u8ba1\u548c\u5e03\u5c40\u3002
\u5047\u8bbe\u8981\u4e3a\u4ee5\u4e0b\u7c7b\u578b\u521b\u5efa\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\uff1a
@dataclasses.dataclass\nclass UserInfo:\n username: str\n birthday: date\n address: str\n email: str\n phone: str\n description: str\n
\u7b2c\u4e00\u6b65\uff1a\u521b\u5efa\u5bf9\u5e94\u7684\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u7c7b
\uff0c\u7c7b\u540d\u4e3aUserInfoDialog
\u3002
class UserInfoDialog(UniversalInputDialog):\n\n def __init__(\n self,\n parent: Optional[QWidget],\n title: str = \"\",\n icon: IconType = None,\n size: Tuple[int, int] = (400, 300),\n ok_button_text: str = \"Ok\",\n cancel_button_text: Optional[str] = \"Cancel\",\n **kwargs\n ):\n super().__init__(\n parent,\n title=title,\n icon=icon,\n size=size,\n ok_button_text=ok_button_text,\n cancel_button_text=cancel_button_text,\n **kwargs\n )\n\n def get_result(self) -> Any:\n pass\n\n def create_main_widget(self) -> QWidget:\n pass\n
create_main_widget()
\u548cget_result()
\u76ee\u524d\u90fd\u8fd8\u662f\u672a\u5b9e\u73b0\u7684\u72b6\u6001\uff0c\u540e\u9762\u6211\u4eec\u5c06\u9010\u6b65\u5b9e\u73b0\u5b83\u4eec\u3002\u540c\u65f6\uff0c\u8bfb\u8005\u53ef\u80fd\u5df2\u7ecf\u6ce8\u610f\u5230\uff0cUserInfoDialog
\u6784\u9020\u51fd\u6570\u4e2d\u6709\u4e00\u4e9b\u53c2\u6570\uff0c\u8fd9\u4e9b\u53c2\u6570\u5747\u6765\u81ea\u5176\u7236\u7c7bUniversalInputDialog
\uff0c\u53ef\u4ee5\u76f4\u63a5\u4ece\u7236\u7c7b\u6784\u9020\u51fd\u6570\u590d\u5236\u8fc7\u6765\u3002
\u73b0\u5728\uff0c\u5411UserInfoDialog
\u7c7b\u7684\u6784\u9020\u51fd\u6570\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u53c2\u6570\uff1ainitial_user_info
\uff0c\u8fd9\u4e2a\u53c2\u6570\u8868\u793a\u521d\u59cb\u7684UserInfo
\u5bf9\u8c61\uff0c\u540e\u7eed\u5c06\u7528\u4e8e\u4e3a\u63a7\u4ef6\u8bbe\u7f6e\u521d\u59cb\u503c\u3002\u73b0\u5728UserInfoDialog
\u7684\u6784\u9020\u51fd\u6570\u5982\u4e0b\uff1a
class UserInfoDialog(UniversalInputDialog):\n def __init__(\n self,\n parent: Optional[QWidget],\n title: str = \"\",\n icon: IconType = None,\n size: Tuple[int, int] = (400, 300),\n ok_button_text: str = \"Ok\",\n cancel_button_text: Optional[str] = \"Cancel\",\n initial_user_info: Optional[UserInfo] = None,\n **kwargs\n ):\n self._initial_user_info: Optional[UserInfo] = initial_user_info\n super().__init__(\n parent,\n title=title,\n icon=icon,\n size=size,\n ok_button_text=ok_button_text,\n cancel_button_text=cancel_button_text,\n **kwargs\n )\n ...\n
\u7b2c\u4e8c\u6b65\uff1a\u521b\u5efa\u4e3b\u63a7\u4ef6
\uff0c\u5b9e\u73b0create_main_widget()
\u51fd\u6570\u3002
\u524d\u9762\u8bf4\u8fc7\uff0c\u8fd9\u6b21\u9009\u62e9\u4f7f\u7528QT\u8bbe\u8ba1\u5e08
\u800c\u4e0d\u662f\u624b\u52a8\u5199\u4ee3\u7801\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\u4e3b\u63a7\u4ef6\u3002
\u6839\u636eUserInfo
\u7684\u5b57\u6bb5\u4fe1\u606f\uff0c\u5728QT\u8bbe\u8ba1\u5e08
\u4e2d\u62d6\u62fd\u5408\u9002\u7684\u63a7\u4ef6\uff0c\u5b8c\u6210\u5e03\u5c40\uff0c\u5e76\u5c06\u5e03\u5c40\u597d\u7684\u754c\u9762\u4fdd\u5b58\u4e3a.ui
\u6587\u4ef6\uff0c\u8fd9\u91cc\u6211\u4eec\u5c06\u5176\u547d\u540d\u4e3auser_info_dialog_main_widget.ui
\uff0c\u5c06\u8be5\u6587\u4ef6\u4e0eUserInfoDialog
\u6e90\u7801\u6587\u4ef6\u653e\u5728\u540c\u4e00\u76ee\u5f55\u4e0b\u3002
\u6211\u4eec\u9700\u8981\u5728QT\u8bbe\u8ba1\u5e08
\u4e2d\u4e3a\u8f93\u5165\u63a7\u4ef6\u5408\u7406\u8bbe\u7f6e\u5bf9\u8c61\u540d\u79f0\uff08objectName\uff09\uff0c\u4ee5\u4fbf\u540e\u7eed\u5728\u4ee3\u7801\u4e2d\u5f15\u7528\u5b83\u4eec\u3002\u5728\u672c\u793a\u4f8b\u4e2d\uff0c\u8fd9\u4e9b\u63a7\u4ef6\u7684\u540d\u79f0\u5982\u4e0b\u56fe\u6240\u793a\uff1a
\u73b0\u5728\u9700\u8981\u5728create_main_widget()
\u4e2d\u52a0\u8f7d.ui
\u6587\u4ef6\uff0c\u83b7\u53d6\u5404\u5b57\u6bb5\u5bf9\u5e94\u7684\u8f93\u5165\u63a7\u4ef6\uff0c\u5e76\u6839\u636einital_user_info
\u8bbe\u7f6e\u5176\u521d\u59cb\u503c\uff0c\u6700\u540e\u8fd4\u56de\u6700\u5916\u5c42\u7684\u63a7\u4ef6\u3002
...\n def create_main_widget(self) -> QWidget:\n ui_file = \"user_info_dialog_main_widget.ui\"\n # create widget from ui file\n main_widget = loadUi(ui_file)\n\n # obtain input widgets for UserInfo fields and set its initial values from initial_user_info\n self._username_edit = main_widget.findChild(QLineEdit, \"username_edit\")\n if self._initial_user_info:\n self._username_edit.setText(self._initial_user_info.username)\n\n self._birthday_edit = main_widget.findChild(QDateEdit, \"birthday_edit\")\n if self._initial_user_info:\n self._birthday_edit.setDate(self._initial_user_info.birthday)\n\n self._address_edit = main_widget.findChild(QLineEdit, \"address_edit\")\n if self._initial_user_info:\n self._address_edit.setText(self._initial_user_info.address)\n\n self._email_edit = main_widget.findChild(QLineEdit, \"email_edit\")\n if self._initial_user_info:\n self._email_edit.setText(self._initial_user_info.email)\n\n self._phone_edit = main_widget.findChild(QLineEdit, \"phone_edit\")\n if self._initial_user_info:\n self._phone_edit.setText(self._initial_user_info.phone)\n\n self._description_edit = main_widget.findChild(QTextEdit, \"description_edit\")\n if self._initial_user_info:\n self._description_edit.setText(self._initial_user_info.description)\n\n return main_widget\n
\u4e3a\u4e86\u4ee3\u7801\u7684\u5176\u4ed6\u5730\u65b9\u5f15\u7528\u65b9\u4fbf\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u6784\u9020\u51fd\u6570\u4e2d\u9884\u5148\u5b9a\u4e49self._username_edit
\u3001self._birthday_edit
\u7b49\u6210\u5458\u53d8\u91cf\u3002\u73b0\u5728\uff0cUserInfoDialog
\u7c7b\u7684\u4ee3\u7801\u5982\u4e0b\uff1a
class UserInfoDialog(UniversalInputDialog):\n def __init__(\n self,\n parent: Optional[QWidget],\n title: str = \"\",\n icon: IconType = None,\n size: Tuple[int, int] = (400, 300),\n ok_button_text: str = \"Ok\",\n cancel_button_text: Optional[str] = \"Cancel\",\n initial_user_info: Optional[UserInfo] = None,\n **kwargs\n ):\n self._description_edit: Optional[QTextEdit] = None\n self._phone_edit: Optional[QLineEdit] = None\n self._email_edit: Optional[QLineEdit] = None\n self._address_edit: Optional[QLineEdit] = None\n self._birthday_edit: Optional[QDateEdit] = None\n self._username_edit: Optional[QLineEdit] = None\n self._initial_user_info: Optional[UserInfo] = initial_user_info\n super().__init__(\n parent,\n title=title,\n icon=icon,\n size=size,\n ok_button_text=ok_button_text,\n cancel_button_text=cancel_button_text,\n **kwargs\n )\n\n def get_result(self) -> Any:\n pass\n\n def create_main_widget(self) -> QWidget:\n ui_file = \"user_info_dialog_main_widget.ui\"\n # create widget from ui file\n main_widget = loadUi(ui_file)\n\n # obtain input widgets for UserInfo fields and set its initial values from initial_user_info\n self._username_edit = main_widget.findChild(QLineEdit, \"username_edit\")\n if self._initial_user_info:\n self._username_edit.setText(self._initial_user_info.username)\n\n self._birthday_edit = main_widget.findChild(QDateEdit, \"birthday_edit\")\n if self._initial_user_info:\n self._birthday_edit.setDate(self._initial_user_info.birthday)\n\n self._address_edit = main_widget.findChild(QLineEdit, \"address_edit\")\n if self._initial_user_info:\n self._address_edit.setText(self._initial_user_info.address)\n\n self._email_edit = main_widget.findChild(QLineEdit, \"email_edit\")\n if self._initial_user_info:\n self._email_edit.setText(self._initial_user_info.email)\n\n self._phone_edit = main_widget.findChild(QLineEdit, \"phone_edit\")\n if self._initial_user_info:\n self._phone_edit.setText(self._initial_user_info.phone)\n\n self._description_edit = main_widget.findChild(QTextEdit, \"description_edit\")\n if self._initial_user_info:\n self._description_edit.setText(self._initial_user_info.description)\n\n return main_widget\n
\u63a5\u4e0b\u6765\uff0c\u53ea\u9700\u8981\u5b9e\u73b0get_result()
\u65b9\u6cd5\u5373\u53ef\u5927\u529f\u544a\u6210\u3002
\u7b2c\u4e09\u6b65\uff1a\u5b9e\u73b0get_result()
\u65b9\u6cd5\uff0c\u8fd4\u56de\u7528\u6237\u8f93\u5165\u7ed3\u679c\u3002
\u5728\u672c\u793a\u4f8b\u4e2d\uff0cget_result()
\u5e94\u5f53\u8fd4\u56de\u4e00\u4e2aUserInfo
\u5bf9\u8c61\u3002\u8fd9\u5c06\u662f\u975e\u5e38\u7b80\u5355\u7684\u4e00\u4ef6\u4e8b\uff0c\u53ea\u9700\u4ece\u5bf9\u5e94\u7684\u63a7\u4ef6\u83b7\u53d6\u5f53\u524d\u503c\uff0c\u7528\u8fd9\u4e9b\u503c\u5b9e\u4f8b\u5316UserInfo
\uff0c\u7136\u540e\u8fd4\u56de\u8be5\u5bf9\u8c61\u5373\u53ef\uff0c\u5177\u4f53\u4ee3\u7801\u5982\u4e0b\uff1a
def get_result(self) -> UserInfo:\n username = self._username_edit.text()\n birthday = self._birthday_edit.date().toPyDate()\n address = self._address_edit.text()\n email = self._email_edit.text()\n phone = self._phone_edit.text()\n description = self._description_edit.toPlainText()\n new_user_info = UserInfo(\n username=username,\n birthday=birthday,\n address=address,\n email=email,\n phone=phone,\n description=description,\n )\n return new_user_info\n
\u73b0\u5728\uff0c\u6211\u4eec\u7684UserInfoDialog
\u5df2\u7ecf\u5b8c\u6210\u4e86\uff0c\u5b8c\u6574\u7684\u4ee3\u7801\u5982\u4e0b\uff1a
class UserInfoDialog(UniversalInputDialog):\n\n def __init__(\n self,\n parent: Optional[QWidget],\n title: str = \"\",\n icon: IconType = None,\n size: Tuple[int, int] = (400, 300),\n ok_button_text: str = \"Ok\",\n cancel_button_text: Optional[str] = \"Cancel\",\n initial_user_info: Optional[UserInfo] = None,\n **kwargs\n ):\n self._description_edit: Optional[QTextEdit] = None\n self._phone_edit: Optional[QLineEdit] = None\n self._email_edit: Optional[QLineEdit] = None\n self._address_edit: Optional[QLineEdit] = None\n self._birthday_edit: Optional[QDateEdit] = None\n self._username_edit: Optional[QLineEdit] = None\n self._initial_user_info: Optional[UserInfo] = initial_user_info\n super().__init__(\n parent,\n title=title,\n icon=icon,\n size=size,\n ok_button_text=ok_button_text,\n cancel_button_text=cancel_button_text,\n **kwargs\n )\n\n def get_result(self) -> UserInfo:\n username = self._username_edit.text()\n birthday = self._birthday_edit.date().toPyDate()\n address = self._address_edit.text()\n email = self._email_edit.text()\n phone = self._phone_edit.text()\n description = self._description_edit.toPlainText()\n new_user_info = UserInfo(\n username=username,\n birthday=birthday,\n address=address,\n email=email,\n phone=phone,\n description=description,\n )\n return new_user_info\n\n def create_main_widget(self) -> QWidget:\n ui_file = \"user_info_dialog_main_widget.ui\"\n # create widget from ui file\n main_widget = loadUi(ui_file)\n\n # obtain input widgets for UserInfo fields and set its initial values from initial_user_info\n self._username_edit = main_widget.findChild(QLineEdit, \"username_edit\")\n if self._initial_user_info:\n self._username_edit.setText(self._initial_user_info.username)\n\n self._birthday_edit = main_widget.findChild(QDateEdit, \"birthday_edit\")\n if self._initial_user_info:\n self._birthday_edit.setDate(self._initial_user_info.birthday)\n\n self._address_edit = main_widget.findChild(QLineEdit, \"address_edit\")\n if self._initial_user_info:\n self._address_edit.setText(self._initial_user_info.address)\n\n self._email_edit = main_widget.findChild(QLineEdit, \"email_edit\")\n if self._initial_user_info:\n self._email_edit.setText(self._initial_user_info.email)\n\n self._phone_edit = main_widget.findChild(QLineEdit, \"phone_edit\")\n if self._initial_user_info:\n self._phone_edit.setText(self._initial_user_info.phone)\n\n self._description_edit = main_widget.findChild(QTextEdit, \"description_edit\")\n if self._initial_user_info:\n self._description_edit.setText(self._initial_user_info.description)\n\n return main_widget\n
\u8ba9\u6211\u4eec\u5199\u4e00\u4e2a\u51fd\u6570\u6765\u6d4b\u8bd5\u4e00\u4e0b\u5b83\u5427\u3002
def user_info_example(\n initial_username: str = \"\",\n initial_birthday: date = date(1990, 1, 1),\n initial_address: str = \"\",\n initial_email: str = \"\",\n initial_phone: str = \"\",\n initial_description: text_t = \"\",\n):\n user_info = uinput.get_custom_input(\n UserInfoDialog,\n title=\"Get User Info\",\n size=(350, 400),\n ok_button_text=\"Confirm\",\n cancel_button_text=\"Dismiss\",\n initial_user_info=UserInfo(\n username=initial_username,\n birthday=initial_birthday,\n address=initial_address,\n email=initial_email,\n phone=initial_phone,\n description=initial_description,\n ),\n )\n uprint(user_info)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(user_info_example)\n adapter.run()\n
\u6548\u679c\u5982\u4e0b\uff1a
\u6700\u540e\uff0c\u8d34\u4e0a\u5b8c\u6574\u4ee3\u7801\uff1a
\u53ef\u5728examples/\u76ee\u5f55\u4e0b\u627e\u5230\u4ee5\u4e0b\u4ee3\u7801\u53ca\u76f8\u5173\u7684.ui
\u6587\u4ef6\u3002
import dataclasses\nfrom datetime import date\nfrom typing import Optional, Tuple\n\nfrom qtpy.QtWidgets import QWidget, QLineEdit, QTextEdit, QDateEdit\nfrom qtpy.uic import loadUi\n\nfrom pyguiadapter.adapter import uinput, GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import text_t\nfrom pyguiadapter.utils import IconType\nfrom pyguiadapter.utils.inputdialog import UniversalInputDialog\n\n\n@dataclasses.dataclass\nclass UserInfo:\n username: str\n birthday: date\n address: str\n email: str\n phone: str\n description: str\n\n\nclass UserInfoDialog(UniversalInputDialog):\n\n def __init__(\n self,\n parent: Optional[QWidget],\n title: str = \"\",\n icon: IconType = None,\n size: Tuple[int, int] = (400, 300),\n ok_button_text: str = \"Ok\",\n cancel_button_text: Optional[str] = \"Cancel\",\n initial_user_info: Optional[UserInfo] = None,\n **kwargs\n ):\n self._description_edit: Optional[QTextEdit] = None\n self._phone_edit: Optional[QLineEdit] = None\n self._email_edit: Optional[QLineEdit] = None\n self._address_edit: Optional[QLineEdit] = None\n self._birthday_edit: Optional[QDateEdit] = None\n self._username_edit: Optional[QLineEdit] = None\n self._initial_user_info: Optional[UserInfo] = initial_user_info\n super().__init__(\n parent,\n title=title,\n icon=icon,\n size=size,\n ok_button_text=ok_button_text,\n cancel_button_text=cancel_button_text,\n **kwargs\n )\n\n def get_result(self) -> UserInfo:\n username = self._username_edit.text()\n birthday = self._birthday_edit.date().toPyDate()\n address = self._address_edit.text()\n email = self._email_edit.text()\n phone = self._phone_edit.text()\n description = self._description_edit.toPlainText()\n new_user_info = UserInfo(\n username=username,\n birthday=birthday,\n address=address,\n email=email,\n phone=phone,\n description=description,\n )\n return new_user_info\n\n def create_main_widget(self) -> QWidget:\n ui_file = \"user_info_dialog_main_widget.ui\"\n # create widget from ui file\n main_widget = loadUi(ui_file)\n\n # obtain input widgets for UserInfo fields and set its initial values from initial_user_info\n self._username_edit = main_widget.findChild(QLineEdit, \"username_edit\")\n if self._initial_user_info:\n self._username_edit.setText(self._initial_user_info.username)\n\n self._birthday_edit = main_widget.findChild(QDateEdit, \"birthday_edit\")\n if self._initial_user_info:\n self._birthday_edit.setDate(self._initial_user_info.birthday)\n\n self._address_edit = main_widget.findChild(QLineEdit, \"address_edit\")\n if self._initial_user_info:\n self._address_edit.setText(self._initial_user_info.address)\n\n self._email_edit = main_widget.findChild(QLineEdit, \"email_edit\")\n if self._initial_user_info:\n self._email_edit.setText(self._initial_user_info.email)\n\n self._phone_edit = main_widget.findChild(QLineEdit, \"phone_edit\")\n if self._initial_user_info:\n self._phone_edit.setText(self._initial_user_info.phone)\n\n self._description_edit = main_widget.findChild(QTextEdit, \"description_edit\")\n if self._initial_user_info:\n self._description_edit.setText(self._initial_user_info.description)\n\n return main_widget\n\n\ndef user_info_example(\n initial_username: str = \"\",\n initial_birthday: date = date(1990, 1, 1),\n initial_address: str = \"\",\n initial_email: str = \"\",\n initial_phone: str = \"\",\n initial_description: text_t = \"\",\n):\n user_info = uinput.get_custom_input(\n UserInfoDialog,\n title=\"Get User Info\",\n size=(350, 400),\n ok_button_text=\"Confirm\",\n cancel_button_text=\"Dismiss\",\n initial_user_info=UserInfo(\n username=initial_username,\n birthday=initial_birthday,\n address=initial_address,\n email=initial_email,\n phone=initial_phone,\n description=initial_description,\n ),\n )\n uprint(user_info)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(user_info_example)\n adapter.run()\n
"},{"location":"user-interaction/#toast","title":"\uff08\u56db\uff09Toast\u6d88\u606f","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7pyguiadapter.adapter.utoast\u6a21\u5757\u5c55\u793a\u3001\u6e05\u9664Toast\u6d88\u606f\u3002
Toast\u76f8\u5173\u7684API\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.adapter.utoast
- pyguiadapter.toast
\u4ee5\u4e0b\u793a\u4f8b\u5c55\u793a\u4e86Toast\u6d88\u606f\u7684\u57fa\u672c\u7528\u6cd5\uff1a
from typing import Literal\n\nfrom pyguiadapter.adapter import GUIAdapter, utoast\nfrom pyguiadapter.exceptions import ParameterError\nfrom pyguiadapter.extend_types import text_t, color_hex_t, int_slider_t\nfrom pyguiadapter.toast import ToastConfig, AlignLeft, AlignRight, AlignCenter\n\n\ndef utoast_example(\n message: text_t,\n duration: int = 3000,\n opacity: float = 0.9,\n fade_out: int = 500,\n text_align: Literal[\"left\", \"right\", \"center\"] = \"center\",\n text_padding: int = 50,\n background_color: color_hex_t = \"#323232\",\n text_color: color_hex_t = \"#FFFFFF\",\n font_size: int = 26,\n font_family: str = \"Consolas\",\n position_x: int_slider_t = 50,\n position_y: int_slider_t = 50,\n):\n \"\"\"\n Show a toast message on the screen.\n\n Args:\n message: The message to be displayed.\n duration: The duration of the toast message in milliseconds.\n opacity: The opacity of the toast message.\n fade_out: The duration of the fade out animation in milliseconds.\n text_align: The alignment of the text inside the toast message.\n text_padding: The padding of the text inside the toast message.\n background_color: The background color of the toast message.\n text_color: The text color of the toast message.\n font_size: The font size of the text inside the toast message.\n font_family: The font family of the text inside the toast message.\n position_x: The x position (by percentage) of the toast message on the screen.\n position_y: The y position (by percentage) of the toast message on the screen.\n\n @params\n [opacity]\n min_value = 0.0\n max_value = 1.0\n step = 0.01\n\n [position_x]\n min_value = 0\n max_value = 100\n prefix = \"x: \"\n suffix = \"%\"\n\n [position_y]\n min_value = 0\n max_value = 100\n prefix = \"y: \"\n suffix = \"%\"\n\n [background_color]\n alpha_channel = false\n\n [text_color]\n alpha_channel = false\n\n @end\n\n \"\"\"\n if not message or message.strip() == \"\":\n raise ParameterError(\n parameter_name=\"message\", message=\"Message cannot be empty.\"\n )\n\n if text_align == \"left\":\n align = AlignLeft\n elif text_align == \"right\":\n align = AlignRight\n else:\n align = AlignCenter\n\n position_x = float(position_x) / 100.0\n position_y = float(position_y) / 100.0\n\n toast_config = ToastConfig(\n opacity=opacity,\n background_color=background_color,\n text_color=text_color,\n text_padding=text_padding,\n text_alignment=align,\n font_size=font_size,\n font_family=font_family,\n position=(position_x, position_y),\n fade_out=fade_out,\n )\n utoast.show_toast(message, duration, toast_config)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(utoast_example)\n adapter.run()\n
\u6548\u679c\u5982\u4e0b\uff1a
"},{"location":"user-interaction/#_4","title":"\uff08\u4e94\uff09\u5176\u5b83","text":"pyguiadapter.adapter.useful \u4e2d\u5305\u542b\u4e86\u5176\u4ed6\u4e00\u4e9b\u53ef\u4ee5\u5728\u7528\u6237\u51fd\u6570\u4e2d\u8c03\u7528\u7684\u5b9e\u7528\u51fd\u6570\u3002
"},{"location":"utility/","title":"\u5b9e\u7528\u51fd\u6570","text":""},{"location":"utility/#_1","title":"\uff08\u4e00\uff09\u6982\u8ff0","text":"PyGUIAdapter
\u63d0\u4f9b\u4e86\u5927\u91cf\u5b9e\u7528\u51fd\u6570\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u7a97\u53e3\u6216Action
\u7684\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u8c03\u7528\u8fd9\u4e9b\u51fd\u6570\uff0c\u8fdb\u4e00\u6b65\u6269\u5c55\u7a0b\u5e8f\u7684\u529f\u80fd\u3002
\u8fd9\u4e9b\u51fd\u6570\u53ef\u4ee5\u5728pyguiadapter.utils
\u5305\u4e0b\u627e\u5230\uff0c\u4e3b\u8981\u5305\u542b\u4ee5\u4e0b\u51e0\u4e2a\u6a21\u5757\uff1a
filedialog
\uff0c\u4e3b\u8981\u63d0\u4f9b\u6587\u4ef6\u9009\u62e9\u5bf9\u8bdd\u6846\u529f\u80fd\u3002 messagebox
\uff0c\u4e3b\u8981\u63d0\u4f9b\u6d88\u606f\u5bf9\u8bdd\u6846\u529f\u80fd\u3002 inputdialog
\uff0c\u4e3b\u8981\u63d0\u4f9b\u8f93\u5165\u5bf9\u8bdd\u6846\u529f\u80fd\u3002 editor
\uff0c\u4e3b\u8981\u63d0\u4f9b\u7ed3\u6784\u5316\u5bf9\u8c61\u7f16\u8f91\u5668\u529f\u80fd\u3002\u5173\u4e8e\u7ed3\u6784\u5316\u5bf9\u8c61\u53ca\u5176\u7f16\u8f91\u5668\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a \u7ed3\u6784\u5316\u5bf9\u8c61\u53ca\u5176\u7f16\u8f91\u5668
"},{"location":"utility/#_2","title":"\uff08\u4e8c\uff09\u4f7f\u7528\u65b9\u6cd5","text":""},{"location":"utility/#1","title":"1\u3001\u5bfc\u5165\u6a21\u5757","text":"\u4ee5filedialog
\u6a21\u5757\u4e3a\u4f8b\uff0c\u5bfc\u5165\u6a21\u5757\u4ee3\u7801\u5982\u4e0b\uff1a
from pyguiadapter.utils import filedialog\n
"},{"location":"utility/#2","title":"2\u3001\u8c03\u7528\u76f8\u5e94\u51fd\u6570","text":"\u6bd4\u5982\uff0c\u9700\u8981\u901a\u8fc7\u6253\u5f00\u6587\u4ef6\u5bf9\u8bdd\u6846\u9009\u62e9\u6587\u4ef6\u8def\u5f84\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u8c03\u7528filedialog.get_open_file()
\u51fd\u6570\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a
file_path = filedialog.get_open_file(window, title=\"\u6253\u5f00\u6587\u4ef6\", filters=\"\u6587\u672c\u6587\u4ef6 (*.txt);;\u6240\u6709\u6587\u4ef6 (*.*)\")\nif not file_path:\n # \u7528\u6237\u53d6\u6d88\u9009\u62e9\u6587\u4ef6\n ...\nelse:\n # \u7528\u6237\u9009\u62e9\u4e86\u6587\u4ef6\uff0c\u53ef\u4ee5\u8fdb\u884c\u540e\u7eed\u64cd\u4f5c\n ...\n
\u5176\u4e2d\uff0cwindow
\u53c2\u6570\u662f\u7a97\u53e3\u5bf9\u8c61\uff0c\u5f00\u53d1\u8005\u5728\u7a97\u53e3\u6216\u8005Action
\u7684\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u53ef\u4ee5\u8bbf\u95ee\u5230\u5f53\u524d\u7684\u7a97\u53e3\u5bf9\u8c61\u3002\u8fd9\u4e5f\u662f\u8fd9\u4e9b\u5b9e\u7528\u51fd\u6570\u7279\u522b\u9002\u5408\u5728\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u4f7f\u7528\u7684\u539f\u56e0\uff1a\u5b9e\u7528\u51fd\u6570\u4e2d\u6709\u5f88\u591a\u90fd\u9700\u8981\u4e00\u4e2a\u7a97\u53e3\u5bf9\u8c61\u4f5c\u4e3a\u53c2\u6570\uff0c\u800c\u5f00\u53d1\u8005\u57fa\u672c\u4e0a\u53ea\u6709\u5728\u5404\u79cd\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u624d\u6709\u673a\u4f1a\u83b7\u53d6\u5230\u5f53\u524d\u7a97\u53e3\u5bf9\u8c61\u3002
"},{"location":"utility/#3","title":"3\u3001\u5728\u7a97\u53e3\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u8c03\u7528\u5b9e\u7528\u51fd\u6570","text":"\u4e0b\u9762\u7684\u793a\u4f8b\u5c55\u793a\u4e86\u5982\u4f55\u5c06\u7a97\u53e3\u4e8b\u4ef6\u56de\u8c03\u4e0e\u5b9e\u7528\u51fd\u6570\u7ed3\u5408\u4f7f\u7528\uff0c\u6211\u4eec\u5c06\u5b9e\u73b0\u4e00\u4e2a\u7b80\u5355\u7684\u529f\u80fd\uff0c\u5728\u7a97\u53e3\u5173\u95ed\u65f6\u5f39\u51fa\u786e\u8ba4\u5bf9\u8bdd\u6846\uff0c\u7528\u6237\u786e\u8ba4\u540e\u518d\u5173\u95ed\u7a97\u53e3\u3002
\u57fa\u672c\u601d\u8def\u662f\uff1a\u5728\u7a97\u53e3\u7684on_close
\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u8c03\u7528messagebox
\u6a21\u5757\u7684show_question_message()
\u51fd\u6570\uff0c\u5e76\u6839\u636e\u7528\u6237\u7684\u9009\u62e9\u51b3\u5b9a\u662f\u5426\u5173\u95ed\u7a97\u53e3\u3002\u4ee3\u7801\u975e\u5e38\u7b80\u5355\uff0c\u5982\u4e0b\u6240\u793a\uff1a
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.utils import messagebox\nfrom pyguiadapter.window import SimpleWindowEventListener\nfrom pyguiadapter.windows.fnexec import FnExecuteWindow\n\n\ndef foo(arg1: int, arg2: str, arg3: bool):\n pass\n\n\ndef on_close(window: FnExecuteWindow) -> bool:\n ret = messagebox.show_question_message(\n window, message=\"Are you sure you want to quit?\"\n )\n if ret == messagebox.Yes:\n # when `on_close()` returns True, the window will be closed\n return True\n else:\n messagebox.show_info_message(window, message=\"Quit cancelled by user!\")\n # when `on_close()` returns False, the window will not be closed\n # in other words, the close event will be ignored\n return False\n\n\nif __name__ == \"__main__\":\n # create a window listener that listens for the `on_close` event\n event_listener = SimpleWindowEventListener(on_close=on_close)\n\n adapter = GUIAdapter()\n # add the `foo` function to the adapter with the `window_listener` argument set to the event_listener\n adapter.add(foo, window_listener=event_listener)\n adapter.run()\n
"},{"location":"utility/#4action","title":"4\u3001\u5728Action
\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u8c03\u7528\u5b9e\u7528\u51fd\u6570","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u63d0\u4f9b\u4ee5\u4e0b\u65b9\u5f0f\u5728Action
\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u8c03\u7528\u5b9e\u7528\u51fd\u6570\uff1a
def on_action_open(window: FnExecuteWindow, _: Action):\n ret = filedialog.get_open_file(\n window,\n title=\"Open File\",\n start_dir=\"./\",\n filters=\"JSON files(*.json);;Python files(*.py);;All files(*.*)\",\n )\n if not ret:\n return\n messagebox.show_info_message(window, f\"File will be opened: {ret}\")\n
\u5b8c\u6574\u7684\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a
from pyguiadapter.action import Action, Separator\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.menu import Menu\nfrom pyguiadapter.toolbar import ToolBar\nfrom pyguiadapter.windows.fnexec import FnExecuteWindow\nfrom pyguiadapter.utils import messagebox, filedialog\n\n\ndef on_action_about(window: FnExecuteWindow, _: Action):\n messagebox.show_info_message(\n parent=window,\n message=\"This is an example of toolbar and menu with custom actions.\",\n title=\"About\",\n )\n\n\ndef on_action_close(window: FnExecuteWindow, _: Action):\n ret = messagebox.show_question_message(\n window, \"Are you sure you want to quit?\", buttons=messagebox.Yes | messagebox.No\n )\n if ret == messagebox.Yes:\n window.close()\n\n\ndef on_action_open(window: FnExecuteWindow, _: Action):\n ret = filedialog.get_open_file(\n window,\n title=\"Open File\",\n start_dir=\"./\",\n filters=\"JSON files(*.json);;Python files(*.py);;All files(*.*)\",\n )\n if not ret:\n return\n messagebox.show_info_message(window, f\"File will be opened: {ret}\")\n\n\ndef on_action_save(window: FnExecuteWindow, _: Action):\n ret = filedialog.get_save_file(\n window,\n title=\"Save File\",\n start_dir=\"./\",\n filters=\"JSON files(*.json);;All files(*.*)\",\n )\n if not ret:\n return\n messagebox.show_info_message(window, f\"File will be saved: {ret}\")\n\n\ndef on_action_auto_theme(window: FnExecuteWindow, _: Action, checked: bool):\n if checked:\n messagebox.show_info_message(window, \"Auto theme is selected.\")\n\n\ndef on_action_light_theme(window: FnExecuteWindow, _: Action, checked: bool):\n if checked:\n messagebox.show_info_message(window, \"Light theme is selected.\")\n\n\ndef on_action_dark_theme(window: FnExecuteWindow, _: Action, checked: bool):\n if checked:\n messagebox.show_info_message(window, \"Dark theme is selected.\")\n\n\naction_about = Action(\n text=\"About\",\n icon=\"fa.info-circle\",\n on_triggered=on_action_about,\n)\n\naction_open = Action(\n text=\"Open\",\n icon=\"fa.folder-open\",\n shortcut=\"Ctrl+O\",\n on_triggered=on_action_open,\n)\n\naction_save = Action(\n text=\"Save\",\n icon=\"fa.save\",\n shortcut=\"Ctrl+S\",\n on_triggered=on_action_save,\n)\n\naction_close = Action(\n text=\"Quit\",\n icon=\"fa.close\",\n shortcut=\"Ctrl+Q\",\n on_triggered=on_action_close,\n)\n\naction_auto_them = Action(\n text=\"Auto\",\n checkable=True,\n checked=True,\n on_toggled=on_action_auto_theme,\n)\n\naction_light_theme = Action(\n text=\"Light\",\n checkable=True,\n on_toggled=on_action_light_theme,\n)\n\naction_dark_theme = Action(\n text=\"Dark\",\n checkable=True,\n on_toggled=on_action_dark_theme,\n)\n\nsubmenu_theme = Menu(\n title=\"Theme\",\n actions=[action_auto_them, action_light_theme, action_dark_theme],\n exclusive=True,\n)\nmenu_file = Menu(\n title=\"File\",\n actions=[\n action_open,\n action_save,\n Separator(),\n action_close,\n Separator(),\n submenu_theme,\n ],\n)\nmenu_help = Menu(\n title=\"Help\",\n actions=[action_about],\n)\n\n\ndef menu_toolbar_example(arg1: int, arg2: str, arg3: bool):\n \"\"\"\n This example shows how to add and config toolbar and menus to the window.\n @param arg1:\n @param arg2:\n @param arg3:\n @return:\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n menu_toolbar_example,\n window_menus=[menu_file, menu_help],\n window_toolbar=ToolBar(\n actions=[action_open, action_save, Separator(), action_close]\n ),\n )\n adapter.run()\n
\u4e0a\u8ff0\u4ee3\u7801\u8fd0\u884c\u7ed3\u679c\u5982\u4e0b\uff1a
"},{"location":"widget-config/","title":"\u914d\u7f6e\u63a7\u4ef6\u5c5e\u6027","text":""},{"location":"widget-config/#_1","title":"\u4e00\u3001\u4ec0\u4e48\u51b3\u5b9a\u4e86\u51fd\u6570\u53c2\u6570\u7684\u63a7\u4ef6\u7c7b\u578b\uff1f","text":""},{"location":"widget-config/#_2","title":"\uff08\u4e00\uff09\u4e00\u822c\u89c4\u5219\uff1a\u51fd\u6570\u53c2\u6570\u7c7b\u578b\u4fe1\u606f","text":"\u4e00\u822c\u800c\u8a00\uff0c\u51fd\u6570\u53c2\u6570\u6240\u5bf9\u5e94\u7684\u8f93\u5165\u63a7\u4ef6\u7531\u8be5\u53c2\u6570\u7684\u6570\u636e\u7c7b\u578b\u51b3\u5b9a\uff0c\u800c\u51fd\u6570\u53c2\u6570\u7684\u7c7b\u578b\u5219\u4e3b\u8981\u7531Python\u7c7b\u578b\u6807\u6ce8\u786e\u5b9a\u3002
def f1(a: str, b: int, c: float):\n pass\n
\u4f8b\u5982\uff0c\u5728\u4e0a\u9762\u7684\u51fd\u6570f1
\u4e2d\uff0c\u53c2\u6570a
\u3001b
\u3001c
\u7684\u7c7b\u578b\u5206\u522b\u88ab\u6807\u6ce8\u4e3astr
\u3001int
\u3001float
\u3002\u5728\u8fd0\u884c\u65f6\uff0cPyGUIAdapter
\u5c06\u8bfb\u53d6\u8fd9\u4e00\u4fe1\u606f\uff0c\u5206\u522b\u4e3aa
\u3001b
\u3001c
\u751f\u6210LineEdit
\u3001IntSpinBox
\u3001FloatSpinBox
\uff0c\u4f5c\u4e3a\u5176\u8f93\u5165\u63a7\u4ef6\u3002
\u5728PyGUIAdapter
\u5185\u90e8\uff0c\u5b9e\u73b0\u4e86\u4e00\u5957\u6620\u5c04\u673a\u5236\uff0c\u53ef\u4ee5\u5c06\u7279\u5b9a\u7684\u6570\u636e\u7c7b\u578b\u4e0e\u7279\u5b9a\u7684\u63a7\u4ef6\u7c7b\u578b\u5173\u8054\u8d77\u6765\uff0c\u5728\u5224\u65ad\u5e94\u5f53\u4e3a\u67d0\u4e2a\u51fd\u6570\u53c2\u6570\u751f\u6210\u4f55\u79cd\u7c7b\u578b\u7684\u63a7\u4ef6\u65f6\uff0c\u53ea\u9700\u6309\u56fe\u7d22\u9aa5\u5373\u53ef\u3002\u56e0\u6b64\uff0c\u6b63\u786e\u5730\u4e3a\u51fd\u6570\u7684\u53c2\u6570\u6807\u6ce8\u6570\u636e\u7c7b\u578b\u81f3\u5173\u91cd\u8981\uff0c\u5bf9\u4e8ePyGUIAdapter
\u800c\u8a00\uff0c\u51fd\u6570\u53c2\u6570\u7684\u7c7b\u578b\u6807\u6ce8\u4e0d\u662f\u90a3\u79cd\u53ef\u6709\u53ef\u3001\u65e0\u9526\u4e0a\u6dfb\u82b1\u7684\u4e1c\u897f\uff01
PyGUIAdapter
\u9664\u4e86\u4ece\u51fd\u6570\u53c2\u6570\u7684\u7c7b\u578b\u6ce8\u89e3\u4e2d\u83b7\u53d6\u53c2\u6570\u7684\u6570\u636e\u7c7b\u578b\u4fe1\u606f\uff0c\u5b83\u8fd8\u5b9e\u73b0\u4e86\u4e00\u4e9b\u201c\u7c7b\u578b\u63a8\u65ad\u201d
\u673a\u5236\u3002\u6bd4\u5982\uff0c\u53ef\u4ee5\u4ece\u51fd\u6570\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u63a8\u65ad\u51fa\u5176\u7c7b\u578b\u3002
def f2(a=10, b=0.5, c=\"hello\", e=True, f=(1, 2, 3)):\n pass\n
\u6216\u8005\uff0c\u53ef\u4ee5\u901a\u8fc7\u6587\u6863\u5b57\u7b26\u4e32(docstring
)\u4e2d\u53c2\u6570\u7684\u63cf\u8ff0\u63a8\u65ad\u5176\u7c7b\u578b\u3002\u6bd4\u5982\u5728\u4e0b\u9762\u7684\u4ee3\u7801\u7247\u6bb5\u4e2d\uff0c\u4f7f\u7528\u6587\u6863\u5b57\u7b26\u4e32\u4e2d\u63cf\u8ff0\u4e86\u51fd\u6570f3()
\u5404\u4e2a\u53c2\u6570\u7684\u7c7b\u578b\u4fe1\u606f\uff1a
def f3(a, b, c):\n \"\"\"\n \u8fd9\u662f\u4e00\u4e2a\u793a\u4f8b\u51fd\u6570.\n\n Args:\n a (int): \u53c2\u6570a\u7684\u63cf\u8ff0.\n b (str): \u53c2\u6570b\u7684\u63cf\u8ff0.\n c (list): \u53c2\u6570c\u7684\u63cf\u8ff0.\n\n Returns:\n bool: \u51fd\u6570\u8fd4\u56de\u7684\u7ed3\u679c\u63cf\u8ff0.\n \"\"\"\n pass\n
\u4f46\u662f\uff0c\u5fc5\u987b\u8981\u6307\u51fa\u7684\u662f\uff0c\u6240\u8c13\u7684\u201c\u7c7b\u578b\u63a8\u65ad\u201d
\u673a\u5236\u4ec5\u4ec5\u662f\u4e00\u79cd\u8f85\u52a9\u7684\u624b\u6bb5\uff0c\u5e76\u4e0d\u603b\u662f\u51c6\u786e\uff0c\u4e5f\u4e0d\u4fdd\u8bc1\u53ef\u9760\uff0c\u901a\u8fc7\u7c7b\u578b\u6807\u6ce8\u8bed\u6cd5\u51c6\u786e\u3001\u60c5\u5f62\u3001\u65e0\u6b67\u4e49\u5730\u6307\u660e\u51fd\u6570\u53c2\u6570\u7684\u7c7b\u578b\uff0c\u6c38\u8fdc\u662f\u66f4\u4f18\u7684\u9009\u62e9\u3002
PyGUIAdapter
\u5df2\u7ecf\u4e3aPython\u4e2d\u5e38\u7528\u6570\u636e\u7c7b\u578b\u5b9e\u73b0\u4e86\u5bf9\u5e94\u7684\u8f93\u5165\u63a7\u4ef6\uff0c\u80fd\u591f\u8986\u76d6\u7edd\u5927\u591a\u6570\u9700\u6c42\u3002\u56e0\u6b64\uff0c\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u5f00\u53d1\u8005\u7684\u4e3b\u8981\u5de5\u4f5c\u5c31\u662f\u6b63\u786e\u5730\u6807\u6ce8\u51fd\u6570\u5404\u4e2a\u53c2\u6570\u7684\u7c7b\u578b\uff0c\u8fd9\u662f\u8bb8\u591aPython\u7a0b\u5e8f\u5458\u5df2\u7ecf\u4e60\u60ef\u7684\u505a\u6cd5\u3002
\u5173\u4e8ePyGUIAdapter
\u652f\u6301\u7684\u6570\u636e\u7c7b\u578b\u53ca\u5176\u6240\u5bf9\u5e94\u7684\u63a7\u4ef6\uff0c\u53ef\u4ee5\u53c2\u8003\uff1a\u63a7\u4ef6\u4e0e\u53c2\u6570\u6570\u636e\u7c7b\u578b\u3002\u3002
\u5f53\u7136\uff0c\u5982\u679c\u5f00\u53d1\u8005\u9700\u8981\u5c06\u67d0\u4e2a\u590d\u6742\u7684\u81ea\u5b9a\u4e49\u6570\u636e\u7c7b\u578b\u4f5c\u4e3a\u53c2\u6570\uff0c\u800c\u5185\u7f6e\u7684\u63a7\u4ef6\u53c8\u65e0\u6cd5\u6ee1\u8db3\u9700\u6c42\uff0c\u90a3\u4e48PyGUIAdapter
\u4e5f\u63d0\u4f9b\u4e86\u81ea\u5b9a\u4e49\u63a7\u4ef6
\u63a5\u53e3\uff0c\u5e76\u4e14\u5141\u8bb8\u5f00\u53d1\u8005\u5728\u81ea\u5b9a\u4e49\u6570\u636e\u7c7b\u578b\u4e0e\u81ea\u5b9a\u4e49\u63a7\u4ef6\u4e4b\u95f4\u5efa\u7acb\u6620\u5c04\u5173\u7cfb\uff0c\u8fd9\u610f\u5473\u7740\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u50cf\u4f7f\u7528\u5185\u7f6e\u63a7\u4ef6\u4e00\u6837\u4f7f\u7528\u81ea\u5b9a\u4e49\u63a7\u4ef6\u3002
\u5173\u4e8e\u5982\u4f55\u5b9e\u73b0\u81ea\u5b9a\u4e49\u63a7\u4ef6\uff0c\u53ef\u4ee5\u53c2\u8003\uff1a\u8fd9\u7bc7\u6587\u6863\u3002
"},{"location":"widget-config/#_3","title":"\uff08\u4e8c\uff09\u4f8b\u5916\u89c4\u5219\uff1a\u624b\u52a8\u6307\u5b9a\u53c2\u6570\u7684\u63a7\u4ef6\u7c7b\u578b","text":"\u867d\u7136PyGUIAdapter
\u63a8\u8350\u5f00\u53d1\u8005\u4f7f\u7528\u7c7b\u578b\u6ce8\u89e3\u6765\u786e\u5b9a\u51fd\u6570\u53c2\u6570\u7684\u63a7\u4ef6\u7c7b\u578b\uff0c\u4f46\u5e76\u4e0d\u5f3a\u5236\u8fd9\u4e48\u505a\u3002PyGUIAdapter
\u63d0\u4f9b\u4e86\u624b\u52a8\u6307\u5b9a\u51fd\u6570\u53c2\u6570\u63a7\u4ef6\u7c7b\u578b\u7684\u65b9\u6cd5\u3002\u5176\u4e2d\uff0c\u6700\u7b80\u5355\u7684\u4e00\u79cd\u65b9\u6cd5\u662f\u5728\u8c03\u7528GUIAdapter.add()
\u51fd\u6570\u65f6\uff0c\u901a\u8fc7widget_configs
\u53c2\u6570\u6307\u5b9a\u53c2\u6570\u7684\u63a7\u4ef6\u914d\u7f6e\u7c7b
\u3002
\u6bcf\u79cd\u7c7b\u578b\u7684\u63a7\u4ef6\u90fd\u6709\u4e00\u4e2a\u4e0e\u4e4b\u5173\u8054\u7684\u63a7\u4ef6\u914d\u7f6e\u7c7b
\uff0c\u63a7\u4ef6\u914d\u7f6e\u7c7b\u4e2d\u4e0d\u4ec5\u5b9a\u4e49\u4e86\u63a7\u4ef6\u7c7b\u7684\u5c5e\u6027\uff0c\u800c\u4e14\u5305\u542b\u63a7\u4ef6\u7c7b\u672c\u8eab\u7684\u4fe1\u606f\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u901a\u8fc7\u63a7\u4ef6\u914d\u7f6e\u7c7b
\u53ef\u4ee5\u83b7\u53d6\u5176\u5173\u8054\u7684\u63a7\u4ef6\u7c7b\uff08\u5f53\u7136\u53cd\u8fc7\u6765\u4e5f\u6210\u7acb\uff0c\u901a\u8fc7\u63a7\u4ef6\u7c7b\u6211\u4eec\u4e5f\u53ef\u4ee5\u8bbf\u95ee\u5230\u5176\u5173\u8054\u7684\u914d\u7f6e\u7c7b\uff09\u3002
\u4f8b\u5982\uff0cIntSpinBox
\u63a7\u4ef6\u7c7b\u4e0e\u5176\u914d\u7f6e\u7c7bIntSpinBoxConfig
\u7684\u5173\u7cfb\u5982\u4e0b\uff1a
IntSpinBox.ConfigClass
== IntSpinBoxConfig
IntSpinBoxConfig.target_widget_class()
== IntSpinBox
\u8fd9\u610f\u5473\u7740\uff0c\u5f53\u5f00\u53d1\u8005\u6307\u5b9a\u4e86\u67d0\u4e2a\u53c2\u6570\u7684\u63a7\u4ef6\u914d\u7f6e\u7c7b\u5bf9\u8c61
\uff0c\u90a3\u4e48\u4ed6\u5b9e\u9645\u4e0a\u4e5f\u5c31\u540c\u65f6\u6307\u5b9a\u4e86\u8be5\u53c2\u6570\u6240\u4f7f\u7528\u7684\u63a7\u4ef6\u7684\u7c7b\u578b\u3002
\u6bd4\u5982\uff0c\u5728\u4e0b\u9762\u7684\u4f8b\u5b50\u4e2d\uff0c\u51fd\u6570foo()
\u7684\u53c2\u6570a
\u3001b
\u3001c
\u867d\u7136\u6ca1\u6709\u901a\u8fc7\u7c7b\u578b\u6ce8\u89e3\u8bed\u6cd5\u6807\u6ce8\u7c7b\u578b\u4fe1\u606f\uff0c\u4f46\u7531\u4e8e\u5206\u522b\u4e3a\u5b83\u4eec\u6307\u5b9a\u4e86\u914d\u7f6e\u7c7b\u5bf9\u8c61\uff1aIntSpinBoxConfig
\u3001FloatSpinBoxConfig
\u3001BoolBoxConfig
\uff0c\u8fd9\u4f7f\u5f97PyGUIAdapter
\u4e5f\u80fd\u591f\u4e3a\u5176\u521b\u5efa\u5bf9\u5e94\u7684\u63a7\u4ef6\u2014\u2014\u53c2\u6570a
\u3001b
\u3001c
\u5c06\u5206\u522b\u4f7f\u7528IntSpinBox
\u3001FloatSpinBox
\u3001BoolBox
\u4f5c\u4e3a\u5176\u63a7\u4ef6\u3002
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.widgets import IntSpinBoxConfig, FloatSpinBoxConfig, BoolBoxConfig\n\n\ndef foo(a, b, c):\n pass\n\n\nconfigs = {\n \"a\": IntSpinBoxConfig(),\n \"b\": FloatSpinBoxConfig(),\n \"c\": BoolBoxConfig(),\n}\n\nadapter = GUIAdapter()\nadapter.add(foo, widget_configs=configs)\nadapter.run()\n
\u9664\u4e86\u5728\u4ee3\u7801\u91cc\u6307\u5b9a\u53c2\u6570\u7684\u63a7\u4ef6\u914d\u7f6e\uff0c\u4e5f\u53ef\u4ee5\u5229\u7528PyGUIAdapter
\u63d0\u4f9b\u4e86\u53e6\u4e00\u4e2a\u673a\u5236\u505a\u5230\u8fd9\u4e00\u70b9\uff1aPyGUIAdapter
\u5c06\u51fd\u6570\u6587\u6863\u5b57\u7b26\u4e32\uff08docstring\uff09\u4e2d@params
\u6807\u8bb0\u4e0e@end
\u6807\u8bb0\u4e4b\u95f4\u7684\u6587\u672c\u5757\u89c6\u4e3a\u8be5\u51fd\u6570\u7684\u63a7\u4ef6\u914d\u7f6e\u533a\uff0c\u5728\u8be5\u533a\u57df\u4e2d\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528TOML\u8bed\u6cd5\u914d\u7f6e\u51fd\u6570\u53c2\u6570\u7684\u63a7\u4ef6\u7c7b\u578b\u53ca\u5176\u5c5e\u6027\u3002
from pyguiadapter.adapter import GUIAdapter\n\ndef bar(a, b, c):\n \"\"\"\n bar\n @param a:\n @param b:\n @param c:\n @return:\n\n @params\n [a]\n widget_class = \"IntSpinBox\"\n\n [b]\n widget_class = \"FloatSpinBox\"\n\n [c]\n widget_class = \"BoolBox\"\n\n @end\n \"\"\"\n pass\n\nadapter = GUIAdapter()\nadapter.add(bar)\nadapter.run()\n
\u5982\u679c\u5f00\u53d1\u8005\u5728@params-@end
\u4e2d\u914d\u7f6e\u4e86\u53c2\u6570\u7684\u63a7\u4ef6\uff0c\u540c\u65f6\u53c8\u5411GUIAdapter.run()
\u4f20\u5165\u4e86widget_configs
\uff0c\u90a3\u4e48PyGUIAdapter
\u4f1a\u5c06\u4e24\u5904\u914d\u7f6e\u5408\u5e76\uff0c\u5bf9\u4e8e\u53d1\u751f\u51b2\u7a81\u7684\u5c5e\u6027\uff0c\u5c06\u4ee5widget_configs
\u4e2d\u8bbe\u7f6e\u7684\u4e3a\u51c6\u3002
"},{"location":"widget-config/#_4","title":"\u4e8c\u3001\u914d\u7f6e\u7684\u63a7\u4ef6\u5c5e\u6027","text":"\u63a7\u4ef6\u5c5e\u6027\u63a7\u5236\u7740\u63a7\u4ef6\u7684\u5916\u89c2\u548c\u884c\u4e3a\uff0c\u4e0d\u540c\u7c7b\u578b\u7684\u63a7\u4ef6\u65e2\u5171\u4eab\u90e8\u5206\u5171\u6709\u7684\u5c5e\u6027\uff0c\u4e5f\u62e5\u6709\u5404\u81ea\u4e13\u5c5e\u7684\u5c5e\u6027\u3002
\u4f8b\u5982\uff1a
- \u6240\u6709\u7c7b\u578b\u7684\u63a7\u4ef6
default_value
\u3001label
\u3001description
\u3001default_value_description
\u3001group
\u3001stylesheet
\u7b49\u5c5e\u6027\uff1b
IntSpinBox
\u989d\u5916\u5b9a\u4e49\u4e86min_value
\u3001display_integer_base
\u7b49\u5c5e\u6027\uff1b BoolBox
\u989d\u5916\u5b9a\u4e49\u4e86true_text
\u3001false_text
\u7b49\u5c5e\u6027\uff1b LineEdit
\u989d\u5916\u5177\u6709echo_mode
\u3001placeholder
\u7b49\u5c5e\u6027\uff1b - ......
\u63a7\u4ef6\u7684\u5c5e\u6027\u5b9a\u4e49\u5728\u63a7\u4ef6\u5bf9\u5e94\u7684\u914d\u7f6e\u7c7b\u4e2d\uff0c\u5176\u4e2d\uff0c\u516c\u5171\u5c5e\u6027\u6765\u81ea\u5171\u540c\u7684\u7236\u7c7b\uff08\u57fa\u7c7b\uff09BaseParameterWidgetConfig
\uff0c\u800c\u72ec\u6709\u5c5e\u6027\u5219\u5728\u5404\u914d\u7f6e\u7c7b\u5b50\u7c7b\u4e2d\u5b9a\u4e49\u3002
\u5bf9\u63a7\u4ef6\u5c5e\u6027\u8fdb\u884c\u914d\u7f6e\uff0c\u53ef\u4ee5\u5b9e\u73b0\u66f4\u52a0\u7cbe\u7ec6\u5316\u7684\u63a7\u5236\uff0c\u6bd4\u5982\uff1a\u8bbe\u7f6e\u6570\u5b57\u8f93\u5165\u7684\u4e0a\u4e0b\u9650\uff0c\u8bbe\u7f6e\u6587\u672c\u6846\u7684\u8f93\u5165\u63a9\u7801\u7b49\u7b49\u3002\u5f88\u591a\u65f6\u5019\uff0c\u5408\u9002\u7684\u914d\u7f6e\u4e0d\u4ec5\u53ef\u4ee5\u63d0\u9ad8\u7528\u6237\u4f53\u9a8c\uff0c\u8fd8\u53ef\u4ee5\u589e\u5f3a\u7a0b\u5e8f\u7684\u5065\u58ee\u6027\u3002
\u4e3a\u4ec0\u4e48\u5408\u7406\u914d\u7f6e\u63a7\u4ef6\u5c5e\u6027\u80fd\u589e\u5f3a\u7a0b\u5e8f\u7684\u5065\u58ee\u6027\uff1f
\u5176\u5b9e\u5f88\u597d\u7406\u89e3\uff0c\u5982\u679c\u80fd\u591f\u63d0\u524d\u5c06\u7528\u6237\u7684\u8f93\u5165\u503c\u9650\u5b9a\u5728\u67d0\u4e2a\u7279\u5b9a\u7684\u8303\u56f4\u5185\uff0c\u5c31\u53ef\u4ee5\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u907f\u514d\u51fa\u73b0\u90a3\u4e2a\u8457\u540d\u7684\u7a0b\u5e8f\u5458\u7b11\u8bdd\u91cc\u7684\u573a\u666f\uff1a\u201c\u4e00\u4e2a\u987e\u5ba2\u8d70\u8fdb\u4e00\u95f4\u9152\u5427\uff0c\u4e00\u5207\u90fd\u8fd0\u884c\u6b63\u5e38\uff0c\u76f4\u5230\u4ed6\u70b9\u4e86\u4e00\u4efd\u7092\u996d......\u201d\u3002
\u5728\u672c\u6587\u7684\u7b2c\u4e00\u90e8\u5206\u5176\u5b9e\u5df2\u7ecf\u6f14\u793a\u8fc7\u914d\u7f6e\u53c2\u6570\u63a7\u4ef6\u5c5e\u6027\u7684\u65b9\u6cd5\uff0c\u53ea\u4e0d\u8fc7\u5f53\u65f6\u8ba8\u8bba\u7684\u91cd\u5fc3\u662f\u5982\u4f55\u624b\u52a8\u6307\u5b9a\u53c2\u6570\u63a7\u4ef6\u7684\u7c7b\u578b\u3002\u4e0b\u9762\uff0c\u8ba9\u6211\u4eec\u805a\u7126\u53c2\u6570\u63a7\u4ef6\u5c5e\u6027\u7684\u914d\u7f6e\u3002
"},{"location":"widget-config/#_5","title":"\uff08\u4e00\uff09\u4f7f\u7528\u914d\u7f6e\u7c7b\u5bf9\u8c61\u914d\u7f6e\u63a7\u4ef6\u5c5e\u6027","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7\u5411GUIAdapter.run()
\u51fd\u6570\u4f20\u5165widget_configs
\u6765\u5b9e\u73b0\u63a7\u4ef6\u5c5e\u6027\u7684\u914d\u7f6e\u3002
"},{"location":"widget-config/#1","title":"1\u3001\u4f7f\u7528\u914d\u7f6e\u7c7b\u5bf9\u8c61","text":"\u5b9e\u9645\u4e0a\uff0c\u4f20\u5165\u914d\u7f6e\u7c7b\u5bf9\u8c61\u7684\u540c\u65f6\u4e5f\u6307\u5b9a\u4e86\u53c2\u6570\u63a7\u4ef6\u7684\u7c7b\u578b\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u53c2\u6570\u7684\u63a7\u4ef6\u5c06\u4e0d\u518d\u7531\u5176\u7c7b\u578b\u6ce8\u89e3\u51b3\u5b9a\u3002\u56e0\u6b64\uff0c\u5f00\u53d1\u8005\u5e94\u5f53\u6ce8\u610f\u907f\u514d\u51fd\u6570\u53c2\u6570\u7684\u7c7b\u578b\u6ce8\u89e3\u4e0e\u5176\u914d\u7f6e\u7c7b\u5bf9\u8c61\u4e0d\u517c\u5bb9\u7684\u60c5\u51b5\uff08\u8fd9\u79cd\u4e0d\u517c\u5bb9\u4e3b\u8981\u662f\u6307\u8bed\u4e49\u4e0a\u7684\u4e0d\u517c\u5bb9\uff0c\u6bd4\u5982\uff1a\u4e3a\u7c7b\u578b\u6807\u6ce8\u4e3aint
\u7684\u53c2\u6570\u6307\u5b9a\u4e00\u4e2aLineEditConfig
\u7c7b\u578b\u7684\u5bf9\u8c61\uff0c\u8fd9\u4f1a\u628a\u8be5\u53c2\u6570\u7684\u63a7\u4ef6\u53d8\u6210\u4e00\u4e2a\u8f93\u5165str
\u7684\u5355\u884c\u6587\u672c\u8f93\u5165\u6846\uff09\u3002
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.widgets import (\n IntSpinBoxConfig,\n SliderConfig,\n TextEditConfig,\n)\n\n\ndef foo(a: int, b: int, c: str = \"hello world!\"):\n pass\n\n\nfoo_configs = {\n \"a\": IntSpinBoxConfig(\n default_value=1,\n min_value=0,\n max_value=10,\n step=1,\n label=\"a\",\n description=\"parameter a\",\n ),\n \"b\": SliderConfig(\n default_value=50,\n min_value=0,\n max_value=100,\n label=\"b\",\n description=\"parameter b\",\n ),\n \"c\": TextEditConfig(\n default_value=\"Hello PyGUIAdapter!\",\n label=\"c\",\n description=\"parameter c\",\n ),\n }\n\nadapter = GUIAdapter()\nadapter.add(foo, widget_configs=foo_configs)\nadapter.run()\n
"},{"location":"widget-config/#2","title":"2\u3001\u4f7f\u7528\u914d\u7f6e\u9879\u5b57\u5178","text":"\u4f7f\u7528\u914d\u7f6e\u9879\u5b57\u5178\u4e0e\u4e0a\u4e00\u79cd\u65b9\u6cd5\u672c\u8d28\u4e0a\u662f\u7b49\u4ef7\u7684\uff0c\u53ea\u4e0d\u8fc7\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0cPyGUIAdapter
\u4f1a\u9996\u5148\u786e\u5b9a\u53c2\u6570\u63a7\u4ef6\u7684\u7c7b\u578b\uff08\u901a\u8fc7\u53c2\u6570\u7684\u7c7b\u578b\u6ce8\u89e3\uff09\uff0c\u7136\u540e\u83b7\u53d6\u5bf9\u5e94\u7684\u914d\u7f6e\u7c7b\uff0c\u6700\u540e\u7528\u914d\u7f6e\u9879\u5b57\u5178\u5b9e\u4f8b\u5316\u8be5\u914d\u7f6e\u7c7b\u5f97\u5230\u914d\u7f6e\u7c7b\u7684\u5bf9\u8c61\u3002
from pyguiadapter.adapter import GUIAdapter\n\ndef foo2(a: int, b: int, c: str = \"hello world!\"):\n pass\n\nfoo2_configs = {\n \"a\": {\n \"default_value\": 1,\n \"min_value\": 0,\n \"max_value\": 10,\n \"step\": 1,\n \"label\": \"a\",\n \"description\": \"parameter a\",\n },\n \"b\": {\n \"default_value\": 50,\n \"min_value\": 0,\n \"max_value\": 100,\n \"label\": \"b\",\n \"description\": \"parameter b\",\n },\n \"c\": {\n \"default_value\": \"Hello PyGUIAdapter!\",\n \"label\": \"c\",\n \"description\": \"parameter c\",\n },\n}\n\n\nadapter = GUIAdapter()\nadapter.add(foo2, widget_configs=foo2_configs)\nadapter.run()\n
"},{"location":"widget-config/#params-end","title":"\uff08\u4e8c\uff09\u5728@params-@end
\u5757\u4e2d\u914d\u7f6e\u63a7\u4ef6\u5c5e\u6027","text":"\u524d\u6587\u63d0\u8fc7\uff0cPyGUIAdapter
\u5c06\u51fd\u6570\u6587\u6863\u5b57\u7b26\u4e32\uff08docstring\uff09\u4e2d@params
\u6807\u8bb0\u4e0e@end
\u6807\u8bb0\u4e4b\u95f4\u7684\u6587\u672c\u5757\u89c6\u4e3a\u8be5\u51fd\u6570\u7684\u63a7\u4ef6\u914d\u7f6e\u533a\uff0c\u5728\u8be5\u533a\u57df\u4e2d\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528TOML\u8bed\u6cd5\u914d\u7f6e\u8be5\u51fd\u6570\u7684\u53c2\u6570\u63a7\u4ef6\u7c7b\u578b\u53ca\u5176\u5c5e\u6027\u3002
\u5f00\u53d1\u8005\u53ef\u4ee5\u5728@params-@end
\u5757\u4e2d\u540c\u65f6\u6307\u5b9a\u53c2\u6570\u7684\u63a7\u4ef6\u7c7b\u578b\u53ca\u5176\u5c5e\u6027\uff1a
from pyguiadapter.adapter import GUIAdapter\n\n\ndef foo(a: int, b: int, c: str = \"hello world!\"):\n \"\"\"\n foo\n @params\n [a]\n widget_class=\"IntSpinBox\"\n default_value=1\n min_value=0\n max_value=10\n step=1\n label=\"a\"\n description=\"parameter a\"\n\n [b]\n widget_class=\"Slider\"\n default_value=50\n min_value=0\n max_value=100\n label=\"b\"\n description=\"parameter b\"\n\n [c]\n widget_class=\"TextEdit\"\n default_value=\"Hello PyGUIAdapter!\"\n label=\"c\"\n description=\"parameter c\"\n @end\n \"\"\"\n\n\nadapter = GUIAdapter()\nadapter.add(foo)\nadapter.run()\n
\u4e5f\u53ef\u4ee5\u4ec5\u6307\u5b9a\u63a7\u4ef6\u7684\u5c5e\u6027\uff0c\u5c06\u63a7\u4ef6\u7684\u7c7b\u578b\u4ea4\u7531\u7c7b\u578b\u6ce8\u89e3\u51b3\u5b9a\uff1a
from pyguiadapter.adapter import GUIAdapter\n\ndef foo(a: int, b: int, c: str = \"hello world!\"):\n \"\"\"\n @params\n [a]\n default_value=1\n min_value=0\n max_value=10\n step=1\n label=\"a\"\n description=\"parameter a\"\n\n [b]\n default_value=50\n min_value=0\n max_value=100\n label=\"b\"\n description=\"parameter b\"\n\n [c]\n default_value=\"Hello PyGUIAdapter!\"\n label=\"c\"\n description=\"parameter c\"\n @end\n \"\"\"\n\n\nadapter = GUIAdapter()\nadapter.add(foo)\nadapter.run()\n
"},{"location":"widget-config/#_6","title":"\uff08\u4e09\uff09\u7279\u6b8a\u63a7\u4ef6\u5c5e\u6027","text":"\u6709\u51e0\u4e2a\u7279\u6b8a\u7684\u63a7\u4ef6\u5c5e\u6027\uff0c\u82e5\u5f00\u53d1\u8005\u672a\u5bf9\u8fd9\u4e9b\u5c5e\u6027\u8fdb\u884c\u914d\u7f6e\uff0cPyGUIAdapter
\u5c06\u5c1d\u8bd5\u4ece\u5176\u4ed6\u5730\u65b9\u83b7\u53d6\u5408\u9002\u7684\u503c\u3002
"},{"location":"widget-config/#1label","title":"1\u3001label","text":"\u5982\u679c\u5f00\u53d1\u8005\u672a\u6307\u5b9a\u63a7\u4ef6\u7684label
\uff0c\u5219PyGUIAdapter
\u5c06\u4f7f\u7528\u53c2\u6570\u7684\u540d\u79f0\u4f5c\u4e3a\u5176label
\u3002
from pyguiadapter.adapter import GUIAdapter\n\n\ndef foo(a: int, b: int):\n \"\"\"\n @params\n [b]\n label = \"Parameter b\"\n @end\n \"\"\"\n pass\n\nadapter = GUIAdapter()\nadapter.add(foo)\nadapter.run()\n
"},{"location":"widget-config/#2default_value","title":"2\u3001default_value","text":"\u5982\u679c\u5f00\u53d1\u8005\u672a\u6307\u5b9a\u63a7\u4ef6\u7684default_value
\u5c5e\u6027\uff0c\u90a3\u4e48PyGUIAdapter
\u5c06\u5c1d\u8bd5\u4ece\u51fd\u6570\u7b7e\u540d\u4e2d\u83b7\u53d6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u4f5c\u4e3adefault_value
\u5c5e\u6027\u7684\u503c
from pyguiadapter.adapter import GUIAdapter\n\n\ndef foo(a: int = -100, b: int = 1 + 1):\n pass\n\n\nadapter = GUIAdapter()\nadapter.add(foo)\nadapter.run()\n
"},{"location":"widget-config/#3description","title":"3\u3001description","text":"\u5982\u679c\u5f00\u53d1\u8005\u672a\u6307\u5b9a\u63a7\u4ef6\u7684description
\u5c5e\u6027\uff0c\u90a3\u4e48PyGUIAdapter
\u5c06\u5c1d\u8bd5\u4ece\u51fd\u6570\u7684\u6587\u6863\u5b57\u7b26\u4e32\uff08docstring\uff09\u4e2d\u83b7\u53d6\u53c2\u6570\u7684\u63cf\u8ff0\u4fe1\u606f\u4f5c\u4e3adescription
\u5c5e\u6027\u7684\u503c\u3002
\u652f\u6301\u591a\u79cd\u98ce\u683c\u7684docstring\uff0c\u5305\u62ec\uff1a ReST\u3001Google\u3001Numpydoc-style \u3001Epydoc
from pyguiadapter.adapter import GUIAdapter\n\n\ndef foo(a: int = -100, b: int = 1 + 1):\n \"\"\"\n @param a: this is parameter a\n @param b: this is parameter b\n @return:\n \"\"\"\n\n\nadapter = GUIAdapter()\nadapter.add(foo)\nadapter.run()\n
"},{"location":"widget-config/#_7","title":"\u4e09\u3001\u603b\u7ed3","text":"PyGUIAdapter
\u5185\u7f6e\u4e86\u4e30\u5bcc\u7684\u53c2\u6570\u63a7\u4ef6\uff0c\u5e76\u4e14\u5efa\u7acb\u4e86\u4e00\u79cd\u7b80\u5355\u4ece\u6570\u636e\u7c7b\u578b\u5230\u63a7\u4ef6\u7c7b\u578b\u6620\u5c04\u673a\u5236\u3002\u5f00\u53d1\u8005\u53ea\u9700\u4f7f\u7528\u7c7b\u578b\u6807\u6ce8\u8bed\u6cd5\u4e3a\u51fd\u6570\u53c2\u6570\u6807\u6ce8\u6b63\u786e\u7684\u7c7b\u578b\uff0cPyGUIAdapter
\u5c31\u80fd\u81ea\u52a8\u4e3a\u5176\u751f\u6210\u5408\u9002\u7684\u8f93\u5165\u63a7\u4ef6\u3002
\u4e0e\u6b64\u540c\u65f6\uff0cPyGUIAdapter
\u5145\u5206\u8003\u8651\u5230\u4e86\u5f00\u53d1\u8005\u7684\u81ea\u5b9a\u4e49\u9700\u6c42\uff0c\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u591a\u79cd\u914d\u7f6e\u63a7\u4ef6\u5c5e\u6027\u7684\u673a\u5236\u3002\u901a\u8fc7\u5bf9\u53c2\u6570\u63a7\u4ef6\u7684\u5408\u7406\u914d\u7f6e\uff0c\u5f00\u53d1\u8005\u4e0d\u4ec5\u53ef\u4ee5\u6784\u5efa\u7528\u6237\u4f53\u9a8c\u66f4\u52a0\u53cb\u597d\u7684GUI\u5e94\u7528\u7a0b\u5e8f\uff0c\u800c\u4e14\u53ef\u4ee5\u589e\u5f3a\u7a0b\u5e8f\u7684\u5065\u58ee\u6027\u3002
"},{"location":"widget-map/","title":"\u63a7\u4ef6\u7c7b\u578b\u6620\u5c04\u8868","text":""},{"location":"widget-map/#_1","title":"\u5185\u7f6e\u53c2\u6570\u63a7\u4ef6\u4e00\u89c8","text":""},{"location":"widget-map/#python","title":"\uff08\u4e00\uff09Python\u5185\u7f6e\u7c7b\u578b\u7684\u9ed8\u8ba4\u63a7\u4ef6","text":"\u63a7\u4ef6\u7c7b\u578b \u63a7\u4ef6\u914d\u7f6e\u7c7b\u578b \u5bf9\u5e94\u53c2\u6570\u7c7b\u578b \u8bf4\u660e \u5916\u89c2 IntSpinBox
IntSpinBoxConfig
int
\u7528\u4e8e\u8f93\u5165int
\u7c7b\u578b\u6570\u636e\u3002 FloatSpinBox
FloatSpinBoxConfig
float
\u7528\u4e8e\u8f93\u5165float
\u7c7b\u578b\u6570\u636e\u3002 BoolBox
BoolBoxConfig
bool
\u7528\u4e8e\u8f93\u5165bool
\u7c7b\u578b\u6570\u636e\u3002 LineEdit
LineEditConfig
str
\u7528\u4e8e\u8f93\u5165str
\u7c7b\u578b\u6570\u636e\u3002 DictEdit
DictEditConfig
dict
\u3001typing.Dict
\u3001Mapping
\u3001MutableMapping
\u7528\u4e8e\u5b57\u5178\u7c7b\u578b\u6570\u636e\u7684\u8f93\u5165\u3002 ListEdit
ListEditConfig
list
\u3001typing.List
\u7528\u4e8e\u5217\u8868\u7c7b\u578b\u6570\u636e\u7684\u8f93\u5165\u3002 TupleEdit
TupleEditConfig
tuple
\u3001typing.Tuple
\u7528\u4e8e\u5143\u7ec4\u7c7b\u578b\u6570\u636e\u7684\u8f93\u5165\u3002 SetEdit
SetEditConfig
set
\u3001typing.Set
\u3001MutableSet
\u7528\u4e8e\u96c6\u5408\u7c7b\u578b\u6570\u636e\u7684\u8f93\u5165\u3002 DateEdit
DateEditConfig
date
\u8be5\u63a7\u4ef6\u7528\u4e8e\u8f93\u5165\u65e5\u671f\uff0c\u662fpython\u5185\u7f6edatetime.date
\u7c7b\u578b\u53c2\u6570\u7684\u9ed8\u8ba4\u8f93\u5165\u63a7\u4ef6\u3002 TimeEdit
TimeEditConfig
time
\u8be5\u63a7\u4ef6\u7528\u4e8e\u8f93\u5165\u65e5\u671f\uff0c\u662fpython\u5185\u7f6edatetime.time
\u7c7b\u578b\u53c2\u6570\u7684\u9ed8\u8ba4\u8f93\u5165\u63a7\u4ef6\u3002 DateTimeEdit
DateTimeEditConfig
datetime
\u8be5\u63a7\u4ef6\u7528\u4e8e\u8f93\u5165\u65e5\u671f\u65f6\u95f4\uff0c\u662fpython\u5185\u7f6edatetime.datetime
\u7c7b\u578b\u53c2\u6570\u7684\u9ed8\u8ba4\u8f93\u5165\u63a7\u4ef6\u3002 ExclusiveChoiceBox
ExclusiveChoiceBoxConfig
typing.Literal
\u7528\u4e8e\u4ece\u4e00\u7ec4\u9009\u9879\u4e2d\u9009\u62e9\u4e00\u4e2a\u9009\u9879\uff0c\u662ftyping.Literal
\u7c7b\u578b\u7684\u9ed8\u8ba4\u63a7\u4ef6\uff0c\u53ef\u4ee5\u81ea\u52a8\u63d0\u53d6Literal
\u6240\u6709\u7ed9\u5b9a\u7684\u5b57\u9762\u91cf\u5e76\u5c06\u5176\u4f5c\u4e3a\u53ef\u9009\u9879\u3002 PyLiteralEdit
PyLiteralEditConfig
typing.Any
\u3001object
\u3001Union[str,bytes,bool,int,float,list,tuple,set,dict,None]
PyLiteralEdit
\u4e3b\u8981\u7528\u4e8ePython\u5b57\u9762\u91cf\u7684\u8f93\u5165\uff0c\u662fAny
\u3001object
\u3001Union
\u7b49\u7c7b\u578b\u53c2\u6570\u7684\u9ed8\u8ba4\u8f93\u5165\u63a7\u4ef6\u3002 Python\u5b57\u9762\u91cf
\u662f\u6307ast.eval_literal()
\u652f\u6301\u7684\u4efb\u610fPython\u5b57\u9762\u91cf\uff0c\u5305\u62ec\uff1a\u5b57\u7b26\u4e32\u3001\u5b57\u8282\u5bf9\u8c61\u3001\u6570\u503c\u3001\u5143\u7ec4\u3001\u5217\u8868\u3001\u5b57\u5178\u3001\u96c6\u5408\u3001\u5e03\u5c14\u503c\u7b49\u3002 EnumSelect
EnumSelectConfig
enum.Enum
\u7528\u4e8eEnum
\uff08\u679a\u4e3e\u7c7b\u578b\uff09\u503c\u7684\u8f93\u5165"},{"location":"widget-map/#_2","title":"\uff08\u4e8c\uff09\u8bed\u4e49\u5316\u7c7b\u578b\uff08\u6269\u5c55\u7c7b\u578b\uff09\u53ca\u5176\u63a7\u4ef6","text":"\u8bed\u4e49\u5316\u7c7b\u578b
\u662f\u4ece\u5185\u7f6e\u7c7b\u578b\u4e2d\u6269\u5c55\u800c\u6765\u7684\u7c7b\u578b\uff0c\u5f88\u591a\u65f6\u5019\uff0c\u53ef\u4ee5\u770b\u4f5c\u662f\u5bf9\u5e94\u5185\u7f6e\u7c7b\u578b\u7684\u201c\u522b\u540d\u201d
\uff0c\u5728\u4f7f\u7528\u4e0a\u4e0e\u5bf9\u5e94\u5185\u7f6e\u7c7b\u578b\u6ca1\u6709\u533a\u522b\u3002
\u8bed\u4e49\u5316\u7c7b\u578b\uff08\u6269\u5c55\u7c7b\u578b\uff09\u7684\u4e3b\u8981\u4f5c\u7528\u5728\u4e8e\uff0c\u63d0\u4f9b\u533a\u522b\u4e8e\u5bf9\u5e94\u5185\u7f6e\u7c7b\u578b\u9ed8\u8ba4\u63a7\u4ef6\u7684\u4e13\u7528\u63a7\u4ef6\uff0c\u4ee5\u6ee1\u8db3\u7279\u5b9a\u573a\u666f\u4e0b\u7684\u8f93\u5165\u9700\u6c42\u3002\u6bd4\u5982int_slider_t
\u662fint
\u7c7b\u578b\u7684\u8bed\u4e49\u5316\u7c7b\u578b\uff08\u6269\u5c55\u7c7b\u578b\uff09\uff0c\u5728\u4f7f\u7528\u4e0a\u4e0eint
\u7c7b\u578b\u4e00\u81f4\uff0c\u4f46\u5b83\u5bf9\u5e94\u7684\u8f93\u5165\u63a7\u4ef6\u662f\u4e00\u4e2aSlider
\uff08\u6ed1\u52a8\u6761\uff09\uff0c\u800c\u4e0d\u662f\u4e00\u4e2aSpinBox
\u3002
\u901a\u8fc7\u5408\u7406\u4f7f\u7528\u8bed\u4e49\u5316\u7c7b\u578b\uff08\u6269\u5c55\u7c7b\u578b\uff09\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u6784\u5efa\u51fa\u754c\u9762\u66f4\u52a0\u4e30\u5bcc\uff0c\u7528\u6237\u4ea4\u4e92\u4f53\u9a8c\u66f4\u52a0\u826f\u597d\u7684\u5e94\u7528\u7a0b\u5e8f\u3002\u4ee5\u4e0b\u662fPyGUIAdapter
\u63d0\u4f9b\u7684\u8bed\u4e49\u5316\u7c7b\u578b\uff08\u6269\u5c55\u7c7b\u578b\uff09\u53ca\u5176\u5bf9\u5e94\u7684\u63a7\u4ef6\u3002
\u6240\u6709\u7684\u8bed\u4e49\u5316\u7c7b\u578b\uff08\u6269\u5c55\u7c7b\u578b\uff09\u5747\u5728pyguiadapter.extend_types
\u6a21\u5757\u4e2d\u5b9a\u4e49\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u5bfc\u5165\uff1a
from pyguiadapter.extend_types import TYPE_NAME\n
\u5176\u4e2d\uff0cTYPE_NAME
\u662f\u9700\u8981\u5bfc\u5165\u7684\u7c7b\u578b\u540d\u79f0\u3002\u6bd4\u5982\uff0c\u5bf9\u4e8eint_slider_t
\uff0c\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u65b9\u5f0f\u5bfc\u5165\uff1a
from pyguiadapter.extend_types import int_slider_t\n
\u63a7\u4ef6\u7c7b\u578b \u63a7\u4ef6\u914d\u7f6e\u7c7b\u578b \u5bf9\u5e94\u6570\u636e\u7c7b\u578b \u8bf4\u660e \u5916\u89c2 IntLineEdit
IntLineEditConfig
int_t
int_t
\u6269\u5c55\u81eaint
\uff0c\u53ef\u4ee5\u770b\u4f5c\u662fint
\u7c7b\u578b\u7684\u522b\u540d\u3002PyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5355\u884c\u6587\u672c\u8f93\u5165\u6846\u6837\u5f0f\u7684\u8f93\u5165\u7ec4\u4ef6\uff0c\u4f46\u4e8e\u4e0e\u4e00\u822c\u5355\u884c\u6587\u672c\u8f93\u5165\u6846\uff0c\u8be5\u7c7b\u578b\u7684\u8f93\u5165\u7ec4\u4ef6\u53ea\u5141\u8bb8\u7528\u6237\u8f93\u5165\u6574\u6570\u6587\u672c\u3002 FloatLineEdit
FloatLineEditConfig
float_t
float_t
\u6269\u5c55\u81eafloat
\uff0c\u53ef\u4ee5\u770b\u4f5c\u662ffloat
\u7c7b\u578b\u7684\u522b\u540d\u3002PyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5355\u884c\u6587\u672c\u8f93\u5165\u6846\u6837\u5f0f\u7684\u8f93\u5165\u7ec4\u4ef6\uff0c\u4f46\u4e8e\u4e0e\u4e00\u822c\u5355\u884c\u6587\u672c\u8f93\u5165\u6846\u6807\u9898\uff0c\u8be5\u7c7b\u578b\u7684\u8f93\u5165\u7ec4\u4ef6\u53ea\u5141\u8bb8\u7528\u6237\u8f93\u5165\u6d6e\u70b9\u6570\u6587\u672c\u3002 TextEdit
TextEditConfig
text_t
text_t
\u6269\u5c55\u81eastr
\uff0c\u53ef\u4ee5\u770b\u4f5c\u662fstr
\u7c7b\u578b\u7684\u522b\u540d\u3002PyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u4e00\u4e2a\u591a\u884c\u6587\u672c\u8f93\u5165\u6846\uff0c\u5141\u8bb8\u7528\u6237\u8f93\u5165\u591a\u884c\u6587\u672c\u3002 Slider
SliderConfig
int_slider_t
int_slider_t
\u6269\u5c55\u81eaint
\uff0c\u53ef\u4ee5\u770b\u4f5c\u662fint
\u7c7b\u578b\u7684\u522b\u540d\u3002\u4e0e\u5176\u4ed6int
\u4e0d\u540c\uff0cPyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u6ed1\u52a8\u6761\u5f62\u5f0f\u7684\u8f93\u5165\u63a7\u4ef6\u3002 Dial
DialConfig
int_dial_t
int_dial_t
\u6269\u5c55\u81eaint
\uff0c\u53ef\u4ee5\u770b\u4f5c\u662fint
\u7c7b\u578b\u7684\u522b\u540d\u3002\u4e0e\u5176\u4ed6int
\u4e0d\u540c\uff0cPyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u523b\u5ea6\u76d8\u5f62\u5f0f\u7684\u8f93\u5165\u63a7\u4ef6\u3002 ColorPicker
ColorPickerConfig
color_t\u3001color_hex_t\u3001color_tuple_t
color_t
\u6269\u5c55\u81eaobject
\uff0c\u4ee3\u8868\u989c\u8272\u7c7b\u578b\u7684\u6570\u636e\uff0c\u5b9e\u9645\u652f\u6301\u7684\u7c7b\u578b\u5305\u62ectuple
\uff083\u5143\u7d20\u62164\u5143\u7d20\u5143\u7ec4\uff09\u3001str
\u3001QColor
\uff0c\u53d1\u8005\u53ef\u4ee5\u9009\u62e9\u989c\u8272\u7684\u8868\u793a\u65b9\u5f0f\u3002PyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u4e00\u4e2a\u989c\u8272\u9009\u62e9\u5668\u3002 ChoiceBox
ChoiceBoxConfig
choice_t
\u8be5\u7c7b\u578b\u6269\u5c55\u81eaobject
\uff0cPyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u4e00\u4e2a\u4e0b\u62c9\u9009\u62e9\u6846\uff0c\u7528\u6237\u53ef\u4ee5\u4ece\u4e00\u7ec4\u9009\u9879\u4e2d\u9009\u62e9\u5176\u4e2d\u4e00\u4e2a\u3002 MultiChoiceBox
MultiChoiceBoxConfig
choices_t
\u8be5\u7c7b\u578b\u6269\u5c55\u81ealist
\uff0c\u7528\u4e8e\u4ece\u4e00\u7ec4\u5bf9\u8c61\u4e2d\u9009\u62e9\u591a\u4e2a\u5bf9\u8c61\u3002 KeySequenceEdit
KeySequenceEditConfig
key_sequence_t
key_sequence_t
\u6269\u5c55\u81eastr
\uff0c\u4ee3\u8868\u5feb\u6377\u952e\u3002 PlainDictEdit
PlainDictEditConfig
plain_dict_t
plain_dict_t
\u7c7b\u578b\u6269\u5c55\u81eadict
\uff0c\u7528\u4e8eDict[key, int|bool|float|str|list|dict]
\u7c7b\u578b\u6570\u636e\u7684\u8f93\u5165\u3002 StringListEdit
StringListEditConfig
string_list_t
string_list_t
\u6269\u5c55\u81ealist
\uff0c\u7528\u4e8eList[str]
\u7c7b\u578b\u6570\u636e\u7684\u8f93\u5165\u3002 JsonEdit
JsonEditConfig
json_obj_t
json_obj_t
\u6269\u5c55\u81eaobject
\uff0c\u7528\u4e8ejson\u7c7b\u578b\u6570\u636e\u7684\u8f93\u5165\u3002\u7528\u6237\u5728\u63a7\u4ef6\u4e0a\u8f93\u5165\u7684\u6587\u672c\u5c06\u901a\u8fc7json.loads
\u8f6c\u6362\u4e3a\u5bf9\u5e94\u7684Python\u5bf9\u8c61\u3002 DirSelect
DirSelectConfig
directory_t
\u3001dir_t
directory_t
\u6269\u5c55\u81eastr
\uff0c\u4ee3\u8868\u4e00\u4e2a\u76ee\u5f55\u8def\u5f84\uff0cPyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6587\u4ef6\u9009\u62e9\u5bf9\u8bdd\u6846\u7528\u4e8e\u9009\u62e9\u76ee\u5f55\u3002 FileSelect
FileSelectConfig
file_t
file
\u6269\u5c55\u81eastr
\uff0c\u4ee3\u8868\u4e00\u4e2a\u6587\u4ef6\u8def\u5f84\uff0cPyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6587\u4ef6\u9009\u62e9\u5bf9\u8bdd\u6846\u7528\u4e8e\u9009\u62e9\u6587\u4ef6\u3002 MultiFileSelect
MultiFileSelectConfig
files_t
files
\u6269\u5c55\u81ealist
\uff0c\u4ee3\u8868\u4e00\u7ec4\u6587\u4ef6\u8def\u5f84\uff0cPyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6587\u4ef6\u9009\u62e9\u5bf9\u8bdd\u6846\u7528\u4e8e\u9009\u62e9\u591a\u4e2a\u6587\u4ef6\u3002 PathListEdit
PathListEditConfig
path_list_t
List[str]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u8def\u5f84\u5217\u8868\uff0c\u652f\u6301\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u548c\u6587\u4ef6\u5939\u8def\u5f84\u3002 FileListEdit
FileListEditConfig
file_list_t
List[str]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u8def\u5f84\u5217\u8868\uff0c\u652f\u6301\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u3002 DirectoryListEdit
DirectoryListEditConfig
dir_list_t
List[str]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u8def\u5f84\u5217\u8868\uff0c\u652f\u6301\u6dfb\u52a0\u6587\u4ef6\u5939\u8def\u5f84\u3002 FontSelect
FontSelectConfig
font_t
str
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u5b57\u4f53\u540d\u79f0\uff0c\u63d0\u4f9b\u4e0b\u62c9\u6846\u4f9b\u7528\u6237\u9009\u62e9\u5f53\u524d\u7cfb\u7edf\u5df2\u5b89\u88c5\u5b57\u4f53\u3002 IntQuantityBox
IntQuantityBoxConfig
int_quantity_t
tuple
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u5177\u4f53\u4e3a\u4e00\u4e2a\u4e8c\u5143\u7d20\u5143\u7ec4Tuple[int, str |None]
\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u6574\u6570\u578b\u7684\u6570\u91cf
\uff08\u6240\u8c13\u6570\u91cf\u5373\u5e26\u5355\u4f4d\u7684\u91cf\uff09\uff0c\u7b2c\u4e00\u4e2a\u5143\u7d20\u4e3a\u6570\u91cf\u7684\u503c\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20\u4e3a\u6570\u91cf\u7684\u5355\u4f4d\u3002\u5b9e\u73b0\u4e86\u4e13\u95e8\u7684\u8f93\u5165\u63a7\u4ef6\uff0c\u5141\u8bb8\u7528\u6237\u8f93\u5165\u6570\u91cf\u7684\u503c\u548c\u9009\u62e9\u6570\u91cf\u7684\u5355\u4f4d\u3002 FloatQuantityBox
FloatQuantityBoxConfig
float_quantity_t
tuple
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u5177\u4f53\u4e3a\u4e00\u4e2a\u4e8c\u5143\u7d20\u5143\u7ec4Tuple[float, str |None]
\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u6d6e\u70b9\u578b\u7684\u6570\u91cf
\uff08\u6240\u8c13\u6570\u91cf\u5373\u5e26\u5355\u4f4d\u7684\u91cf\uff09\uff0c\u7b2c\u4e00\u4e2a\u5143\u7d20\u4e3a\u6570\u91cf\u7684\u503c\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20\u4e3a\u6570\u91cf\u7684\u5355\u4f4d\u3002\u5b9e\u73b0\u4e86\u4e13\u95e8\u7684\u8f93\u5165\u63a7\u4ef6\uff0c\u5141\u8bb8\u7528\u6237\u8f93\u5165\u6570\u91cf\u7684\u503c\u548c\u9009\u62e9\u6570\u91cf\u7684\u5355\u4f4d\u3002 PathsEditor
PathsEditorConfig
paths_t
List[str]
\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u8868\u793a\u4e00\u7ec4\u8def\u5f84\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u529f\u80fd\u4e30\u5bcc\u7684\u5916\u7f6e\u8def\u5f84\u7f16\u8f91\u5668\uff0c\u901a\u8fc7\u8be5\u7f16\u8f91\u5668\uff0c\u7528\u6237\u53ef\u4ee5\u65b9\u4fbf\u5730\u7ba1\u7406\u4e00\u7ec4\u8def\u5f84\uff0c\u5305\u62ec\u6dfb\u52a0\u3001\u5220\u9664\u4ee5\u53ca\u6539\u53d8\u8def\u5f84\u7684\u987a\u5e8f\u3002"},{"location":"window/","title":"\u914d\u7f6e\u7a97\u53e3\u5c5e\u6027","text":""},{"location":"window/#_1","title":"\uff08\u4e00\uff09\u7a97\u53e3\u6982\u8ff0","text":"PyGUIAdapter
\u4e2d\u4e3b\u8981\u6709\u4e24\u79cd\u7c7b\u578b\u7684\u7a97\u53e3\uff1a\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\u548c\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow\uff09
\uff0c\u5b83\u4eec\u90fd\u7ee7\u627f\u81ea\u7a97\u53e3\u7236\u7c7bBaseWindow
\u3002BaseWindow
\u5b9a\u4e49\u4e86\u5b50\u7c7b\u7a97\u53e3\u7684\u5171\u540c\u884c\u4e3a\uff0c\u6bd4\u5982\uff1a
- \u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528
\u7a97\u53e3\u914d\u7f6e\u7c7b
\u914d\u7f6e\u7a97\u53e3\u7684\u67d0\u4e9b\u5c5e\u6027 - \u5f00\u53d1\u8005\u53ef\u4ee5\u5411\u7a97\u53e3\u4e2d\u6dfb\u52a0\u5de5\u5177\u680f\u548c\u83dc\u5355\u680f
- \u5f00\u53d1\u8005\u53ef\u4ee5\u76d1\u542c\u7a97\u53e3\u7684\u67d0\u4e9b\u4e8b\u4ef6
- \u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u7a97\u53e3\u4e8b\u4ef6\u56de\u8c03\u4e2d\u83b7\u53d6/\u6539\u53d8\u6dfb\u52a0\u5230\u5de5\u5177\u680f\uff08\u83dc\u5355\u680f\uff09\u4e2d\u7684
\u52a8\u4f5c\uff08Action\uff09
\u7684\u72b6\u6001 - ......
"},{"location":"window/#1","title":"1\u3001\u7a97\u53e3\u7684\u57fa\u672c\u63a5\u53e3","text":"\u540c\u65f6\uff0c BaseWindow
\u4e2d\u5b9a\u4e49\u5e76\u5b9e\u73b0\u4e86\u4e00\u7ec4\u57fa\u672c\u63a5\u53e3\uff0c\u8fd9\u4e9b\u63a5\u53e3\u53ef\u4ee5\u5bf9\u7a97\u53e3\u8fdb\u884c\u64cd\u4f5c\u6216\u8005\u662f\u5b9e\u73b0\u4e86\u5176\u4ed6\u6709\u7528\u7684\u529f\u80fd\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u52a8\u4f5c\uff08Action\uff09
\u6216\u7a97\u53e3\u4e8b\u4ef6\u7684\u56de\u8c03\u51fd\u6570\u4e2d\u8c03\u7528\u8fd9\u4e9b\u63a5\u53e3\u3002\u53ef\u4ee5\u53c2\u8003\u8fd9\u4e2a\u6587\u6863pyguiadapter.window.BaseWindow
\u4ee5\u83b7\u53d6\u8fd9\u4e9b\u63a5\u53e3\u7684\u8be6\u7ec6\u4fe1\u606f\u3002
"},{"location":"window/#2","title":"2\u3001\u7a97\u53e3\u7684\u5171\u540c\u5c5e\u6027","text":"\u7a97\u53e3\u7684\u5c5e\u6027\uff0c\u5982\u6807\u9898\u3001\u56fe\u6807\u3001\u5927\u5c0f\u3001\u4f4d\u7f6e\u3001\u5b57\u4f53\u3001\u6837\u5f0f\u7b49\uff0c\u5747\u7531\u7a97\u53e3\u7684\u914d\u7f6e\u7c7b\u5b9a\u4e49\uff0cBaseWindowConfig
\u662f\u6240\u6709\u7a97\u53e3\u914d\u7f6e\u7c7b\u7684\u7236\u7c7b\uff0c\u5b9a\u4e49\u4e86\u4e00\u7ec4\u6240\u6709\u7a97\u53e3\u5747\u9002\u7528\u7684\u5171\u540c\u5c5e\u6027\uff0c\u53ef\u4ee5\u53c2\u8003\u8fd9\u4e2a\u6587\u6863pyguiadapter.window.BaseWindowConfig
\u4ee5\u83b7\u53d6\u8fd9\u4e9b\u5c5e\u6027\u7684\u8be6\u7ec6\u4fe1\u606f\u3002
BaseWindow
\u7684\u5b50\u7c7b\u7a97\u53e3\u901a\u5e38\u7ee7\u627fBaseWindowConfig
\u5b9e\u73b0\u4e13\u7528\u7684\u7a97\u53e3\u914d\u7f6e\u7c7b\uff0c\u5e76\u8986\u76d6BaseWindowConfig
\u4e2d\u67d0\u4e9b\u5c5e\u6027\u7684\u9ed8\u8ba4\u503c\u6216\u6dfb\u52a0\u4e13\u95e8\u9002\u7528\u4e8e\u5b50\u7c7b\u7a97\u53e3\u7684\u65b0\u5c5e\u6027\u3002
"},{"location":"window/#3","title":"3\u3001\u7a97\u53e3\u4e8b\u4ef6\u76d1\u542c","text":"\u7a97\u53e3\u7684\u521b\u5efa\u3001\u663e\u793a\u3001\u5173\u95ed\u3001\u9500\u6bc1\u3001\u9690\u85cf\u5747\u88ab\u89c6\u4e3a\u4e00\u79cd\u4e8b\u4ef6\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u76d1\u542c\u8fd9\u4e9b\u4e8b\u4ef6\uff0c\u5e76\u5728\u8fd9\u4e9b\u4e8b\u4ef6\u53d1\u751f\u65f6\u6267\u884c\u7279\u5b9a\u7684\u4ee3\u7801\u3002\u5bf9\u7a97\u53e3\u4e8b\u4ef6\u7684\u76d1\u542c\uff0c\u9700\u8981\u901a\u8fc7BaseWindowEventListener
\u5bf9\u8c61\u6765\u5b8c\u6210\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5b50\u7c7b\u5316\u8be5\u7c7b\uff0c\u6216\u8005\u4f7f\u7528\u4e00\u4e2a\u5b83\u7684\u4e00\u4e2a\u73b0\u6210\u5b50\u7c7bSimpleWindowEventListener
\u3002
\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\u83b7\u53d6\u7a97\u53e3\u4e8b\u4ef6\u76d1\u542c\u5668\u7684\u8be6\u7ec6\u4fe1\u606f\uff1a
pyguiadapter.window.BaseWindowEventListener
pyguiadapter.window.SimpleWindowEventListener
"},{"location":"window/#fnselectwindow","title":"\uff08\u4e8c\uff09\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09","text":""},{"location":"window/#1_1","title":"1\u3001\u6982\u8ff0","text":"\u5728\u5411GUIAdapter
\u5b9e\u4f8b\u4e2d\u6dfb\u52a0\u4e86\u591a\u4e2a\u51fd\u6570\u540e\uff0cPyGUIAdapter
\u5c06\u521b\u5efa\u4e00\u4e2a\u51fd\u6570\u9009\u62e9\u7a97\u53e3
\uff0c\u8be5\u7a97\u53e3\u4f1a\u663e\u793a\u6240\u6709\u5df2\u6dfb\u52a0\u7684\u51fd\u6570\u3002\u5728\u4ec5\u6dfb\u52a0\u4e86\u4e00\u4e2a\u51fd\u6570\u65f6\uff0c\u51fd\u6570\u9009\u62e9\u7a97\u53e3
\u5c06\u4e0d\u4f1a\u663e\u793a\uff0c\u800c\u662f\u76f4\u63a5\u663e\u793a\u8be5\u51fd\u6570\u7684\u6267\u884c\u7a97\u53e3\uff0c\u5f53\u7136\uff0c\u5f00\u53d1\u8005\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u65b9\u5f0f\uff0c\u5f3a\u5236\u663e\u793a\u51fd\u6570\u9009\u62e9\u7a97\u53e3
\uff1a
adapter.run(show_select_window=True)\n
\u51fd\u6570\u9009\u62e9\u7a97\u53e3
\u4e3b\u8981\u5206\u6210\u4e09\u4e2a\u533a\u57df\uff1a
- \u2460
\u51fd\u6570\u5217\u8868\u533a\u57df
- \u2461
\u51fd\u6570\u6587\u6863\u533a\u57df
- \u2462
\u51fd\u6570\u9009\u62e9\u6309\u94ae
"},{"location":"window/#2_1","title":"2\u3001\u914d\u7f6e\u7a97\u53e3\u5c5e\u6027","text":"\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\u7684\u53ef\u914d\u7f6e\u5c5e\u6027\u7531FnSelectWindowConfig
\u7c7b\u5b9a\u4e49\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\u914d\u7f6e\u7a97\u53e3\u5c5e\u6027\uff1a
\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.windows import DocumentBrowserConfig\nfrom pyguiadapter.windows.fnselect import FnSelectWindowConfig\n\n\ndef fn1():\n \"\"\"\n This example shows how config the **function select window**\n \"\"\"\n pass\n\n\ndef fn2():\n \"\"\"\n This example shows how config the **function select window**\n \"\"\"\n pass\n\n\ndef fn3():\n \"\"\"\n This example shows how config the **function select window**\n \"\"\"\n pass\n\n\ndef fn4():\n \"\"\"\n This example shows how config the **function select window**\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n\n select_window_config = FnSelectWindowConfig(\n title=\"My Tool Kit\",\n icon=\"fa5s.tools\",\n default_fn_group_name=\"Group 1\",\n default_fn_group_icon=\"fa.desktop\",\n fn_group_icons={\n \"Group 2\": \"fa.mobile\",\n \"Group 3\": \"fa.cloud\",\n },\n size=(600, 400),\n icon_size=32,\n icon_mode=True,\n select_button_text=\"Go!\",\n document_browser_width=400,\n document_browser_config=DocumentBrowserConfig(),\n always_on_top=True,\n )\n\n adapter = GUIAdapter()\n adapter.add(fn1)\n adapter.add(fn2)\n adapter.add(fn3, group=\"Group 2\")\n adapter.add(fn4, group=\"Group 3\")\n adapter.run(select_window_config=select_window_config)\n
\u5173\u4e8e\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\u7684\u53ef\u914d\u7f6e\u5c5e\u6027\uff0c\u53ef\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.windows.fnselect.FnSelectWindowConfig
"},{"location":"window/#3_1","title":"3\u3001\u76d1\u542c\u7a97\u53e3\u4e8b\u4ef6","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u5bf9\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\u7684\u4e8b\u4ef6\u8fdb\u884c\u76d1\u542c\u3002\u65b9\u6cd5\u5982\u4e0b\uff1a
\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.utils import messagebox\nfrom pyguiadapter.window import SimpleWindowEventListener\nfrom pyguiadapter.windows.fnselect import FnSelectWindow\n\n\ndef on_window_create(window: FnSelectWindow):\n print(\"on_create\")\n\n\ndef on_window_show(window: FnSelectWindow):\n print(\"on_show\")\n\n\ndef on_window_hide(window: FnSelectWindow):\n print(\"on_hide\")\n\n\ndef on_window_close(window: FnSelectWindow) -> bool:\n print(\"on_close\")\n ret = messagebox.show_question_message(\n window,\n title=\"Confirm Quit\",\n message=\"Are you sure to quit?\",\n buttons=messagebox.Yes | messagebox.No,\n )\n if ret == messagebox.Yes:\n return True\n return False\n\n\ndef on_window_destroy(window: FnSelectWindow):\n print(\"on_destroy\")\n\n\ndef event_example_3():\n pass\n\n\nif __name__ == \"__main__\":\n event_listener = SimpleWindowEventListener(\n on_create=on_window_create,\n on_show=on_window_show,\n on_hide=on_window_hide,\n on_close=on_window_close,\n on_destroy=on_window_destroy,\n )\n adapter = GUIAdapter()\n adapter.add(event_example_3)\n adapter.run(show_select_window=True, select_window_listener=event_listener)\n
\u4ee3\u7801\u8fd0\u884c\u6548\u679c\u5982\u4e0b\uff1a
\u63a7\u5236\u53f0\u8f93\u51fa\u5982\u4e0b\uff1a
"},{"location":"window/#4","title":"4\u3001\u6dfb\u52a0\u5de5\u5177\u680f","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u5411\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\u4e2d\u6dfb\u52a0\u5de5\u5177\u680f\uff0c\u65b9\u6cd5\u5982\u4e0b\uff1a
\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a
from pyguiadapter.action import Action\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.toolbar import ToolBar, ToolButtonTextUnderIcon\nfrom pyguiadapter.utils import messagebox\nfrom pyguiadapter.windows.fnselect import FnSelectWindow\n\n\ndef on_action_test(window: FnSelectWindow, action: Action):\n messagebox.show_info_message(\n window, message=f\"Action Triggered!(Action: {action.text})\"\n )\n\n\ndef on_action_close(window: FnSelectWindow, _: Action):\n ret = messagebox.show_question_message(\n window,\n message=\"Are you sure to close the application?\",\n buttons=messagebox.Yes | messagebox.No,\n )\n if ret == messagebox.Yes:\n window.close()\n\n\naction_test = Action(\n text=\"Test\", icon=\"fa.folder-open\", on_triggered=on_action_test, shortcut=\"Ctrl+O\"\n)\naction_close = Action(\n text=\"Close\", icon=\"fa.close\", on_triggered=on_action_close, shortcut=\"Ctrl+Q\"\n)\n\ntoolbar = ToolBar(\n actions=[action_test, action_close],\n floatable=True,\n button_style=ToolButtonTextUnderIcon,\n)\n\n\ndef foo():\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(foo)\n adapter.run(show_select_window=True, select_window_toolbar=toolbar)\n
\u6548\u679c\u5982\u4e0b\uff1a
"},{"location":"window/#5","title":"5\u3001\u6dfb\u52a0\u7a97\u53e3\u83dc\u5355","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u5411\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\u4e2d\u6dfb\u52a0\u83dc\u5355\u680f\uff0c\u65b9\u6cd5\u5982\u4e0b\uff1a
\u5b8c\u6574\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a
from pyguiadapter.action import Action, Separator\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.menu import Menu\nfrom pyguiadapter.utils import messagebox\nfrom pyguiadapter.windows.fnselect import FnSelectWindow\n\n\ndef on_action_test(window: FnSelectWindow, action: Action):\n messagebox.show_info_message(\n window, message=f\"Action Triggered!(Action: {action.text})\"\n )\n\n\ndef on_action_close(window: FnSelectWindow, _: Action):\n ret = messagebox.show_question_message(\n window,\n message=\"Are you sure to close the application?\",\n buttons=messagebox.Yes | messagebox.No,\n )\n if ret == messagebox.Yes:\n window.close()\n\n\naction_test = Action(\n text=\"Test\", icon=\"fa.folder-open\", on_triggered=on_action_test, shortcut=\"Ctrl+O\"\n)\naction_close = Action(\n text=\"Close\", icon=\"fa.close\", on_triggered=on_action_close, shortcut=\"Ctrl+Q\"\n)\n\n\nmenu_file = Menu(\n title=\"File\",\n actions=[action_test, Separator(), action_close],\n)\n\n\ndef foo():\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(foo)\n adapter.run(show_select_window=True, select_window_menus=[menu_file])\n
\u6548\u679c\u5982\u4e0b\uff1a
"},{"location":"window/#6","title":"6\u3001\u4e3b\u8981\u63a5\u53e3","text":"\u53c2\u8003\uff1apyguiadapter.windows.fnselect.FnSelectWindow\u3002
"},{"location":"window/#fnexecutewindow","title":"\uff08\u4e09\uff09\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow\uff09","text":""},{"location":"window/#1_2","title":"1\u3001\u6982\u8ff0","text":"\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow\uff09
\u662f\u7528\u6237\u4e0e\u7a0b\u5e8f\u8fdb\u884c\u4ea4\u4e92\u7684\u4e3b\u8981\u754c\u9762\u3002\u4e00\u4e2a\u5178\u578b\u7684\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow\uff09
\u7531\u4ee5\u4e0b\u51e0\u4e2a\u90e8\u5206\u7ec4\u6210\uff1a
\u5176\u4e2d\uff1a
- \u6587\u6863\u6d4f\u89c8\u5668\u7528\u4e8e\u663e\u793a\u51fd\u6570\u8bf4\u660e\u6587\u6863\u3002
- \u8f93\u51fa\u6d4f\u89c8\u5668\u7528\u4e8e\u663e\u793a\u51fd\u6570\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u4f7f\u7528\u8f93\u51fa\u7684\u6d88\u606f\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u51fd\u6570\u7684\u8fd4\u56de\u503c\u3001\u51fd\u6570\u7684\u5f02\u5e38\u4fe1\u606f\u5747\u4f1a\u663e\u793a\u5728\u6b64\u533a\u57df\u3002
"},{"location":"window/#2_2","title":"2\u3001\u914d\u7f6e\u7a97\u53e3\u5c5e\u6027","text":"\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow\uff09
\u7684\u7a97\u53e3\u5c5e\u6027\u7531\u914d\u7f6e\u7c7bFnExecuteWindowConfig
\u5b9a\u4e49\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7GUIAdapter.add()
\u65b9\u6cd5\u7684window_config
\u914d\u7f6e\u7a97\u53e3\u7684\u5c5e\u6027\uff0c\u6bcf\u4e2a\u51fd\u6570\u90fd\u53ef\u4ee5\u6839\u636e\u9700\u8981\u914d\u7f6e\u81ea\u5df1\u7684\u7a97\u53e3\u5c5e\u6027\uff0c\u4f8b\u5982\uff0c\u5728\u4e0b\u9762\u7684\u4f8b\u5b50\u4e2d\uff0cfunction_1
\u548cfunction_2
\u5206\u522b\u914d\u7f6e\u4e86\u4e0d\u540c\u7684\u7a97\u53e3\u5c5e\u6027\uff1a
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.windows.fnexec import FnExecuteWindowConfig\n\n\ndef function_1(arg1: int, arg2: str, arg3: bool) -> None:\n pass\n\n\ndef function_2(arg1: int, arg2: str, arg3: bool) -> None:\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n function_1,\n # set window config for function_1\n window_config=FnExecuteWindowConfig(\n title=\"Function 1\", clear_checkbox_visible=True\n ),\n )\n adapter.add(\n function_2,\n # set window config for function_2\n window_config=FnExecuteWindowConfig(\n title=\"Function 2\",\n size=(400, 600),\n clear_checkbox_visible=False,\n clear_checkbox_checked=False,\n document_dock_visible=False,\n ),\n )\n adapter.run()\n
\u4e0b\u9762\u662f\u4e00\u4e2a\u66f4\u52a0\u590d\u6742\u4e00\u4e9b\u7684\u4f8b\u5b50\uff0c\u6f14\u793a\u4e86\u66f4\u591a\u53ef\u914d\u7f6e\u5c5e\u6027\u7684\u6548\u679c\uff1a
from typing import Optional\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.exceptions import ParameterError\nfrom pyguiadapter.windows.fnexec import FnExecuteWindowConfig\n\n\ndef equation_solver(a: float, b: float, c: float) -> Optional[tuple]:\n \"\"\"\n Solving Equations: ax^2 + bx + c = 0 (a,b,c \u2208 R, a \u2260 0)\n @param a: a \u2208 R, a \u2260 0\n @param b: b \u2208 R\n @param c: c \u2208 R\n @return:\n \"\"\"\n if a == 0:\n raise ParameterError(parameter_name=\"a\", message=\"a cannot be zero!\")\n\n delta = b**2 - 4 * a * c\n if delta < 0:\n return None\n x1 = (-b + delta**0.5) / (2 * a)\n if delta == 0:\n return x1, x1\n x2 = (-b - delta**0.5) / (2 * a)\n return x1, x2\n\n\nif __name__ == \"__main__\":\n window_config = FnExecuteWindowConfig(\n title=\"Equation Solver\",\n icon=\"mdi6.function-variant\",\n execute_button_text=\"Solve\",\n size=(350, 450),\n document_dock_visible=False,\n output_dock_visible=False,\n clear_button_visible=False,\n clear_checkbox_visible=False,\n show_function_result=True,\n function_result_message=\"real roots: {}\",\n default_parameter_group_name=\"Equation Parameters\",\n print_function_error=False,\n print_function_result=False,\n )\n adapter = GUIAdapter()\n adapter.add(equation_solver, window_config=window_config)\n adapter.run()\n
\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow\uff09
\u62e5\u6709\u4e30\u5bcc\u7684\u53ef\u914d\u7f6e\u9009\u9879\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\u83b7\u5f97\u8fd9\u4e9b\u9009\u9879\u7684\u8be6\u7ec6\u4fe1\u606f\uff1a
- pyguiadapter.windows.fnexec.FnExecuteWindowConfig\u3002
\u5173\u4e8e\u6587\u6863\u6d4f\u89c8\u5668\u7684\u914d\u7f6e\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.windows.DocumentBrowserConfig\u3002
\u5173\u4e8e\u8f93\u51fa\u6d4f\u89c8\u5668\u7684\u914d\u7f6e\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.windows.fnexec.OutputBrowserConfig\u3002
Q&A\uff1a \u4e3a\u4ec0\u4e48\u8bbe\u7f6e\u4e86DocumentBrowserConfig
\u548cOutputBrowserConfig
\uff0c\u4f46\u6709\u65f6\u4e0d\u751f\u6548\uff1f
\u8fd9\u79cd\u60c5\u51b5\u5e38\u89c1\u4e8e\u5f00\u53d1\u8005\u4e3a\u7a97\u53e3\u8bbe\u7f6e\u4e86\u6837\u5f0f\u8868\uff08QSS\uff09\u6216\u4f7f\u7528\u4e86\u7b2c\u4e09\u65b9\u7f8e\u5316\u5e93\u65f6\u3002\u7531\u4e8e\u6837\u5f0f\u8868\u7684\u4f18\u5148\u7ea7\u8981\u9ad8\u4e8eDocumentBrowserConfig
\u548cOutputBrowserConfig
\uff0c\u56e0\u6b64\u53ef\u80fd\u4f1a\u53d1\u751fDocumentBrowserConfig
\u6216OutputBrowserConfig
\u4e2d\u8bbe\u7f6e\u7684\u6837\u5f0f\uff08\u5982\u6587\u5b57\u989c\u8272\u3001\u80cc\u666f\u8272\u7b49\uff09\u88ab\u6837\u5f0f\u8868\u8986\u76d6\u6389\u7684\u60c5\u51b5\u3002\u8fd9\u79cd\u8bbe\u8ba1\u7684\u76ee\u7684\u662f\u4e3a\u4e86\u8ba9\u754c\u9762\u7684\u6574\u4f53\u98ce\u683c\u4fdd\u6301\u4e00\u81f4\u3002
\u6bd4\u5982\u4e0b\u9762\u8fd9\u4e2a\u4f8b\u5b50\uff0c\u901a\u8fc7\u7b2c\u4e09\u65b9\u5e93\u8bbe\u7f6e\u4e86\u7a97\u53e3\u4e3b\u9898\u540e\uff0c\u6587\u6863\u6d4f\u89c8\u5668\u548c\u8f93\u51fa\u6d4f\u89c8\u5668\u7684\u6587\u5b57\u989c\u8272\u3001\u80cc\u666f\u989c\u8272\u4e5f\u4f1a\u88ab\u8c03\u6574\u5230\u5408\u9002\u7684\u72b6\u6001\u3002
\"\"\"\nThis example requires PyQtDarkTheme. Please install it before you run this example.\n\"\"\"\n\nfrom datetime import datetime\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.extend_types import text_t\n\n\ndef app_style_example(\n arg1: str, arg2: int, arg3: float, arg4: bool, arg5: text_t, arg6: datetime\n):\n \"\"\"\n This example requires [PyQtDarkTheme](https://github.com/5yutan5/PyQtDarkTheme).\n Please install it before you run the example.\n\n <br />\n \n e.g. using `pip`:\n \n > `pip install pyqtdarktheme`\n \n @param arg1: arg1 description\n @param arg2: arg2 description\n @param arg3: arg3 description\n @param arg4: arg4 description\n @param arg5: arg5 description\n @param arg6: arg6 description\n @return:\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n import qdarktheme\n\n def on_app_start(app):\n # this will be called after the instantiation of QApplication.\n print(\"app started\")\n qdarktheme.setup_theme(\"dark\")\n \n adapter = GUIAdapter(on_app_start=on_app_start)\n adapter.add(app_style_example)\n adapter.run()\n```\n
\u5982\u679c\u5f00\u53d1\u8005\u786e\u5b9e\u9700\u8981\u8bbe\u7f6e\u6587\u6863\u6d4f\u89c8\u5668\u6216\u8f93\u51fa\u6d4f\u89c8\u5668\u7684\u6837\u5f0f\uff0c\u800c\u4e0d\u5e0c\u671b\u5b83\u88ab\u7b2c\u4e09\u65b9\u5e93\u8986\u76d6\uff0c\u53ef\u4ee5\u901a\u8fc7DocumentBrowserConfig
\u6216OutputBrowserConfig
\u7684stylesheet
\u5c5e\u6027\u6307\u5b9a\u5176\u6837\u5f0f\u8868\u5185\u5bb9\uff0c\u901a\u8fc7stylesheet
\u8bbe\u7f6e\u7684\u6837\u5f0f\u4e00\u822c\u4e0d\u4f1a\u88ab\u7b2c\u4e09\u65b9\u5e93\u8986\u76d6\u3002\u6bd4\u5982\u4e0b\u9762\u7684\u793a\u4f8b\uff1a
\"\"\"\nThis example requires PyQtDarkTheme. Please install it before you run this example.\n\"\"\"\n\nfrom datetime import datetime\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.extend_types import text_t\nfrom pyguiadapter.windows.fnexec import FnExecuteWindowConfig, OutputBrowserConfig\n\n\ndef app_style_example(\n arg1: str, arg2: int, arg3: float, arg4: bool, arg5: text_t, arg6: datetime\n):\n \"\"\"\n This example requires [PyQtDarkTheme](https://github.com/5yutan5/PyQtDarkTheme).\n Please install it before you run the example.\n <br />\n\n e.g. using `pip`:\n\n > `pip install pyqtdarktheme`\n\n <br />\n\n The style of output browser will be overridden with **OutputBrowserConfig.stylesheet**\n\n @param arg1: arg1 description\n @param arg2: arg2 description\n @param arg3: arg3 description\n @param arg4: arg4 description\n @param arg5: arg5 description\n @param arg6: arg6 description\n @return:\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n import qdarktheme\n\n def on_app_start(app):\n # this will be called after the instantiation of QApplication.\n print(\"app started\")\n qdarktheme.setup_theme(\"dark\")\n\n adapter = GUIAdapter(on_app_start=on_app_start)\n adapter.add(\n app_style_example,\n window_config=FnExecuteWindowConfig(\n output_browser_config=OutputBrowserConfig(\n stylesheet=\"\"\"\n background-color: \"#380C2A\";\n color: \"#FFFFFF\";\n font-family: \"Consolas\";\n font-size: 12pt;\n \"\"\"\n )\n ),\n )\n adapter.run()\n
"},{"location":"window/#3_2","title":"3\u3001\u76d1\u542c\u7a97\u53e3\u4e8b\u4ef6","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u5bf9\uff08\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff09FnExecuteWindow
\u7684\u4e8b\u4ef6\u8fdb\u884c\u76d1\u542c\u5e76\u505a\u51fa\u54cd\u5e94\uff0c\u4e00\u4e2a\u6bd4\u8f83\u5e38\u89c1\u7684\u573a\u666f\u662f\uff0c\u5728\u7528\u6237\u5173\u95ed\u7a97\u53e3\u65f6\u518d\u6b21\u5411\u7528\u6237\u8fdb\u884c\u786e\u8ba4\u3002\u76d1\u542c\u7a97\u53e3\u4e8b\u4ef6\u7684\u65b9\u6cd5\u5982\u4e0b\uff1a
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.window import SimpleWindowEventListener\nfrom pyguiadapter.windows.fnexec import FnExecuteWindow\nfrom pyguiadapter.utils import messagebox\n\n\ndef on_window_create(window: FnExecuteWindow):\n print(\"on_create\")\n\n\ndef on_window_show(window: FnExecuteWindow):\n print(\"on_show\")\n\n\ndef on_window_hide(window: FnExecuteWindow):\n print(\"on_hide\")\n\n\ndef on_window_close(window: FnExecuteWindow) -> bool:\n print(\"on_close\")\n ret = messagebox.show_question_message(\n window,\n title=\"Confirm Quit\",\n message=\"Are you sure to quit?\",\n buttons=messagebox.Yes | messagebox.No,\n )\n if ret == messagebox.Yes:\n return True\n return False\n\n\ndef on_window_destroy(window: FnExecuteWindow):\n print(\"on_destroy\")\n\n\ndef event_example_2():\n pass\n\n\nif __name__ == \"__main__\":\n event_listener = SimpleWindowEventListener(\n on_create=on_window_create,\n on_show=on_window_show,\n on_hide=on_window_hide,\n on_close=on_window_close,\n on_destroy=on_window_destroy,\n )\n adapter = GUIAdapter()\n adapter.add(event_example_2, window_listener=event_listener)\n adapter.run()\n
\u4e0a\u8ff0\u793a\u4f8b\u6548\u679c\u5982\u4e0b\uff1a
\u63a7\u5236\u53f0\u8f93\u51fa\u5982\u4e0b\uff1a
\u9664\u4e86\u53ef\u4ee5\u4f7f\u7528BaseWindowEventListener
\u6216SimpleWindowEventListener
\u5bf9\u51fd\u6570\u6267\u884c\u7a97\u53e3\u7684\u4e8b\u4ef6\u8fdb\u884c\u76d1\u542c\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528\u51fd\u6570\u6267\u884c\u7a97\u53e3\u4e13\u7528\u7684\u4e8b\u4ef6\u76d1\u542c\u5668\u7c7b\uff1aFnExecuteWindowEventListener
\u6216SimpleFnExecuteWindowEventListener
\u3002\u9664\u4e86\u53ef\u4ee5\u76d1\u542c\u4e00\u822c\u7684\u7a97\u53e3\u4e8b\u4ef6\uff0c\u5b83\u4eec\u8fd8\u80fd\u5bf9\u51fd\u6570\u6267\u884c\u72b6\u6001\u8fdb\u884c\u76d1\u542c\uff0c\u5305\u62ec\uff1a
- \u51fd\u6570\u5f00\u59cb\u6267\u884c\uff0c\u6b64\u65f6\u5c06\u4f1a\u56de\u8c03
on_execute_start()
- \u51fd\u6570\u6b63\u5e38\u8fd4\u56de\uff0c\u6b64\u65f6\u5c06\u4f1a\u56de\u8c03
on_execute_result()
- \u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u53d1\u751f\u5f02\u5e38\uff0c\u51fd\u6570\u672a\u6b63\u5e38\u8fd4\u56de\uff0c\u6b64\u65f6\u5c06\u56de\u8c03
on_execute_error()
- \u51fd\u6570\u6267\u884c\u5b8c\u6bd5\uff0c\u6b64\u65f6\u5c06\u4f1a\u56de\u8c03
on_execute_finish()
\uff0c\u7531\u4e8e\u4e0d\u7ba1\u51fd\u6570\u662f\u5426\u6b63\u5e38\u8fd4\u56de\uff0c\u5176\u6700\u7ec8\u90fd\u4f1a\u56de\u5230\u8be5\u72b6\u6001\uff0c \u56e0\u6b64\uff0c\u53ef\u4ee5\u4fdd\u8bc1\u5728on_execute_result()
\u6216on_execute_error()
\u56de\u8c03\u4e4b\u540eon_execute_finish()
\u4e00\u5b9a\u4f1a\u88ab\u56de\u8c03
\u5728\u4e0a\u8ff0\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\uff0c\u6bd4\u8f83\u7279\u6b8a\u7684\u662fon_execute_result()
\u548con_execute_error()
\u3002\u8fd9\u4e24\u4e2a\u56de\u8c03\u51fd\u6570\u8fd4\u56de\u4e00\u4e2abool
\u503c\uff0c\u5176\u4f5c\u7528\u662f\u544a\u8bc9PyGUIAdapter
\u662f\u5426\u8981\u5bf9\u51fd\u6570\u7684\u8fd4\u56de\u503c\u6216\u5f02\u5e38\u6267\u884c\u9ed8\u8ba4\u7684\u5904\u7406\u903b\u8f91\u3002\u82e5\u8fd4\u56deTrue
\uff0c\u5219PyGUIAdapter
\u5c06\u5728\u51fd\u6570\u8fd4\u56de\u6216\u53d1\u751f\u5f02\u5e38\u540e\u6267\u884c\u9ed8\u8ba4\u7684\u64cd\u4f5c\uff0c\u6bd4\u5982\u6253\u5370\u6216\u5f39\u7a97\u663e\u793a\u8fd4\u56de\u503c\u6216\u5f02\u5e38\u4fe1\u606f\u3002\u82e5\u8fd4\u56deFalse
\uff0c\u5219\u8868\u793a\u5f00\u53d1\u8005\u5df2\u7ecf\u5728\u56de\u8c03\u51fd\u6570\u4e2d\u5b8c\u6210\u4e86\u5bf9\u51fd\u6570\u8fd4\u56de\u503c/\u5f02\u5e38\u5904\u7406\uff0c\u65e0\u9700PyGUIAdapter
\u518d\u6b21\u8fdb\u884c\u5904\u7406\u3002
\u5f00\u53d1\u8005\u53ef\u4ee5\u67e5\u770b\u4ee5\u4e0b\u6587\u6863\uff0c\u83b7\u53d6FnExecuteWindowEventListener
\u6216SimpleFnExecuteWindowEventListener
\u7684\u8be6\u7ec6\u4fe1\u606f\uff1a
FnExecuteWindowEventListener
SimpleFnExecuteWindowEventListener
\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.utils import messagebox\nfrom pyguiadapter.windows.fnexec import (\n FnExecuteWindow,\n SimpleFnExecuteWindowEventListener,\n)\n\n\ndef on_execute_start(window: FnExecuteWindow):\n print(\"on_execute_start()\")\n\n\ndef on_execute_result(window: FnExecuteWindow, result) -> bool:\n print(f\"on_execute_result(): {result}\")\n messagebox.show_info_message(window, message=f\"Result: {result}\", title=\"Result\")\n return False\n\n\ndef on_execute_error(window: FnExecuteWindow, error) -> bool:\n print(f\"on_execute_error(): {error}\")\n messagebox.show_exception_messagebox(window, error)\n return False\n\n\ndef on_execute_finish(window: FnExecuteWindow):\n print(\"on_execute_finish()\")\n\n\ndef event_example_3(a: int = 1, b: int = 1):\n return a / b\n\n\nif __name__ == \"__main__\":\n event_listener = SimpleFnExecuteWindowEventListener(\n on_execute_start=on_execute_start,\n on_execute_result=on_execute_result,\n on_execute_error=on_execute_error,\n on_execute_finish=on_execute_finish,\n )\n adapter = GUIAdapter()\n adapter.add(event_example_3, window_listener=event_listener)\n adapter.run()\n
\u6ce8\u610f\u5230\uff0c\u5728\u672c\u793a\u4f8b\u4e2d\uff0con_execute_result()
\u548con_execute_error()
\u56de\u8c03\u51fd\u6570\u5747\u8fd4\u56de\u4e86False
\u3002
\u8fd9\u8868\u793a\u5c06\u7531\u5f00\u53d1\u8005\u81ea\u884c\u5904\u7406\u51fd\u6570\u8fd4\u56de\u7ed3\u679c\u6216\u51fd\u6570\u6267\u884c\u5f02\u5e38\uff0c\u800c\u4e0d\u4f1a\u6267\u884c\u9ed8\u8ba4\u7684\u5904\u7406\u903b\u8f91\uff0c\u5177\u4f53\u800c\u8a00\uff0cPyGUIAdapter
\u5c06\u4e0d\u4f1a\u628a\u51fd\u6570\u6267\u884c\u7ed3\u679c\u6216\u51fd\u6570\u5f02\u5e38\u4fe1\u606f\u6253\u5370\u5230\u8f93\u51fa\u6d4f\u89c8\u5668\u4e2d\u3002
\u4e0b\u9762\u662f\u8be5\u7a0b\u5e8f\u7684\u8fd0\u884c\u6548\u679c\uff1a
\uff081\uff09\u5f53\u51fd\u6570\u6b63\u5e38\u8fd4\u56de\u65f6
\uff082\uff09\u5f53\u51fd\u6570\u53d1\u751f\u5f02\u5e38\u65f6
"},{"location":"window/#4_1","title":"4\u3001\u6dfb\u52a0\u83dc\u5355\u548c\u5de5\u5177\u680f","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u4e3aFnExecuteWindow
\u6dfb\u52a0\u5de5\u5177\u680f\u548c\u83dc\u5355\u680f\uff0c\u5177\u4f53\u65b9\u6cd5\u5982\u4e0b\uff1a
from pyguiadapter.action import Action, Separator\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.menu import Menu\nfrom pyguiadapter.toolbar import ToolBar\nfrom pyguiadapter.windows.fnexec import FnExecuteWindow\nfrom pyguiadapter.utils import messagebox, filedialog\n\n\ndef on_action_about(window: FnExecuteWindow, _: Action):\n messagebox.show_info_message(\n parent=window,\n message=\"This is an example of toolbar and menu with custom actions.\",\n title=\"About\",\n )\n\n\ndef on_action_close(window: FnExecuteWindow, _: Action):\n ret = messagebox.show_question_message(\n window, \"Are you sure you want to quit?\", buttons=messagebox.Yes | messagebox.No\n )\n if ret == messagebox.Yes:\n window.close()\n\n\ndef on_action_open(window: FnExecuteWindow, _: Action):\n ret = filedialog.get_open_file(\n window,\n title=\"Open File\",\n start_dir=\"./\",\n filters=\"JSON files(*.json);;Python files(*.py);;All files(*.*)\",\n )\n if not ret:\n return\n messagebox.show_info_message(window, f\"File will be opened: {ret}\")\n\n\ndef on_action_save(window: FnExecuteWindow, _: Action):\n ret = filedialog.get_save_file(\n window,\n title=\"Save File\",\n start_dir=\"./\",\n filters=\"JSON files(*.json);;All files(*.*)\",\n )\n if not ret:\n return\n messagebox.show_info_message(window, f\"File will be saved: {ret}\")\n\n\ndef on_action_auto_theme(window: FnExecuteWindow, _: Action, checked: bool):\n if checked:\n messagebox.show_info_message(window, \"Auto theme is selected.\")\n\n\ndef on_action_light_theme(window: FnExecuteWindow, _: Action, checked: bool):\n if checked:\n messagebox.show_info_message(window, \"Light theme is selected.\")\n\n\ndef on_action_dark_theme(window: FnExecuteWindow, _: Action, checked: bool):\n if checked:\n messagebox.show_info_message(window, \"Dark theme is selected.\")\n\n\naction_about = Action(\n text=\"About\",\n icon=\"fa.info-circle\",\n on_triggered=on_action_about,\n)\n\naction_open = Action(\n text=\"Open\",\n icon=\"fa.folder-open\",\n shortcut=\"Ctrl+O\",\n on_triggered=on_action_open,\n)\n\naction_save = Action(\n text=\"Save\",\n icon=\"fa.save\",\n shortcut=\"Ctrl+S\",\n on_triggered=on_action_save,\n)\n\naction_close = Action(\n text=\"Quit\",\n icon=\"fa.close\",\n shortcut=\"Ctrl+Q\",\n on_triggered=on_action_close,\n)\n\naction_auto_them = Action(\n text=\"Auto\",\n checkable=True,\n checked=True,\n on_toggled=on_action_auto_theme,\n)\n\naction_light_theme = Action(\n text=\"Light\",\n checkable=True,\n on_toggled=on_action_light_theme,\n)\n\naction_dark_theme = Action(\n text=\"Dark\",\n checkable=True,\n on_toggled=on_action_dark_theme,\n)\n\nsubmenu_theme = Menu(\n title=\"Theme\",\n actions=[action_auto_them, action_light_theme, action_dark_theme],\n exclusive=True,\n)\nmenu_file = Menu(\n title=\"File\",\n actions=[\n action_open,\n action_save,\n Separator(),\n action_close,\n Separator(),\n submenu_theme,\n ],\n)\nmenu_help = Menu(\n title=\"Help\",\n actions=[action_about],\n)\n\n\ndef menu_toolbar_example(arg1: int, arg2: str, arg3: bool):\n \"\"\"\n This example shows how to add and config toolbar and menus to the window.\n @param arg1:\n @param arg2:\n @param arg3:\n @return:\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n menu_toolbar_example,\n window_menus=[menu_file, menu_help],\n window_toolbar=ToolBar(\n actions=[action_open, action_save, Separator(), action_close]\n ),\n )\n adapter.run()\n
\u6548\u679c\u5982\u4e0b\uff1a
"},{"location":"window/#5_1","title":"5\u3001\u4e3b\u8981\u63a5\u53e3","text":"\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow\uff09
\u63d0\u4f9b\u4e86\u5927\u91cf\u63a5\u53e3\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u52a8\u4f5c\uff08Action\uff09
\u56de\u8c03\u51fd\u6570\u6216\u7a97\u53e3\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u8c03\u7528\u8fd9\u4e9b\u63a5\u53e3\u3002\u501f\u52a9\u8fd9\u4e9b\u63a5\u53e3\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5b9e\u73b0\u76f8\u5f53\u590d\u6742\u7684\u529f\u80fd\uff0c\u6bd4\u5982\u52a8\u6001\u8bbe\u7f6e/\u83b7\u53d6\u53c2\u6570\u7684\u5f53\u524d\u503c\uff0c\u8bbe\u7f6e\u662f\u52a8\u6001\u589e\u52a0/\u5220\u9664\u53c2\u6570\u63a7\u4ef6\u3002
\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\u83b7\u53d6\u8fd9\u4e9b\u63a5\u53e3\u7684\u5177\u4f53\u4fe1\u606f\uff1a
- pyguiadapter.windows.fnexec.FnExecuteWindow\u3002
\u4e0b\u9762\uff0c\u901a\u8fc7\u4e00\u4e9b\u793a\u4f8b\u6765\u8bf4\u660e\u8fd9\u4e9b\u63a5\u53e3\u7684\u4f7f\u7528\u3002
"},{"location":"window/#1_3","title":"\uff081\uff09\u793a\u4f8b\uff1a\u52a0\u8f7d\u548c\u4fdd\u5b58\u5f53\u524d\u53c2\u6570","text":"\u4e0b\u9762\u7ed3\u5408\u83dc\u5355\u7684\u4f7f\u7528\uff0c\u5b9e\u73b0\u53c2\u6570\u7684\u4fdd\u5b58\u548c\u52a0\u8f7d\u7684\u6548\u679c\u3002
import json\n\nfrom typing import Dict, Any\n\nfrom pyguiadapter.action import Action\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.exceptions import ParameterError\nfrom pyguiadapter.extend_types import color_t\nfrom pyguiadapter.menu import Menu\nfrom pyguiadapter.utils import messagebox, filedialog\nfrom pyguiadapter.windows.fnexec import FnExecuteWindow\n\n\ndef simple_load_save_example(\n arg1: int,\n arg2: float,\n arg3: bool,\n arg4: str,\n arg5: color_t,\n):\n \"\"\"\n This example shows how to save current parameter values to a json file and load a parameter values from a json file.\n @param arg1:\n @param arg2:\n @param arg3:\n @param arg4:\n @param arg5:\n @return:\n \"\"\"\n uprint(\"arg1=\", arg1)\n uprint(\"arg2=\", arg2)\n uprint(\"arg3=\", arg3)\n uprint(\"arg4=\", arg4)\n uprint(\"arg5=\", arg5)\n\n\ndef on_save_params(window: FnExecuteWindow, _: Action):\n # Step 1: obtain current parameter values from widgets\n #\n # if the current input in the widgets of some parameter is invalid, the get_parameter_values() method may raise a\n # exception. A good practice is to catch the exception and handle it properly:\n # - for ParameterError, the FnExecuteWindow has a builtin logic to deal with it, so just call the\n # process_parameter_error() method and let the window do the job.\n #\n # - for other exceptions, we need handle it by ourselves. Here we choose to show the exception message with a\n # message box to the user.\n\n try:\n params: Dict[str, Any] = window.get_parameter_values()\n except ParameterError as e:\n window.process_parameter_error(e)\n return\n except Exception as e:\n messagebox.show_exception_messagebox(\n window, e, message=\"Unable to get the parameters: \"\n )\n return\n\n # Step2: serialize the parameter values and save them to a json file\n #\n # In this example, because we don't use any complex types, we can use simply json.dump() to do the serialization.\n # However, If your function contains parameters of complex types, such as list, tuple, set, dict, enum, then\n # serialization and deserialization must be considered very carefully.\n #\n save_file = filedialog.get_save_file(\n window, \"Save Parameters\", filters=\"JSON files(*.json)\"\n )\n if not save_file:\n return\n try:\n with open(save_file, \"w\") as f:\n json.dump(params, f)\n except Exception as e:\n messagebox.show_exception_messagebox(\n window, e, message=\"Unable to save the parameters: \"\n )\n else:\n messagebox.show_info_message(window, \"Parameters have been saved!\")\n\n\ndef on_load_params(window: FnExecuteWindow, _: Action):\n # Step 1: load the parameter values from a json file\n file = filedialog.get_open_file(\n window, \"Load Parameters\", filters=\"JSON files(*.json)\"\n )\n if not file:\n return\n try:\n with open(file, \"r\") as f:\n params: Dict[str, Any] = json.load(f)\n except Exception as e:\n messagebox.show_exception_messagebox(\n window, e, message=\"Unable to load the parameters: \"\n )\n return\n if not isinstance(params, dict):\n messagebox.show_critical_message(window, message=\"Invalid parameters format!\")\n return\n\n # Step2: set the parameter values to the widgets\n try:\n window.set_parameter_values(params)\n except ParameterError as e:\n window.process_parameter_error(e)\n return\n except Exception as e:\n messagebox.show_exception_messagebox(\n window, e, message=\"Unable to set the parameters: \"\n )\n else:\n messagebox.show_info_message(window, \"Parameters have been loaded!\")\n\n\nif __name__ == \"__main__\":\n action_save_params = Action(\n text=\"Save Parameters\",\n icon=\"fa.save\",\n shortcut=\"Ctrl+S\",\n on_triggered=on_save_params,\n )\n\n action_load_params = Action(\n text=\"Load Parameters\",\n icon=\"fa.folder-open\",\n shortcut=\"Ctrl+L\",\n on_triggered=on_load_params,\n )\n\n menu = Menu(\n title=\"File\",\n actions=[action_save_params, action_load_params],\n )\n\n adapter = GUIAdapter()\n adapter.add(simple_load_save_example, window_menus=[menu])\n adapter.run()\n
\u9700\u8981\u8bf4\u660e\u7684\u662f\uff0c\u4e0a\u9762\u6f14\u793a\u7684\u53ea\u662f\u6bd4\u8f83\u7b80\u5355\u7684\u60c5\u5f62\uff0c\u51fd\u6570\u53ea\u5305\u542b\u4e00\u4e9b\u7b80\u5355\u7c7b\u578b\u7684\u53c2\u6570\uff0c\u56e0\u6b64\u53ef\u4ee5\uff08\u51e0\u4e4e\uff09\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528json
\u5bf9get_parameter_values()
\u83b7\u53d6\u5230\u7684\u503c\u8fdb\u884c\u5e8f\u5217\u5316\u548c\u53cd\u5e8f\u5217\u5316\u3002\u7136\u800c\uff0c\u4e00\u65e6\u5305\u542b\u66f4\u4e3a\u590d\u6742\u7684\u7c7b\u578b\uff0c\u4f8b\u5982dict
\u3001list
\u3001tuple
\u3001set
\u3001Enum
\u7b49\uff0c\u90a3\u4e48\u5c31\u9700\u8981\u8ba4\u771f\u8003\u8651\u5e8f\u5217\u5316\u548c\u53cd\u5e8f\u5217\u5316\u7684\u95ee\u9898\u4e86\u3002\u5f53\u7136\uff0c\u65b9\u6848\u6709\u5f88\u591a\uff0c\u5982pickle
\u3001jsonpickle
\u7b49\uff0c\u5177\u4f53\u7684\u505a\u6cd5\u4e00\u5b9a\u662f\u548c\u5177\u4f53\u7684\u573a\u666f\u7ed3\u5408\u8d77\u6765\u7684\uff0c\u8fd9\u91cc\u65e0\u6cd5\u5c55\u5f00\uff0c\u4ec5\u4ec5\u662f\u505a\u4e00\u4e2a\u63d0\u793a\u3002
\u53e6\u5916\uff0c\u5728\u4ee5\u4e0a\u4ee3\u7801\u4e2d\uff0c\u6709\u5f88\u5927\u4e00\u90e8\u5206\u662f\u5728\u505a\u5f02\u5e38\u5904\u7406\uff0c\u8fd9\u4e00\u65b9\u9762\u8fd9\u662f\u4e3a\u4e86\u8bf4\u660e\u5f02\u5e38\u5904\u7406\u7684\u91cd\u8981\u6027\uff0c\u53e6\u4e00\u65b9\u9762\u4e5f\u662f\u4e3a\u4e86\u6f14\u793a\u5982\u4f55\u8fd0\u7528utils
\u5305\u63d0\u4f9b\u7684\u5b9e\u7528\u51fd\u6570\u3002
\u5173\u4e8eParameterError
\uff1a\u51fa\u73b0\u8fd9\u7c7b\u5f02\u5e38\u4e3b\u8981\u662f\u56e0\u4e3a\u4ece\u63a7\u4ef6\u83b7\u53d6/\u8bbe\u7f6e\u53c2\u6570\u503c\u65f6\u9047\u5230\u4e86\u975e\u6cd5\u7684\u8f93\u5165\u3002\u56e0\u4e3a\u8fd9\u79cd\u9519\u8bef\u6bd4\u8f83\u5e38\u89c1\uff0c\u6240\u4ee5FnExecuteWindow
\u4e3a\u5176\u5185\u5efa\u4e86\u4e00\u5957\u5904\u7406\u6d41\u7a0b\uff0c\u5f53\u6355\u83b7\u5230\u6b64\u7c7b\u5f02\u5e38\u65f6\uff0c\u5982\u65e0\u9700\u8fdb\u884c\u7279\u522b\u5904\u7406\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528process_parameter_error()
\u3002
"},{"location":"window/#2dock","title":"\uff082\uff09\u793a\u4f8b\uff1a\u8c03\u6574Dock\u7a97\u53e3\uff08\u9690\u85cf/\u663e\u793a/\u8c03\u6574\u4f4d\u7f6e......\uff09","text":"from pyguiadapter.action import Action, Separator\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.menu import Menu\nfrom pyguiadapter.windows.fnexec import (\n FnExecuteWindow,\n BottomDockWidgetArea,\n)\n\n\ndef dock_operation_example() -> None:\n pass\n\n\ndef on_toggle_document_dock(win: FnExecuteWindow, action: Action):\n win.set_document_dock_property(visible=not win.is_document_dock_visible())\n\n\ndef on_toggle_output_dock(win: FnExecuteWindow, action: Action):\n win.set_output_dock_property(visible=not win.is_output_dock_visible())\n\n\ndef on_tabify_docks(win: FnExecuteWindow, action: Action):\n win.tabify_docks()\n\n\ndef on_move_output_area(win: FnExecuteWindow, action: Action):\n if win.is_output_dock_floating():\n win.set_output_dock_property(floating=False)\n win.set_output_dock_property(area=BottomDockWidgetArea)\n\n\ndef on_float_output_dock(win: FnExecuteWindow, action: Action):\n win.set_output_dock_property(floating=True)\n\n\ndef main():\n action_document_dock = Action(\n text=\"Toggle Document Dock\",\n on_triggered=on_toggle_document_dock,\n )\n action_output_dock = Action(\n text=\"Toggle Output Dock\",\n on_triggered=on_toggle_output_dock,\n )\n action_tabify_docks = Action(\n text=\"Tabify Docks\",\n on_triggered=on_tabify_docks,\n )\n action_move_output_area = Action(\n text=\"Move Output Area\",\n on_triggered=on_move_output_area,\n )\n action_float_output_dock = Action(\n text=\"Float Output Dock\",\n on_triggered=on_float_output_dock,\n )\n menu_views = Menu(\n title=\"Views\",\n actions=[\n action_document_dock,\n action_output_dock,\n Separator(),\n action_tabify_docks,\n action_move_output_area,\n action_float_output_dock,\n ],\n )\n ##########\n adapter = GUIAdapter()\n adapter.add(dock_operation_example, window_menus=[menu_views])\n adapter.run()\n\n\nif __name__ == \"__main__\":\n main()\n
"},{"location":"apis/pyguiadapter.action/","title":"pyguiadapter.action","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action","title":"Action
dataclass
","text":" Bases: object
\u8be5\u7c7b\u7528\u4e8e\u521b\u5efa\u52a8\u4f5c\uff08Action
\uff09\uff0c\u5728\u5de5\u5177\u680f\uff08ToolBar
\uff09\u4e2d\u4e00\u4e2aAction
\u4ee3\u8868\u4e00\u4e2a\u5de5\u5177\u680f\u6309\u94ae\uff0c\u5728\u83dc\u5355\uff08Menu
\uff09\u4e2d\uff0c\u4e00\u4e2aAction
\u4ee3\u8868\u4e00\u4e2a\u83dc\u5355\u9879\u3002
Source code in pyguiadapter\\action.py
@dataclasses.dataclass\nclass Action(object):\n \"\"\"\u8be5\u7c7b\u7528\u4e8e\u521b\u5efa\u52a8\u4f5c\uff08`Action`\uff09\uff0c\u5728\u5de5\u5177\u680f\uff08`ToolBar`\uff09\u4e2d\u4e00\u4e2a`Action`\u4ee3\u8868\u4e00\u4e2a\u5de5\u5177\u680f\u6309\u94ae\uff0c\u5728\u83dc\u5355\uff08`Menu`\uff09\u4e2d\uff0c\u4e00\u4e2a`Action`\u4ee3\u8868\u4e00\u4e2a\u83dc\u5355\u9879\u3002\"\"\"\n\n text: str\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u7684\u63cf\u8ff0\u6027\u6587\u672c\u3002\"\"\"\n\n on_triggered: Optional[ActionTriggeredCallback] = None\n \"\"\"\u56de\u8c03\u51fd\u6570\uff0c\u5728\u52a8\u4f5c\uff08`Action`\uff09\u88ab\u89e6\u53d1\u65f6\u56de\u8c03\u3002\"\"\"\n\n on_toggled: Optional[ActionToggledCallback] = None\n \"\"\"\u56de\u8c03\u51fd\u6570\uff0c\u5728\u52a8\u4f5c\uff08`Action`\uff09\u7684`checked`\u72b6\u6001\u53d1\u751f\u5207\u6362\u65f6\u56de\u8c03\u3002\"\"\"\n\n icon: IconType = None\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u7684\u56fe\u6807\u3002\"\"\"\n\n icon_text: Optional[str] = None\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u7684\u56fe\u6807\u6587\u672c\u3002\"\"\"\n\n auto_repeat: bool = True\n \"\"\"\u6b64\u5c5e\u6027\u8868\u793a\u52a8\u4f5c\uff08`Action`\uff09\u662f\u5426\u53ef\u4ee5\u81ea\u52a8\u91cd\u590d\u3002\u5982\u679c\u8bbe\u7f6e\u4e3a`True`\uff0c\u5e76\u4e14\u7cfb\u7edf\u542f\u7528\u4e86\u952e\u76d8\u81ea\u52a8\u91cd\u590d\u529f\u80fd\uff0c\u90a3\u4e48\u5f53\u7528\u6237\u6301\u7eed\u6309\u4e0b\u952e\u76d8\u5feb\u6377\u952e\u7ec4\u5408\u65f6\uff0c\u8be5\u52a8\u4f5c\u5c06\u81ea\u52a8\u91cd\u590d\u3002\"\"\"\n\n enabled: bool = True\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u662f\u5426\u5904\u4e8e\u542f\u7528\u72b6\u6001\u3002\"\"\"\n\n checkable: bool = False\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u662f\u5426\u4e3a**`\u53ef\u9009\u4e2d\u52a8\u4f5c`**\u3002`\u53ef\u9009\u4e2d\u52a8\u4f5c`\u5177\u6709`\u9009\u4e2d`\u548c`\u672a\u9009\u4e2d`\u4e24\u79cd\u72b6\u6001\uff0c\u5728\u72b6\u6001\u53d1\u751f\u5207\u6362\u65f6\uff0c\u5c06\u89e6\u53d1`on_toggled`\u56de\u8c03\u51fd\u6570\u3002\"\"\"\n\n checked: bool = False\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u662f\u5426\u5904\u4e8e`\u9009\u4e2d`\u72b6\u6001\u3002\"\"\"\n\n shortcut: Optional[str] = None\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u7684\u5feb\u6377\u952e\u3002\"\"\"\n\n shortcut_context: Optional[ShortcutContext] = None\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u5feb\u6377\u952e\u7684\u4e0a\u4e0b\u6587\u3002\"\"\"\n\n tooltip: Optional[str] = None\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u7684\u5de5\u5177\u63d0\u793a\uff0c\u5de5\u5177\u63d0\u793a\u662f\u5728\u7528\u6237\u5c06\u9f20\u6807\u60ac\u505c\u5728\u52a8\u4f5c\u4e0a\u65f6\u663e\u793a\u7684\u989d\u5916\u4fe1\u606f\u3002\"\"\"\n\n whats_this: Optional[str] = None\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u7684\u201cWhat\u2019s This?\u201d \u5e2e\u52a9\u6587\u672c\u3002\"\"\"\n\n status_tip: Optional[str] = None\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u7684\u72b6\u6001\u63d0\u793a\u6587\u672c\uff0c\u72b6\u6001\u63d0\u793a\u6587\u672c\u5c06\u663e\u793a\u5728\u52a8\u4f5c\u6240\u5728\u7a97\u53e3\u7684\u72b6\u6001\u680f\u4e2d\u3002\"\"\"\n\n priority: Optional[Priority] = None\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u5728\u7528\u6237\u754c\u9762\u7684\u4f18\u5148\u7ea7\u3002\"\"\"\n\n menu_role: Optional[MenuRole] = None\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u83dc\u5355\u89d2\u8272\uff08menu role\uff09\u3002\u5728macOS\u5e94\u7528\u7a0b\u5e8f\u83dc\u5355\u4e2d\uff0c\u6bcf\u4e2a\u52a8\u4f5c\u90fd\u6709\u4e00\u4e2a\u89d2\u8272\uff0c\u8be5\u89d2\u8272\u6307\u793a\u4e86\u52a8\u4f5c\u5728\u83dc\u5355\u4e2d\u7684\u7528\u9014\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u6240\u6709\u52a8\u4f5c\n \u90fd\u5177\u6709TextHeuristicRole\u89d2\u8272\uff0c\u8fd9\u610f\u5473\u7740\u52a8\u4f5c\u662f\u6839\u636e\u5176\u6587\u672c\u5185\u5bb9\u88ab\u6dfb\u52a0\u5230\u83dc\u5355\u4e2d\u7684\"\"\"\n\n data: Optional[object] = None\n \"\"\"\u7528\u6237\u81ea\u5b9a\u4e49\u6570\u636e\u3002\"\"\"\n
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.auto_repeat","title":"auto_repeat: bool = True
class-attribute
instance-attribute
","text":"\u6b64\u5c5e\u6027\u8868\u793a\u52a8\u4f5c\uff08Action
\uff09\u662f\u5426\u53ef\u4ee5\u81ea\u52a8\u91cd\u590d\u3002\u5982\u679c\u8bbe\u7f6e\u4e3aTrue
\uff0c\u5e76\u4e14\u7cfb\u7edf\u542f\u7528\u4e86\u952e\u76d8\u81ea\u52a8\u91cd\u590d\u529f\u80fd\uff0c\u90a3\u4e48\u5f53\u7528\u6237\u6301\u7eed\u6309\u4e0b\u952e\u76d8\u5feb\u6377\u952e\u7ec4\u5408\u65f6\uff0c\u8be5\u52a8\u4f5c\u5c06\u81ea\u52a8\u91cd\u590d\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.checkable","title":"checkable: bool = False
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u662f\u5426\u4e3a\u53ef\u9009\u4e2d\u52a8\u4f5c
\u3002\u53ef\u9009\u4e2d\u52a8\u4f5c
\u5177\u6709\u9009\u4e2d
\u548c\u672a\u9009\u4e2d
\u4e24\u79cd\u72b6\u6001\uff0c\u5728\u72b6\u6001\u53d1\u751f\u5207\u6362\u65f6\uff0c\u5c06\u89e6\u53d1on_toggled
\u56de\u8c03\u51fd\u6570\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.checked","title":"checked: bool = False
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u662f\u5426\u5904\u4e8e\u9009\u4e2d
\u72b6\u6001\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.data","title":"data: Optional[object] = None
class-attribute
instance-attribute
","text":"\u7528\u6237\u81ea\u5b9a\u4e49\u6570\u636e\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.enabled","title":"enabled: bool = True
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u662f\u5426\u5904\u4e8e\u542f\u7528\u72b6\u6001\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.icon","title":"icon: IconType = None
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u7684\u56fe\u6807\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.icon_text","title":"icon_text: Optional[str] = None
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u7684\u56fe\u6807\u6587\u672c\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.menu_role","title":"menu_role: Optional[MenuRole] = None
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u83dc\u5355\u89d2\u8272\uff08menu role\uff09\u3002\u5728macOS\u5e94\u7528\u7a0b\u5e8f\u83dc\u5355\u4e2d\uff0c\u6bcf\u4e2a\u52a8\u4f5c\u90fd\u6709\u4e00\u4e2a\u89d2\u8272\uff0c\u8be5\u89d2\u8272\u6307\u793a\u4e86\u52a8\u4f5c\u5728\u83dc\u5355\u4e2d\u7684\u7528\u9014\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u6240\u6709\u52a8\u4f5c \u90fd\u5177\u6709TextHeuristicRole\u89d2\u8272\uff0c\u8fd9\u610f\u5473\u7740\u52a8\u4f5c\u662f\u6839\u636e\u5176\u6587\u672c\u5185\u5bb9\u88ab\u6dfb\u52a0\u5230\u83dc\u5355\u4e2d\u7684
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.on_toggled","title":"on_toggled: Optional[ActionToggledCallback] = None
class-attribute
instance-attribute
","text":"\u56de\u8c03\u51fd\u6570\uff0c\u5728\u52a8\u4f5c\uff08Action
\uff09\u7684checked
\u72b6\u6001\u53d1\u751f\u5207\u6362\u65f6\u56de\u8c03\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.on_triggered","title":"on_triggered: Optional[ActionTriggeredCallback] = None
class-attribute
instance-attribute
","text":"\u56de\u8c03\u51fd\u6570\uff0c\u5728\u52a8\u4f5c\uff08Action
\uff09\u88ab\u89e6\u53d1\u65f6\u56de\u8c03\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.priority","title":"priority: Optional[Priority] = None
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u5728\u7528\u6237\u754c\u9762\u7684\u4f18\u5148\u7ea7\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.shortcut","title":"shortcut: Optional[str] = None
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u7684\u5feb\u6377\u952e\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.shortcut_context","title":"shortcut_context: Optional[ShortcutContext] = None
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u5feb\u6377\u952e\u7684\u4e0a\u4e0b\u6587\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.status_tip","title":"status_tip: Optional[str] = None
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u7684\u72b6\u6001\u63d0\u793a\u6587\u672c\uff0c\u72b6\u6001\u63d0\u793a\u6587\u672c\u5c06\u663e\u793a\u5728\u52a8\u4f5c\u6240\u5728\u7a97\u53e3\u7684\u72b6\u6001\u680f\u4e2d\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.text","title":"text: str
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u7684\u63cf\u8ff0\u6027\u6587\u672c\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.tooltip","title":"tooltip: Optional[str] = None
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u7684\u5de5\u5177\u63d0\u793a\uff0c\u5de5\u5177\u63d0\u793a\u662f\u5728\u7528\u6237\u5c06\u9f20\u6807\u60ac\u505c\u5728\u52a8\u4f5c\u4e0a\u65f6\u663e\u793a\u7684\u989d\u5916\u4fe1\u606f\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.whats_this","title":"whats_this: Optional[str] = None
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u7684\u201cWhat\u2019s This?\u201d \u5e2e\u52a9\u6587\u672c\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Separator","title":"Separator
dataclass
","text":" Bases: object
\u4ee3\u8868\u4e86\u4e00\u4e2a\u5206\u5272\u7b26\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u7528\u5176\u6765\u5206\u5272\u5de5\u5177\u680f\u4e0a\u548c\u83dc\u5355\u680f\u4e0a\u7684\u52a8\u4f5c\uff08Action
\uff09
Source code in pyguiadapter\\action.py
@dataclasses.dataclass(frozen=True)\nclass Separator(object):\n \"\"\"\u4ee3\u8868\u4e86\u4e00\u4e2a\u5206\u5272\u7b26\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u7528\u5176\u6765\u5206\u5272\u5de5\u5177\u680f\u4e0a\u548c\u83dc\u5355\u680f\u4e0a\u7684\u52a8\u4f5c\uff08`Action`\uff09\"\"\"\n\n pass\n
"},{"location":"apis/pyguiadapter.action/#_1","title":"\u7c7b\u578b\u4e0e\u5e38\u91cf","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.ActionTriggeredCallback","title":"ActionTriggeredCallback = Callable[[BaseWindow_, Action_], None]
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.ActionToggledCallback","title":"ActionToggledCallback = Callable[[BaseWindow_, Action_, bool], None]
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Priority","title":"Priority = QAction.Priority
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.HighPriority","title":"HighPriority = QAction.HighPriority
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.NormalPriority","title":"NormalPriority = QAction.NormalPriority
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.LowPriority","title":"LowPriority = QAction.LowPriority
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.MenuRole","title":"MenuRole = QAction.MenuRole
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.NoRole","title":"NoRole = QAction.NoRole
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.TextHeuristicRole","title":"TextHeuristicRole = QAction.TextHeuristicRole
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.ApplicationSpecificRole","title":"ApplicationSpecificRole = QAction.ApplicationSpecificRole
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.AboutQtRole","title":"AboutQtRole = QAction.AboutQtRole
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.AboutRole","title":"AboutRole = QAction.AboutRole
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.PreferencesRole","title":"PreferencesRole = QAction.PreferencesRole
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.QuitRole","title":"QuitRole = QAction.QuitRole
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.ShortcutContext","title":"ShortcutContext = Qt.ShortcutContext
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.WidgetShortcut","title":"WidgetShortcut = Qt.WidgetShortcut
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.WidgetWithChildrenShortcut","title":"WidgetWithChildrenShortcut = Qt.WidgetWithChildrenShortcut
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.WindowShortcut","title":"WindowShortcut = Qt.WindowShortcut
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.ApplicationShortcut","title":"ApplicationShortcut = Qt.ApplicationShortcut
module-attribute
","text":""},{"location":"apis/pyguiadapter.adapter.adapter/","title":"pyguiadapter.adapter.adapter","text":""},{"location":"apis/pyguiadapter.adapter.adapter/#pyguiadapter.adapter.GUIAdapter","title":"GUIAdapter
","text":" Bases: object
GUI\u9002\u914d\u5668\u7c7b\uff0c\u8d1f\u8d23\u7ba1\u7406\u51fd\u6570\u548c\u542f\u52a8GUI\u5e94\u7528\u3002
"},{"location":"apis/pyguiadapter.adapter.adapter/#pyguiadapter.adapter.GUIAdapter.__init__","title":"__init__(*, hdpi_mode: bool = True, global_stylesheet: Union[str, Callable[[], str], None] = None, on_app_start: Optional[Callable[[QApplication], None]] = None, on_app_shutdown: Optional[Callable] = None)
","text":"GUIAdapter
\u6784\u9020\u51fd\u6570\u3002\u7528\u4e8e\u521b\u5efaGUIAdapter
\u5b9e\u4f8b\u3002
Parameters:
Name Type Description Default hdpi_mode
bool
\u542f\u7528\u9ad8DPI\u6a21\u5f0f\u3002\u67d0\u4e9bQt\u7248\u672c\u4e0a\uff0c\u8be5\u53c2\u6570\u4e0d\u751f\u6548\u3002
True
global_stylesheet
Union[str, Callable[[], str], None]
\u5e94\u7528\u5168\u5c40\u6837\u5f0f\u3002\u53ef\u4ee5\u4e3a\u6837\u5f0f\u8868\u5b57\u7b26\u4e32\uff0c\u4e5f\u53ef\u4ee5\u4e3a\u4e00\u4e2a\u8fd4\u56de\u5168\u5c40\u6837\u5f0f\u8868\u5b57\u7b26\u4e32\u7684\u51fd\u6570\u3002
None
on_app_start
Optional[Callable[[QApplication], None]]
\u5e94\u7528\u542f\u52a8\u56de\u8c03\u51fd\u6570\u3002\u5728\u5e94\u7528\u542f\u52a8\u65f6\u8c03\u7528\u3002
None
on_app_shutdown
Optional[Callable]
\u5e94\u7528\u505c\u6b62\u56de\u8c03\u51fd\u6570\u3002\u5728\u5e94\u7528\u505c\u6b62\u65f6\u8c03\u7528\u3002
None
Examples:
from pyguiadapter.adapter import GUIAdapter\n\ndef foo(a: int, b: int, c: str):\n pass\n\nadapter = GUIAdapter()\nadapter.add(foo)\nadapter.run()\n
"},{"location":"apis/pyguiadapter.adapter.adapter/#pyguiadapter.adapter.GUIAdapter.add","title":"add(fn: Callable, display_name: Optional[str] = None, group: Optional[str] = None, icon: IconType = None, document: Optional[str] = None, document_format: Literal['markdown', 'html', 'plaintext'] = 'markdown', cancelable: bool = False, *, widget_configs: Optional[Dict[str, Union[BaseParameterWidgetConfig, dict]]] = None, window_config: Optional[FnExecuteWindowConfig] = None, window_listener: Optional[BaseWindowEventListener] = None, window_toolbar: Optional[ToolBar] = None, window_menus: Optional[List[Union[Menu, Separator]]] = None) -> None
","text":"\u6dfb\u52a0\u4e00\u4e2a\u51fd\u6570\u3002
Parameters:
Name Type Description Default fn
Callable
\u5f85\u6dfb\u52a0\u7684\u51fd\u6570\u3002
required display_name
Optional[str]
\u51fd\u6570\u7684\u663e\u793a\u540d\u79f0\u3002\u5982\u679c\u4e0d\u6307\u5b9a\uff0c\u5219\u4f7f\u7528\u51fd\u6570\u7684\u540d\u79f0\u3002
None
group
Optional[str]
\u51fd\u6570\u6240\u5c5e\u7684\u5206\u7ec4\u3002\u5982\u679c\u4e0d\u6307\u5b9a\uff0c\u5219\u5c06\u51fd\u6570\u6dfb\u52a0\u5230\u9ed8\u8ba4\u5206\u7ec4\u3002
None
icon
IconType
\u51fd\u6570\u7684\u56fe\u6807\u3002\u53ef\u4ee5\u4e3a\u6587\u4ef6\u8def\u5f84\uff0c\u4e5f\u53ef\u4f7f\u7528QtAwesome\u652f\u6301\u7684\u56fe\u6807\u540d\u79f0\u3002
None
document
Optional[str]
\u51fd\u6570\u7684\u8bf4\u660e\u6587\u6863\u3002\u82e5\u4e0d\u6307\u5b9a\uff0c\u5219\u5c1d\u8bd5\u63d0\u53d6\u51fd\u6570\u7684docstring\u4f5c\u4e3a\u6587\u6863\u3002
None
document_format
Literal['markdown', 'html', 'plaintext']
\u51fd\u6570\u8bf4\u660e\u6587\u6863\u7684\u683c\u5f0f\u3002\u53ef\u4ee5\u4e3a\"markdown\"\u3001\"html\"\u6216\"plaintext\"\u3002
'markdown'
cancelable
bool
\u51fd\u6570\u662f\u5426\u53ef\u53d6\u6d88\u3002
False
widget_configs
Optional[Dict[str, Union[BaseParameterWidgetConfig, dict]]]
\u51fd\u6570\u53c2\u6570\u63a7\u4ef6\u914d\u7f6e\u3002\u952e\u4e3a\u53c2\u6570\u540d\uff0c\u503c\u4e3a\u53c2\u6570\u63a7\u4ef6\u914d\u7f6e\u3002
None
window_config
Optional[FnExecuteWindowConfig]
\u7a97\u53e3\u914d\u7f6e\u3002
None
window_listener
Optional[BaseWindowEventListener]
\u7a97\u53e3\u4e8b\u4ef6\u76d1\u542c\u5668\u3002
None
window_toolbar
Optional[ToolBar]
\u7a97\u53e3\u7684\u5de5\u5177\u680f\u3002
None
window_menus
Optional[List[Union[Menu, Separator]]]
\u7a97\u53e3\u83dc\u5355\u5217\u8868\u3002
None
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.adapter/#pyguiadapter.adapter.GUIAdapter.exists","title":"exists(fn: Callable) -> bool
","text":"\u5224\u65ad\u51fd\u6570\u662f\u5426\u5df2\u6dfb\u52a0\u3002
Parameters:
Name Type Description Default fn
Callable
\u76ee\u6807\u51fd\u6570
required Returns:
Type Description bool
\u51fd\u6570\u662f\u5426\u5df2\u6dfb\u52a0
"},{"location":"apis/pyguiadapter.adapter.adapter/#pyguiadapter.adapter.GUIAdapter.remove","title":"remove(fn: Callable) -> None
","text":"\u79fb\u9664\u4e00\u4e2a\u5df2\u6dfb\u52a0\u7684\u51fd\u6570\u3002
Parameters:
Name Type Description Default fn
Callable
\u5f85\u79fb\u9664\u7684\u51fd\u6570\u3002
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.adapter/#pyguiadapter.adapter.GUIAdapter.run","title":"run(argv: Optional[Sequence[str]] = None, *, show_select_window: bool = False, select_window_config: Optional[FnSelectWindowConfig] = None, select_window_listener: Optional[BaseWindowEventListener] = None, select_window_toolbar: Optional[ToolBar] = None, select_window_menus: Optional[List[Union[Menu, Separator]]] = None) -> None
","text":"\u542f\u52a8GUI\u5e94\u7528\u3002
Parameters:
Name Type Description Default argv
Optional[Sequence[str]]
\u4f20\u9012\u7ed9QApplication\u7684\u547d\u4ee4\u884c\u53c2\u6570\u3002
None
show_select_window
bool
\u662f\u5426\u5f3a\u5236\u663e\u793a\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff0c\u5f53\u6dfb\u52a0\u7684\u51fd\u6570\u6570\u91cf\u5927\u4e8e1\u65f6\uff0c\u9ed8\u8ba4\u663e\u793a\u3002
False
select_window_config
Optional[FnSelectWindowConfig]
\u51fd\u6570\u9009\u62e9\u7a97\u53e3\u914d\u7f6e\u3002
None
select_window_listener
Optional[BaseWindowEventListener]
\u51fd\u6570\u9009\u62e9\u7a97\u53e3\u4e8b\u4ef6\u76d1\u542c\u5668\u3002
None
select_window_toolbar
Optional[ToolBar]
\u51fd\u6570\u9009\u62e9\u7a97\u53e3\u7684\u5de5\u5177\u680f\u3002
None
select_window_menus
Optional[List[Union[Menu, Separator]]]
\u51fd\u6570\u9009\u62e9\u7a97\u53e3\u83dc\u5355\u5217\u8868\u3002
None
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.ubeep/","title":"pyguiadapter.adapter.ubeep","text":""},{"location":"apis/pyguiadapter.adapter.ubeep/#_1","title":"\u6a21\u5757\u7ea7\u65b9\u6cd5","text":""},{"location":"apis/pyguiadapter.adapter.ubeep/#pyguiadapter.adapter.ubeep.beep","title":"beep() -> None
","text":"\u53d1\u51fa\u8702\u9e23\u58f0\u3002
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uclipboard/","title":"pyguiadapter.adapter.uclipboard","text":""},{"location":"apis/pyguiadapter.adapter.uclipboard/#_1","title":"\u6a21\u5757\u7ea7\u65b9\u6cd5","text":""},{"location":"apis/pyguiadapter.adapter.uclipboard/#pyguiadapter.adapter.uclipboard.get_text","title":"get_text() -> Optional[str]
","text":"\u83b7\u53d6\u7cfb\u7edf\u526a\u8d34\u677f\u4e2d\u7684\u6587\u672c\u5185\u5bb9\u3002
Returns:
Type Description Optional[str]
\u7cfb\u7edf\u526a\u8d34\u677f\u4e2d\u5f53\u524d\u6587\u672c\uff0c\u5982\u679c\u526a\u8d34\u677f\u4e3a\u7a7a\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uclipboard/#pyguiadapter.adapter.uclipboard.set_text","title":"set_text(text: str) -> None
","text":"\u8bbe\u7f6e\u7cfb\u7edf\u526a\u8d34\u677f\u4e2d\u5f53\u524d\u6587\u672c\u3002
Parameters:
Name Type Description Default text
str
\u8981\u8bbe\u7f6e\u7684\u6587\u672c
required Returns: \u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.ucontext/","title":"pyguiadapter.adapter.ucontext","text":""},{"location":"apis/pyguiadapter.adapter.ucontext/#_1","title":"\u6a21\u5757\u7ea7\u65b9\u6cd5","text":""},{"location":"apis/pyguiadapter.adapter.ucontext/#pyguiadapter.adapter.ucontext.is_function_cancelled","title":"is_function_cancelled() -> bool
","text":"\u68c0\u6d4b\u51fd\u6570\u662f\u5426\u88ab\u7528\u6237\u53d6\u6d88\u3002
Returns:
Type Description bool
\u68c0\u6d4b\u5230\u7528\u6237\u53d1\u51fa\u53d6\u6d88\u51fd\u6570\u6267\u884c\u7684\u8bf7\u6c42\u65f6\u8fd4\u56deTrue
\uff0c\u5426\u5219\u8fd4\u56deFalse
"},{"location":"apis/pyguiadapter.adapter.udialog/","title":"pyguiadapter.adapter.udialog","text":""},{"location":"apis/pyguiadapter.adapter.udialog/#_1","title":"\u6a21\u5757\u7ea7\u65b9\u6cd5","text":""},{"location":"apis/pyguiadapter.adapter.udialog/#pyguiadapter.adapter.udialog.show_info_messagebox","title":"show_info_messagebox(text: str, title: str = 'Information', buttons: Union[StandardButton, int] = Ok, default_button: Union[StandardButton, int] = Ok, **kwargs) -> Union[int, StandardButton]
","text":"\u5f39\u51faInformation\u6d88\u606f\u5bf9\u8bdd\u6846\u3002
Parameters:
Name Type Description Default text
str
\u6d88\u606f\u6587\u672c
required title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Information'
buttons
Union[StandardButton, int]
\u5bf9\u8bdd\u6846\u7684\u6309\u94ae
Ok
default_button
Union[StandardButton, int]
\u9ed8\u8ba4\u6309\u94ae
Ok
**kwargs
\u5176\u4ed6\u53c2\u6570
{}
Returns:
Type Description Union[int, StandardButton]
\u8fd4\u56de\u7528\u6237\u6309\u4e0b\u7684\u6309\u94ae\u3002
"},{"location":"apis/pyguiadapter.adapter.udialog/#pyguiadapter.adapter.udialog.show_warning_messagebox","title":"show_warning_messagebox(text: str, title: str = 'Warning', buttons: Union[StandardButton, int] = Ok, default_button: Union[StandardButton, int] = Ok, **kwargs) -> Union[int, StandardButton]
","text":"\u5f39\u51faWarning\u6d88\u606f\u5bf9\u8bdd\u6846\u3002
Parameters:
Name Type Description Default text
str
\u6d88\u606f\u6587\u672c
required title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Warning'
buttons
Union[StandardButton, int]
\u5bf9\u8bdd\u6846\u7684\u6309\u94ae
Ok
default_button
Union[StandardButton, int]
\u9ed8\u8ba4\u6309\u94ae
Ok
**kwargs
\u5176\u4ed6\u53c2\u6570
{}
Returns:
Type Description Union[int, StandardButton]
\u8fd4\u56de\u7528\u6237\u6309\u4e0b\u7684\u6309\u94ae\u3002
"},{"location":"apis/pyguiadapter.adapter.udialog/#pyguiadapter.adapter.udialog.show_critical_messagebox","title":"show_critical_messagebox(text: str, title: str = 'Critical', buttons: Union[StandardButton, int] = Ok, default_button: Union[StandardButton, int] = NoButton, **kwargs) -> Union[int, StandardButton]
","text":"\u5f39\u51faCritical\u6d88\u606f\u5bf9\u8bdd\u6846\u3002
Parameters:
Name Type Description Default text
str
\u6d88\u606f\u6587\u672c
required title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Critical'
buttons
Union[StandardButton, int]
\u5bf9\u8bdd\u6846\u7684\u6309\u94ae
Ok
default_button
Union[StandardButton, int]
\u9ed8\u8ba4\u6309\u94ae
NoButton
**kwargs
\u5176\u4ed6\u53c2\u6570
{}
Returns:
Type Description Union[int, StandardButton]
\u8fd4\u56de\u7528\u6237\u6309\u4e0b\u7684\u6309\u94ae\u3002
"},{"location":"apis/pyguiadapter.adapter.udialog/#pyguiadapter.adapter.udialog.show_question_messagebox","title":"show_question_messagebox(text: str, title: str = 'Question', buttons: Union[StandardButton, int] = Yes | No, default_button: Union[StandardButton, int] = NoButton, **kwargs) -> Union[int, StandardButton]
","text":"\u5f39\u51faQuestion\u6d88\u606f\u5bf9\u8bdd\u6846\u3002
Parameters:
Name Type Description Default text
str
\u6d88\u606f\u6587\u672c
required title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Question'
buttons
Union[StandardButton, int]
\u5bf9\u8bdd\u6846\u7684\u6309\u94ae
Yes | No
default_button
Union[StandardButton, int]
\u9ed8\u8ba4\u6309\u94ae
NoButton
**kwargs
\u5176\u4ed6\u53c2\u6570
{}
Returns:
Type Description Union[int, StandardButton]
\u8fd4\u56de\u7528\u6237\u6309\u4e0b\u7684\u6309\u94ae\u3002
"},{"location":"apis/pyguiadapter.adapter.udialog/#pyguiadapter.adapter.udialog.show_text_content","title":"show_text_content(text_content: str, text_format: Literal['markdown', 'plaintext', 'html'] = 'markdown', size: Tuple[int, int] = None, title: Optional[str] = '', icon: IconType = None, buttons: Optional[DialogButtons] = DialogButtonOk, resizeable: bool = True) -> None
","text":"\u663e\u793a\u591a\u884c\u6587\u672c\u5185\u5bb9\u3002
Parameters:
Name Type Description Default text_content
str
\u6587\u672c\u5185\u5bb9
required text_format
Literal['markdown', 'plaintext', 'html']
\u6587\u672c\u683c\u5f0f
'markdown'
size
Tuple[int, int]
\u5bf9\u8bdd\u6846\u5c3a\u5bf8
None
title
Optional[str]
\u5bf9\u8bdd\u6846\u6807\u9898
''
icon
IconType
\u5bf9\u8bdd\u6846\u56fe\u6807
None
buttons
Optional[DialogButtons]
\u5bf9\u8bdd\u6846\u6309\u94ae
DialogButtonOk
resizeable
bool
\u5bf9\u8bdd\u6846\u662f\u5426\u53ef\u8c03\u6574\u5927\u5c0f
True
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.udialog/#pyguiadapter.adapter.udialog.show_text_file","title":"show_text_file(text_file: str, text_format: Literal['markdown', 'plaintext', 'html'] = 'markdown', size: Tuple[int, int] = None, title: Optional[str] = '', icon: IconType = None, buttons: Optional[DialogButtons] = DialogButtonOk, resizeable: bool = True) -> None
","text":"\u5c55\u793a\u6587\u672c\u6587\u4ef6\u5185\u5bb9\u3002
Parameters:
Name Type Description Default text_file
str
\u6587\u672c\u6587\u4ef6\u8def\u5f84
required text_format
Literal['markdown', 'plaintext', 'html']
\u6587\u672c\u6587\u4ef6\u683c\u5f0f
'markdown'
size
Tuple[int, int]
\u5bf9\u8bdd\u6846\u5c3a\u5bf8
None
title
Optional[str]
\u5bf9\u8bdd\u6846\u6807\u9898
''
icon
IconType
\u5bf9\u8bdd\u6846\u56fe\u6807
None
buttons
Optional[DialogButtons]
\u5bf9\u8bdd\u6846\u6309\u94ae
DialogButtonOk
resizeable
bool
\u5bf9\u8bdd\u6846\u662f\u5426\u53ef\u8c03\u6574\u5927\u5c0f
True
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.udialog/#pyguiadapter.adapter.udialog.show_custom_dialog","title":"show_custom_dialog(dialog_class: Type[BaseCustomDialog], **kwargs) -> Any
","text":"\u5f39\u51fa\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846\u3002
Parameters:
Name Type Description Default dialog_class
Type[BaseCustomDialog]
\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846\u7c7b
required **kwargs
\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846\u521d\u59cb\u5316\u53c2\u6570
{}
Returns:
Type Description Any
\u8fd4\u56de\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846show_and_get_result()
\u51fd\u6570\u7684\u8fd4\u56de\u503c\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/","title":"pyguiadapter.adapter.uinput","text":""},{"location":"apis/pyguiadapter.adapter.uinput/#_1","title":"\u6a21\u5757\u7ea7\u65b9\u6cd5","text":""},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_string","title":"get_string(title: str = 'Input Text', label: str = '', echo: Optional[EchoMode] = None, text: str = '') -> Optional[str]
","text":"\u5f39\u51fa\u5355\u884c\u6587\u672c\u8f93\u5165\u6846\uff0c\u8fd4\u56de\u7528\u6237\u8f93\u5165\u7684\u5b57\u7b26\u4e32\u3002
Parameters:
Name Type Description Default title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Input Text'
label
str
\u63d0\u793a\u6807\u7b7e
''
echo
Optional[EchoMode]
\u56de\u663e\u6a21\u5f0f
None
text
str
\u521d\u59cb\u6587\u672c
''
Returns:
Type Description Optional[str]
\u7528\u6237\u8f93\u5165\u7684\u5b57\u7b26\u4e32\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_text","title":"get_text(title: str = 'Input Text', label: str = '', text: str = '') -> Optional[str]
","text":"\u5f39\u51fa\u591a\u884c\u6587\u672c\u8f93\u5165\u6846\uff0c\u8fd4\u56de\u7528\u6237\u8f93\u5165\u7684\u5b57\u7b26\u4e32\u3002
Parameters:
Name Type Description Default title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Input Text'
label
str
\u63d0\u793a\u6807\u7b7e
''
text
str
\u521d\u59cb\u6587\u672c
''
Returns:
Type Description Optional[str]
\u7528\u6237\u8f93\u5165\u7684\u5b57\u7b26\u4e32\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_int","title":"get_int(title: str = 'Input Integer', label: str = '', value: int = 0, min_value: int = -2147483647, max_value: int = 2147483647, step: int = 1) -> Optional[int]
","text":"\u5f39\u51fa\u6574\u6570\u8f93\u5165\u6846\uff0c\u8fd4\u56de\u7528\u6237\u8f93\u5165\u7684\u6574\u6570\u3002
Parameters:
Name Type Description Default title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Input Integer'
label
str
\u63d0\u793a\u6807\u7b7e
''
value
int
\u521d\u59cb\u503c
0
min_value
int
\u6700\u5c0f\u503c
-2147483647
max_value
int
\u6700\u5927\u503c
2147483647
step
int
\u6b65\u957f
1
Returns:
Type Description Optional[int]
\u7528\u6237\u8f93\u5165\u7684\u6574\u6570\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_float","title":"get_float(title: str = 'Input Float', label: str = '', value: float = 0.0, min_value: float = -2147483647.0, max_value: float = 2147483647.0, decimals: int = 3, step: float = 1.0) -> Optional[float]
","text":"\u5f39\u51fa\u6d6e\u70b9\u6570\u8f93\u5165\u6846\uff0c\u8fd4\u56de\u7528\u6237\u8f93\u5165\u7684\u6d6e\u70b9\u6570\u3002
Parameters:
Name Type Description Default title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Input Float'
label
str
\u63d0\u793a\u6807\u7b7e
''
value
float
\u521d\u59cb\u503c
0.0
min_value
float
\u6700\u5c0f\u503c
-2147483647.0
max_value
float
\u6700\u5927\u503c
2147483647.0
decimals
int
\u5c0f\u6570\u4f4d\u6570
3
step
float
\u6b65\u957f
1.0
Returns:
Type Description Optional[float]
\u7528\u6237\u8f93\u5165\u7684\u6d6e\u70b9\u6570\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_selected_item","title":"get_selected_item(items: List[str], title: str = 'Select Item', label: str = '', current: int = 0, editable: bool = False) -> Optional[str]
","text":"\u5f39\u51fa\u9009\u9879\u5217\u8868\uff0c\u8fd4\u56de\u7528\u6237\u9009\u62e9\u7684\u9879\u76ee\u3002
Parameters:
Name Type Description Default items
List[str]
\u9879\u76ee\u5217\u8868
required title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Select Item'
label
str
\u63d0\u793a\u6807\u7b7e
''
current
int
\u5f53\u524d\u9009\u62e9\u9879\u7d22\u5f15
0
editable
bool
\u662f\u5426\u53ef\u7f16\u8f91
False
Returns:
Type Description Optional[str]
\u7528\u6237\u9009\u62e9\u7684\u9879\u76ee\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_json_object","title":"get_json_object(title: str = 'Input Json', icon: IconType = None, size: Tuple[int, int] = (600, 400), ok_button_text: str = 'Ok', cancel_button_text: Optional[str] = 'Cancel', initial_text: str = '', auto_indent: bool = True, indent_size: int = 4, auto_parentheses: bool = True, line_wrap_mode: LineWrapMode = LineWrapMode.WidgetWidth, line_wrap_width: int = 88, font_family: Union[str, Sequence[str], None] = None, font_size: Optional[int] = None, **kwargs) -> Any
","text":"\u5f39\u51faJson\u8f93\u5165\u6846\uff0c\u8fd4\u56de\u7528\u6237\u8f93\u5165\u7684Json\u5bf9\u8c61\u3002
Parameters:
Name Type Description Default title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Input Json'
icon
IconType
\u7a97\u53e3\u56fe\u6807
None
size
Tuple[int, int]
\u7a97\u53e3\u5927\u5c0f
(600, 400)
ok_button_text
str
\u786e\u5b9a\u6309\u94ae\u6587\u672c
'Ok'
cancel_button_text
Optional[str]
\u53d6\u6d88\u6309\u94ae\u6587\u672c
'Cancel'
initial_text
str
\u521d\u59cb\u6587\u672c
''
auto_indent
bool
\u662f\u5426\u81ea\u52a8\u7f29\u8fdb
True
indent_size
int
\u7f29\u8fdb\u5927\u5c0f
4
auto_parentheses
bool
\u662f\u5426\u81ea\u52a8\u5339\u914d\u62ec\u53f7
True
line_wrap_mode
LineWrapMode
\u6362\u884c\u6a21\u5f0f
WidgetWidth
line_wrap_width
int
\u6362\u884c\u5bbd\u5ea6
88
font_family
Union[str, Sequence[str], None]
\u5b57\u4f53
None
font_size
Optional[int]
\u5b57\u4f53\u5927\u5c0f
None
**kwargs
\u5176\u4ed6\u53c2\u6570
{}
Returns:
Type Description Any
\u7528\u6237\u8f93\u5165\u7684Json\u5bf9\u8c61\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
Raises:
Type Description Exception
\u5982\u679c\u8f93\u5165\u4e86\u975e\u6cd5\u7684Json\u6587\u672c\uff0c\u5219\u4f1a\u629b\u51fa\u5f02\u5e38\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_py_literal","title":"get_py_literal(title: str = 'Input Python Literal', icon: IconType = None, size: Tuple[int, int] = (600, 400), ok_button_text: str = 'Ok', cancel_button_text: Optional[str] = 'Cancel', initial_text: str = '', auto_indent: bool = True, indent_size: int = 4, auto_parentheses: bool = True, line_wrap_mode: LineWrapMode = LineWrapMode.WidgetWidth, line_wrap_width: int = 88, font_family: Union[str, Sequence[str], None] = None, font_size: Optional[int] = None, **kwargs) -> PyLiteralType
","text":"\u5f39\u51faPython\u5b57\u9762\u91cf\u8f93\u5165\u6846\uff0c\u8fd4\u56de\u7528\u6237\u8f93\u5165\u7684Python\u5b57\u9762\u91cf\u3002
Parameters:
Name Type Description Default title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Input Python Literal'
icon
IconType
\u7a97\u53e3\u56fe\u6807
None
size
Tuple[int, int]
\u7a97\u53e3\u5927\u5c0f
(600, 400)
ok_button_text
str
\u786e\u5b9a\u6309\u94ae\u6587\u672c
'Ok'
cancel_button_text
Optional[str]
\u53d6\u6d88\u6309\u94ae\u6587\u672c
'Cancel'
initial_text
str
\u521d\u59cb\u6587\u672c
''
auto_indent
bool
\u662f\u5426\u81ea\u52a8\u7f29\u8fdb
True
indent_size
int
\u7f29\u8fdb\u5927\u5c0f
4
auto_parentheses
bool
\u662f\u5426\u81ea\u52a8\u5339\u914d\u62ec\u53f7
True
line_wrap_mode
LineWrapMode
\u6362\u884c\u6a21\u5f0f
WidgetWidth
line_wrap_width
int
\u6362\u884c\u5bbd\u5ea6
88
font_family
Union[str, Sequence[str], None]
\u5b57\u4f53
None
font_size
Optional[int]
\u5b57\u4f53\u5927\u5c0f
None
**kwargs
\u5176\u4ed6\u53c2\u6570
{}
Returns:
Type Description PyLiteralType
\u7528\u6237\u8f93\u5165\u7684Python\u5b57\u9762\u91cf\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
Raises:
Type Description Exception
\u5982\u679c\u8f93\u5165\u4e86\u975e\u6cd5\u7684Python\u5b57\u9762\u91cf\uff08\u5373ast.literal_eval()\u65e0\u6cd5\u89e3\u6790\u7684\u5185\u5bb9\uff09\uff0c\u5219\u4f1a\u629b\u51fa\u5f02\u5e38\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_existing_directory","title":"get_existing_directory(title: str = '', start_dir: str = '') -> Optional[str]
","text":"\u5f39\u51fa\u9009\u62e9\u6587\u4ef6\u5939\u5bf9\u8bdd\u6846\uff0c\u8fd4\u56de\u7528\u6237\u9009\u62e9\u7684\u76ee\u5f55\u3002
Parameters:
Name Type Description Default title
str
\u5bf9\u8bdd\u6846\u6807\u9898
''
start_dir
str
\u8d77\u59cb\u76ee\u5f55
''
Returns:
Type Description Optional[str]
\u7528\u6237\u9009\u62e9\u7684\u76ee\u5f55\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_open_file","title":"get_open_file(title: str = '', start_dir: str = '', filters: str = '') -> Optional[str]
","text":"\u5f39\u51fa\u6253\u5f00\u6587\u4ef6\u5bf9\u8bdd\u6846\uff0c\u8fd4\u56de\u7528\u6237\u9009\u62e9\u7684\u6587\u4ef6\u3002
Parameters:
Name Type Description Default title
str
\u5bf9\u8bdd\u6846\u6807\u9898
''
start_dir
str
\u8d77\u59cb\u76ee\u5f55
''
filters
str
\u6587\u4ef6\u8fc7\u6ee4\u5668
''
Returns:
Type Description Optional[str]
\u7528\u6237\u9009\u62e9\u7684\u6587\u4ef6\u8def\u5f84\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_open_files","title":"get_open_files(title: str = '', start_dir: str = '', filters: str = '') -> Optional[List[str]]
","text":"\u5f39\u51fa\u6253\u5f00\u6587\u4ef6\u5bf9\u8bdd\u6846\uff0c\u8fd4\u56de\u7528\u6237\u9009\u62e9\u7684\u591a\u4e2a\u6587\u4ef6\u3002 Args: title: \u5bf9\u8bdd\u6846\u6807\u9898 start_dir: \u8d77\u59cb\u76ee\u5f55 filters: \u6587\u4ef6\u8fc7\u6ee4\u5668
Returns:
Type Description Optional[List[str]]
\u7528\u6237\u9009\u62e9\u7684\u6587\u4ef6\u8def\u5f84\u5217\u8868\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_save_file","title":"get_save_file(title: str = '', start_dir: str = '', filters: str = '') -> Optional[str]
","text":"\u5f39\u51fa\u4fdd\u5b58\u6587\u4ef6\u5bf9\u8bdd\u6846\uff0c\u8fd4\u56de\u7528\u6237\u8f93\u5165\u6216\u9009\u62e9\u7684\u6587\u4ef6\u8def\u5f84\u3002
Parameters:
Name Type Description Default title
str
\u5bf9\u8bdd\u6846\u6807\u9898
''
start_dir
str
\u8d77\u59cb\u76ee\u5f55
''
filters
str
\u6587\u4ef6\u8fc7\u6ee4\u5668
''
Returns:
Type Description Optional[str]
\u7528\u6237\u8f93\u5165\u6216\u9009\u62e9\u7684\u6587\u4ef6\u8def\u5f84\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_custom_input","title":"get_custom_input(input_dialog_class: Type[UniversalInputDialog], **input_dialog_args) -> Any
","text":"\u5f39\u51fa\u81ea\u5b9a\u4e49\u8f93\u5165\u6846\uff0c\u8fd4\u56de\u7528\u6237\u8f93\u5165\u7684\u5185\u5bb9\u3002
Parameters:
Name Type Description Default input_dialog_class
Type[UniversalInputDialog]
\u81ea\u5b9a\u4e49\u8f93\u5165\u6846\u7c7b
required **input_dialog_args
\u81ea\u5b9a\u4e49\u8f93\u5165\u6846\u53c2\u6570
{}
Returns:
Type Description Any
\u7528\u6237\u8f93\u5165\u7684\u5185\u5bb9\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uoutput/","title":"pyguiadapter.adapter.uoutput","text":""},{"location":"apis/pyguiadapter.adapter.uoutput/#_1","title":"\u6a21\u5757\u7ea7\u65b9\u6cd5","text":""},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.uprint","title":"uprint(*args: Any, sep: str = ' ', end: str = '\\n', html: bool = False, scroll_to_bottom: bool = True) -> None
","text":"\u6253\u5370\u4fe1\u606f\u5230\u8f93\u51fa\u6d4f\u89c8\u5668
Parameters:
Name Type Description Default *args
Any
\u8981\u6253\u5370\u7684\u4fe1\u606f
()
sep
str
\u6bcf\u6761\u4fe1\u606f\u4e4b\u95f4\u7684\u5206\u9694\u5b57\u7b26\u4e32
' '
end
str
\u6dfb\u52a0\u5230\u6700\u540e\u4e00\u6761\u4fe1\u606f\u540e\u9762\u7684\u5b57\u7b26\u4e32
'\\n'
html
bool
\u8981\u6253\u5370\u7684\u4fe1\u606f\u662f\u5426\u4e3ahtml
\u683c\u5f0f
False
scroll_to_bottom
bool
\u6253\u5370\u4fe1\u606f\u540e\u662f\u5426\u5c06\u8f93\u51fa\u6d4f\u89c8\u5668
\u6eda\u52a8\u5230\u6700\u5e95\u90e8
True
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.clear_output","title":"clear_output() -> None
","text":"\u6e05\u9664\u8f93\u51fa\u6d4f\u89c8\u5668
\u4e2d\u6240\u6709\u5185\u5bb9
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.print_image","title":"print_image(img: Union[str, bytes], img_type: str = 'jpeg', embed_base64: bool = False, width: Optional[int] = None, height: Optional[int] = None, centered: bool = True) -> None
","text":"\u6a21\u5757\u7ea7\u51fd\u6570\u3002\u6253\u5370\u56fe\u7247\u3002
Parameters:
Name Type Description Default img
Union[str, bytes]
\u5f85\u6253\u5370\u7684\u56fe\u7247\u3002\u53ef\u4ee5\u4e3a\u56fe\u7247\u6587\u4ef6\u7684\u8def\u5f84\uff08str
\uff09\u6216\u56fe\u7247\u7684\u4e8c\u8fdb\u5236\u6570\u636e\uff08bytes
\uff09
required img_type
str
\u56fe\u7247\u7c7b\u578b\u3002
'jpeg'
embed_base64
bool
\u662f\u5426\u4f7f\u7528data url
\uff08base64\u683c\u5f0f
\uff09\u5d4c\u5165\u56fe\u7247\u3002\u4f20\u5165\u4e8c\u8fdb\u5236\u56fe\u7247\u6570\u636e\u65f6\uff0c\u5c06\u5ffd\u7565\u6b64\u53c2\u6570\u3002
False
width
Optional[int]
\u56fe\u7247\u7684\u5bbd\u5ea6\u3002\u82e5\u672a\u6307\u5b9a\uff0c\u5219\u663e\u793a\u56fe\u7247\u7684\u539f\u59cb\u5bbd\u5ea6\u3002
None
height
Optional[int]
\u56fe\u7247\u7684\u9ad8\u5ea6\u3002\u82e5\u672a\u6307\u5b9a\uff0c\u5219\u663e\u793a\u56fe\u7247\u7684\u539f\u59cb\u9ad8\u5ea6\u3002
None
centered
bool
\u662f\u5426\u5c06\u56fe\u7247\u5c45\u4e2d\u663e\u793a\u3002
True
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c\u3002
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.info","title":"info(msg: str) -> None
","text":"\u6a21\u5757\u7ea7\u51fd\u6570\u3002\u6253\u5370info
\u7ea7\u522b\u7684\u6d88\u606f\u3002info
\u6d88\u606f\u989c\u8272\u503c\u9ed8\u8ba4\u4e3a\uff1a#00FF00
\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.debug","title":"debug(msg: str) -> None
","text":"\u6a21\u5757\u7ea7\u51fd\u6570\u3002\u6253\u5370debug
\u7ea7\u522b\u7684\u6d88\u606f\u3002debug
\u6d88\u606f\u989c\u8272\u503c\u9ed8\u8ba4\u4e3a\uff1a#909399
\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.warning","title":"warning(msg: str) -> None
","text":"\u6a21\u5757\u7ea7\u51fd\u6570\u3002\u6253\u5370warning
\u7ea7\u522b\u7684\u6d88\u606f\u3002warning
\u6d88\u606f\u989c\u8272\u503c\u9ed8\u8ba4\u4e3a\uff1a#FFFF00
\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.critical","title":"critical(msg: str) -> None
","text":"\u6a21\u5757\u7ea7\u51fd\u6570\u3002\u6253\u5370critical
\u7ea7\u522b\u7684\u6d88\u606f\u3002critical
\u6d88\u606f\u989c\u8272\u503c\u9ed8\u8ba4\u4e3a\uff1a#A61C00
\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.fatal","title":"fatal(msg: str) -> None
","text":"\u6a21\u5757\u7ea7\u51fd\u6570\u3002\u6253\u5370fatal
\u7ea7\u522b\u7684\u6d88\u606f\u3002fatal
\u6d88\u606f\u989c\u8272\u503c\u9ed8\u8ba4\u4e3a\uff1a#FF0000
\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.Logger","title":"Logger
","text":" Bases: object
\u8be5\u7c7b\u7528\u4e8e\u5411\u51fd\u6570\u6267\u884c\u7a97\u53e3\u7684\u8f93\u51fa\u6d4f\u89c8\u5668
\u533a\u57df\u6253\u5370\u65e5\u5fd7\u6d88\u606f\u3002\u4e0d\u540c\u7ea7\u522b\u7684\u65e5\u5fd7\u6d88\u606f\uff0c\u4e3b\u8981\u4ee5\u989c\u8272\u8fdb\u884c\u533a\u5206\u3002\u53ef\u4ee5\u4f7f\u7528LoggerConfig
\u5b9e\u4f8b\u6307\u5b9a\u5404\u6d88\u606f\u7ea7\u522b\u7684\u989c\u8272\u503c\u3002
\u793a\u4f8b:
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import Logger, LoggerConfig\n\nlogger = Logger(\n config=LoggerConfig(\n info_color=\"green\",\n debug_color=\"blue\",\n warning_color=\"yellow\",\n critical_color=\"red\",\n fatal_color=\"magenta\",\n )\n)\n\n\ndef output_log_msg(\n info_msg: str = \"info message\",\n debug_msg: str = \"debug message\",\n warning_msg: str = \"warning message\",\n critical_msg: str = \"critical message\",\n fatal_msg: str = \"fatal message\",\n):\n\n logger.info(info_msg)\n logger.debug(debug_msg)\n logger.warning(warning_msg)\n logger.critical(critical_msg)\n logger.fatal(fatal_msg)\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(output_log_msg)\n adapter.run()\n
\u7ed3\u679c\uff1a
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.Logger.critical","title":"critical(msg: str) -> None
","text":"\u6253\u5370critical
\u7ea7\u522b\u7684\u6d88\u606f\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.Logger.debug","title":"debug(msg: str) -> None
","text":"\u6253\u5370debug
\u7ea7\u522b\u7684\u6d88\u606f\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.Logger.fatal","title":"fatal(msg: str) -> None
","text":"\u6253\u5370fatal
\u7ea7\u522b\u7684\u6d88\u606f\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.Logger.info","title":"info(msg: str) -> None
","text":"\u6253\u5370info
\u7ea7\u522b\u7684\u6d88\u606f\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.Logger.warning","title":"warning(msg: str) -> None
","text":"\u6253\u5370warning
\u7ea7\u522b\u7684\u6d88\u606f\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.LoggerConfig","title":"LoggerConfig
dataclass
","text":" Bases: object
Logger
\u7684\u914d\u7f6e\u7c7b\uff0c\u7528\u4e8e\u914d\u7f6eLogger
\u7684\u989c\u8272\u7b49\u5c5e\u6027\u3002
Source code in pyguiadapter\\adapter\\uoutput.py
@dataclasses.dataclass\nclass LoggerConfig(object):\n \"\"\"\n `Logger`\u7684\u914d\u7f6e\u7c7b\uff0c\u7528\u4e8e\u914d\u7f6e`Logger`\u7684\u989c\u8272\u7b49\u5c5e\u6027\u3002\n \"\"\"\n\n info_color: str = COLOR_INFO\n \"\"\"`info`\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c\"\"\"\n\n debug_color: str = COLOR_DEBUG\n \"\"\"`debug`\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c\"\"\"\n\n warning_color: str = COLOR_WARNING\n \"\"\"`warning`\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c\"\"\"\n\n critical_color: str = COLOR_CRITICAL\n \"\"\"`critical`\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c\"\"\"\n\n fatal_color: str = COLOR_FATAL\n \"\"\"`fatal`\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c\"\"\"\n
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.LoggerConfig.critical_color","title":"critical_color: str = COLOR_CRITICAL
class-attribute
instance-attribute
","text":"critical
\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.LoggerConfig.debug_color","title":"debug_color: str = COLOR_DEBUG
class-attribute
instance-attribute
","text":"debug
\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.LoggerConfig.fatal_color","title":"fatal_color: str = COLOR_FATAL
class-attribute
instance-attribute
","text":"fatal
\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.LoggerConfig.info_color","title":"info_color: str = COLOR_INFO
class-attribute
instance-attribute
","text":"info
\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.LoggerConfig.warning_color","title":"warning_color: str = COLOR_WARNING
class-attribute
instance-attribute
","text":"warning
\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c
"},{"location":"apis/pyguiadapter.adapter.uprogress/","title":"pyguiadapter.adapter.uprogress","text":""},{"location":"apis/pyguiadapter.adapter.uprogress/#_1","title":"\u6a21\u5757\u7ea7\u65b9\u6cd5","text":""},{"location":"apis/pyguiadapter.adapter.uprogress/#pyguiadapter.adapter.uprogress.show_progressbar","title":"show_progressbar(min_value: int = 0, max_value: int = 100, inverted_appearance: bool = False, *, message_visible: bool = False, message_format: str = '%p%', message_centered: str = True, info_visible: bool = True, info_centered: bool = True, info_text_format: Literal['richtext', 'markdown', 'plaintext', 'autotext'] = 'autotext', initial_info: str = '') -> None
","text":"\u663e\u793a\u8fdb\u5ea6\u6761\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8fdb\u5ea6\u6761\u5904\u4e8e\u9690\u85cf\u72b6\u6001\uff0c\u5f00\u53d1\u8005\u5fc5\u987b\u624b\u52a8\u8c03\u7528\u6b64\u51fd\u6570\u6765\u663e\u793a\u8fdb\u5ea6\u6761\uff0c\u6b64\u51fd\u6570\u9664\u4e86\u7528\u4e8e\u663e\u793a\u8fdb\u5ea6\u6761\uff0c\u8fd8\u53ef\u4ee5\u5bf9\u8fdb\u5ea6\u6761\u8fdb\u884c\u914d\u7f6e\u3002
Parameters:
Name Type Description Default min_value
int
\u6700\u5c0f\u8fdb\u5ea6\u503c\uff0c\u9ed8\u8ba4\u4e3a0
0
max_value
int
\u6700\u5927\u8fdb\u5ea6\u503c\uff0c\u9ed8\u8ba4\u4e3a100
100
inverted_appearance
bool
\u662f\u5426\u6539\u53d8\u8fdb\u5ea6\u6761\u7684\u663e\u793a\u65b9\u5f0f\uff0c\u4f7f\u5176\u4ee5\u53cd\u65b9\u5411\u663e\u793a\u8fdb\u5ea6
False
message_visible
bool
\u662f\u5426\u663e\u793amessage\u4fe1\u606f
False
message_format
str
message\u4fe1\u606f\u7684\u683c\u5f0f\uff0c\u652f\u6301\uff1a%p%
\uff08\u663e\u793a\u5b8c\u6210\u7684\u767e\u5206\u6bd4\uff0c\u8fd9\u662f\u9ed8\u8ba4\u663e\u793a\u65b9\u5f0f\uff09\u3001%v
\uff08\u663e\u793a\u5f53\u524d\u7684\u8fdb\u5ea6\u503c\uff09\u548c%m
\uff08\u663e\u793a\u603b\u7684\u6b65\u8fdb\u503c\uff09
'%p%'
message_centered
str
message\u4fe1\u606f\u662f\u5426\u5c45\u4e2d\u663e\u793a
True
info_visible
bool
\u662f\u5426\u663e\u793ainfo\u533a\u57df
True
info_centered
bool
info\u4fe1\u606f\u662f\u5426\u5c45\u4e2d\u663e\u793a
True
info_text_format
Literal['richtext', 'markdown', 'plaintext', 'autotext']
info\u4fe1\u606f\u7684\u6587\u672c\u683c\u5f0f\uff0c\u652f\u6301\"richtext\"
\u3001\"markdown\"
\u3001\"plaintext\"
\u3001\"autotext\"
'autotext'
initial_info
str
info\u4fe1\u606f\u7684\u521d\u59cb\u503c
''
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uprogress/#pyguiadapter.adapter.uprogress.hide_progressbar","title":"hide_progressbar() -> None
","text":"\u9690\u85cf\u8fdb\u5ea6\u6761
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uprogress/#pyguiadapter.adapter.uprogress.update_progress","title":"update_progress(value: int, info: Optional[str] = None) -> None
","text":"\u66f4\u65b0\u8fdb\u5ea6\u4fe1\u606f
Parameters:
Name Type Description Default value
int
\u5f53\u524d\u8fdb\u5ea6\u503c
required info
Optional[str]
\u5f53\u524dinfo\u6587\u672c
None
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uprogress/#pyguiadapter.adapter.uprogress.show_progress_dialog","title":"show_progress_dialog(min_value: int = 0, max_value: int = 100, inverted_appearance: bool = False, *, message_visible: bool = False, message_format: str = '%p%', message_centered: str = True, info_visible: bool = True, info_centered: bool = True, info_text_format: Literal['richtext', 'markdown', 'plaintext', 'autotext'] = 'autotext', initial_info: str = '', title: str = 'Progress', size: tuple = (400, 150), modal: bool = True) -> None
","text":"\u663e\u793a\u8fdb\u5ea6\u5bf9\u8bdd\u6846\u3002\u5f00\u53d1\u8005\u5fc5\u987b\u624b\u52a8\u8c03\u7528\u6b64\u51fd\u6570\u6765\u663e\u793a\u8fdb\u5ea6\u5bf9\u8bdd\u6846\uff0c\u6b64\u51fd\u6570\u9664\u4e86\u7528\u4e8e\u663e\u793a\u8fdb\u5ea6\u5bf9\u8bdd\u6846\uff0c \u8fd8\u7528\u4e8e\u5bf9\u8fdb\u5ea6\u5bf9\u8bdd\u6846\u8fdb\u884c\u914d\u7f6e\u3002
Parameters:
Name Type Description Default min_value
int
\u6700\u5c0f\u8fdb\u5ea6\u503c\uff0c\u9ed8\u8ba4\u4e3a0
0
max_value
int
\u6700\u5927\u8fdb\u5ea6\u503c\uff0c\u9ed8\u8ba4\u4e3a100
100
inverted_appearance
bool
\u662f\u5426\u6539\u53d8\u8fdb\u5ea6\u6761\u7684\u663e\u793a\u65b9\u5f0f\uff0c\u4f7f\u5176\u4ee5\u53cd\u65b9\u5411\u663e\u793a\u8fdb\u5ea6
False
message_visible
bool
\u662f\u5426\u663e\u793amessage\u4fe1\u606f
False
message_format
str
message\u4fe1\u606f\u7684\u683c\u5f0f\uff0c\u652f\u6301\uff1a%p%
\uff08\u663e\u793a\u5b8c\u6210\u7684\u767e\u5206\u6bd4\uff0c\u8fd9\u662f\u9ed8\u8ba4\u663e\u793a\u65b9\u5f0f\uff09\u3001%v
\uff08\u663e\u793a\u5f53\u524d\u7684\u8fdb\u5ea6\u503c\uff09\u548c%m
\uff08\u663e\u793a\u603b\u7684\u6b65\u8fdb\u503c\uff09
'%p%'
message_centered
str
message\u4fe1\u606f\u662f\u5426\u5c45\u4e2d\u663e\u793a
True
info_visible
bool
\u662f\u5426\u663e\u793ainfo\u4fe1\u606f
True
info_centered
bool
info\u4fe1\u606f\u662f\u5426\u5c45\u4e2d\u663e\u793a
True
info_text_format
Literal['richtext', 'markdown', 'plaintext', 'autotext']
info\u4fe1\u606f\u7684\u6587\u672c\u683c\u5f0f\uff0c\u652f\u6301\"richtext\"
\u3001\"markdown\"
\u3001\"plaintext\"
\u3001\"autotext\"
'autotext'
initial_info
str
info\u4fe1\u606f\u7684\u521d\u59cb\u503c
''
title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Progress'
size
tuple
\u5bf9\u8bdd\u6846\u5927\u5c0f
(400, 150)
modal
bool
\u662f\u5426\u4e3a\u6a21\u6001\u5bf9\u8bdd\u6846
True
Returns: \u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uprogress/#pyguiadapter.adapter.uprogress.dismiss_progress_dialog","title":"dismiss_progress_dialog() -> None
","text":"\u5173\u95ed\u8fdb\u5ea6\u5bf9\u8bdd\u6846
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uprogress/#pyguiadapter.adapter.uprogress.update_progress_dialog","title":"update_progress_dialog(value: int, info: Optional[str] = None) -> None
","text":"\u66f4\u65b0\u8fdb\u5ea6\u5bf9\u8bdd\u6846
Parameters:
Name Type Description Default value
int
\u5f53\u524d\u8fdb\u5ea6\u503c
required info
Optional[str]
\u5f53\u524dinfo\u6587\u672c
None
Returns: \u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.useful/","title":"pyguiadapter.adapter.useful","text":""},{"location":"apis/pyguiadapter.adapter.useful/#_1","title":"\u6a21\u5757\u7ea7\u65b9\u6cd5","text":""},{"location":"apis/pyguiadapter.adapter.useful/#pyguiadapter.adapter.useful.highlight_parameter","title":"highlight_parameter(parameter_name: str) -> None
","text":"\u9ad8\u4eae\u663e\u793a\u53c2\u6570\u540d\u79f0\u6240\u5bf9\u5e94\u7684\u63a7\u4ef6\uff0c\u82e5\u53c2\u6570\u540d\u79f0\u4e0d\u5b58\u5728\uff0c\u5219\u4e0d\u4ea7\u751f\u4efb\u4f55\u6548\u679c\u3002
Parameters:
Name Type Description Default parameter_name
str
\u9700\u8981\u9ad8\u4eae\u663e\u793a\u7684\u63a7\u4ef6\u540d\u79f0
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.utoast/","title":"pyguiadapter.adapter.utoast","text":""},{"location":"apis/pyguiadapter.adapter.utoast/#_1","title":"\u6a21\u5757\u7ea7\u65b9\u6cd5","text":""},{"location":"apis/pyguiadapter.adapter.utoast/#pyguiadapter.adapter.utoast.show_toast","title":"show_toast(message: str, duration: int = 3000, config: Optional[ToastConfig] = None, clear: bool = False) -> None
","text":"\u5c55\u793atoast\u6d88\u606f\u3002
Parameters:
Name Type Description Default message
str
toast\u6d88\u606f\u5185\u5bb9
required duration
int
toast\u663e\u793a\u65f6\u95f4\uff0c\u5355\u4f4d\u4e3a\u6beb\u79d2
3000
config
Optional[ToastConfig]
toast\u914d\u7f6e
None
clear
bool
\u662f\u5426\u6e05\u9664\u4e4b\u524d\u7684toast\u6d88\u606f
False
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.utoast/#pyguiadapter.adapter.utoast.clear_toasts","title":"clear_toasts() -> None
","text":"\u6e05\u9664\u6240\u6709toast\u6d88\u606f\u3002
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.menu/","title":"pyguiadapter.menu","text":""},{"location":"apis/pyguiadapter.menu/#pyguiadapter.menu.Menu","title":"Menu
dataclass
","text":" Bases: object
\u8be5\u7c7b\u7528\u4e8e\u914d\u7f6e\u7a97\u53e3\u83dc\u5355\u680f\u4e0a\u7684\u83dc\u5355\u3002
Source code in pyguiadapter\\menu.py
@dataclasses.dataclass(frozen=True)\nclass Menu(object):\n \"\"\"\u8be5\u7c7b\u7528\u4e8e\u914d\u7f6e\u7a97\u53e3\u83dc\u5355\u680f\u4e0a\u7684\u83dc\u5355\u3002\"\"\"\n\n title: str\n \"\"\"\u83dc\u5355\u7684\u6807\u9898\u3002\"\"\"\n\n actions: List[Union[Action, Separator, \"Menu\"]]\n \"\"\"\u83dc\u5355\u4e0b\u7684\u83dc\u5355\u9879\uff08`Action`\uff09\u3001\u5206\u9694\u7b26\uff08`Separator`\uff09\u6216\u5b50\u83dc\u5355\uff08`Menu`\uff09\"\"\"\n\n separators_collapsible: bool = True\n \"\"\"\u662f\u5426\u5c06\u8fde\u7eed\u7684\u5206\u9694\u7b26\u5408\u5e76\u3002\u4e3a`True`\u65f6\u8fde\u7eed\u5206\u9694\u7b26\u5c06\u88ab\u5408\u5e76\u4e3a\u4e00\u4e2a\uff0c\u540c\u65f6\uff0c\u4f4d\u4e8e\u83dc\u5355\u5f00\u5934\u6216\u7ed3\u5c3e\u7684\u5206\u9694\u7b26\u4e5f\u4f1a\u88ab\u9690\u85cf\u3002\"\"\"\n\n tear_off_enabled: bool = True\n \"\"\"\u83dc\u5355\u53ef\u4ee5\u88ab\u201c\u6495\u4e0b\u201d\u3002\u4e3a`True`\u65f6\uff0c\u83dc\u5355\u5c06\u5305\u542b\u4e00\u4e2a\u7279\u6b8a\u7684\u201c\u6495\u4e0b\u201d\u9879\uff08\u901a\u5e38\u663e\u793a\u4e3a\u83dc\u5355\u9876\u90e8\u7684\u865a\u7ebf\uff09\uff0c\u5f53\u89e6\u53d1\u5b83\u65f6\uff0c\u4f1a\u521b\u5efa\u4e00\u4e2a\u83dc\u5355\u7684\u526f\u672c\u3002\u8fd9\u4e2a\u201c\u6495\u4e0b\u201d\u7684\u526f\u672c\n \u4f1a\u5b58\u5728\u4e8e\u4e00\u4e2a\u5355\u72ec\u7684\u7a97\u53e3\u4e2d\uff0c\u5e76\u4e14\u5305\u542b\u4e0e\u539f\u59cb\u83dc\u5355\u76f8\u540c\u7684\u83dc\u5355\u9879\u3002\"\"\"\n\n exclusive: bool = False\n \"\"\"\u662f\u5426\u5c06\u83dc\u5355\u4e0b\u7684\u83dc\u5355\u9879\uff08`Action`\uff09\u6dfb\u52a0\u5230\u4e00\u4e2a\u4e92\u65a5\u7ec4\u4e2d\u3002\u53ea\u6709\u5f53\u524d\u83dc\u5355\u4e0b`checkable`\u5c5e\u6027\u4e3a`True`\u7684\u83dc\u5355\u9879\uff08`Action`\uff09\u624d\u4f1a\u88ab\u6dfb\u52a0\u7684\u4e92\u65a5\u7ec4\u4e2d\u3002\"\"\"\n\n def remove_action(self, action: Union[str, Action, Separator, \"Menu\"]):\n if isinstance(action, str):\n for action_ in self.actions:\n if isinstance(action_, Action):\n if action_.text == action:\n action = action_\n break\n if isinstance(action_, Menu):\n if action_.title == action:\n action = action_\n break\n if action in self.actions:\n self.actions.remove(action)\n return\n if action in self.actions:\n self.actions.remove(action)\n return\n
"},{"location":"apis/pyguiadapter.menu/#pyguiadapter.menu.Menu.actions","title":"actions: List[Union[Action, Separator, Menu]]
instance-attribute
","text":"\u83dc\u5355\u4e0b\u7684\u83dc\u5355\u9879\uff08Action
\uff09\u3001\u5206\u9694\u7b26\uff08Separator
\uff09\u6216\u5b50\u83dc\u5355\uff08Menu
\uff09
"},{"location":"apis/pyguiadapter.menu/#pyguiadapter.menu.Menu.exclusive","title":"exclusive: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u83dc\u5355\u4e0b\u7684\u83dc\u5355\u9879\uff08Action
\uff09\u6dfb\u52a0\u5230\u4e00\u4e2a\u4e92\u65a5\u7ec4\u4e2d\u3002\u53ea\u6709\u5f53\u524d\u83dc\u5355\u4e0bcheckable
\u5c5e\u6027\u4e3aTrue
\u7684\u83dc\u5355\u9879\uff08Action
\uff09\u624d\u4f1a\u88ab\u6dfb\u52a0\u7684\u4e92\u65a5\u7ec4\u4e2d\u3002
"},{"location":"apis/pyguiadapter.menu/#pyguiadapter.menu.Menu.separators_collapsible","title":"separators_collapsible: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8fde\u7eed\u7684\u5206\u9694\u7b26\u5408\u5e76\u3002\u4e3aTrue
\u65f6\u8fde\u7eed\u5206\u9694\u7b26\u5c06\u88ab\u5408\u5e76\u4e3a\u4e00\u4e2a\uff0c\u540c\u65f6\uff0c\u4f4d\u4e8e\u83dc\u5355\u5f00\u5934\u6216\u7ed3\u5c3e\u7684\u5206\u9694\u7b26\u4e5f\u4f1a\u88ab\u9690\u85cf\u3002
"},{"location":"apis/pyguiadapter.menu/#pyguiadapter.menu.Menu.tear_off_enabled","title":"tear_off_enabled: bool = True
class-attribute
instance-attribute
","text":"\u83dc\u5355\u53ef\u4ee5\u88ab\u201c\u6495\u4e0b\u201d\u3002\u4e3aTrue
\u65f6\uff0c\u83dc\u5355\u5c06\u5305\u542b\u4e00\u4e2a\u7279\u6b8a\u7684\u201c\u6495\u4e0b\u201d\u9879\uff08\u901a\u5e38\u663e\u793a\u4e3a\u83dc\u5355\u9876\u90e8\u7684\u865a\u7ebf\uff09\uff0c\u5f53\u89e6\u53d1\u5b83\u65f6\uff0c\u4f1a\u521b\u5efa\u4e00\u4e2a\u83dc\u5355\u7684\u526f\u672c\u3002\u8fd9\u4e2a\u201c\u6495\u4e0b\u201d\u7684\u526f\u672c \u4f1a\u5b58\u5728\u4e8e\u4e00\u4e2a\u5355\u72ec\u7684\u7a97\u53e3\u4e2d\uff0c\u5e76\u4e14\u5305\u542b\u4e0e\u539f\u59cb\u83dc\u5355\u76f8\u540c\u7684\u83dc\u5355\u9879\u3002
"},{"location":"apis/pyguiadapter.menu/#pyguiadapter.menu.Menu.title","title":"title: str
instance-attribute
","text":"\u83dc\u5355\u7684\u6807\u9898\u3002
"},{"location":"apis/pyguiadapter.paramwidget/","title":"pyguiadapter.paramwidget","text":""},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidgetConfig","title":"BaseParameterWidgetConfig
dataclass
","text":" Bases: object
\u53c2\u6570\u63a7\u4ef6\u914d\u7f6e\u57fa\u7c7b\u3002\u63d0\u4f9b\u4e86\u6240\u6709\u53c2\u6570\u63a7\u4ef6\u5171\u6709\u7684\u53ef\u914d\u7f6e\u5c5e\u6027\u3002
Source code in pyguiadapter\\paramwidget.py
@dataclasses.dataclass(frozen=True)\nclass BaseParameterWidgetConfig(object):\n \"\"\"\n \u53c2\u6570\u63a7\u4ef6\u914d\u7f6e\u57fa\u7c7b\u3002\u63d0\u4f9b\u4e86\u6240\u6709\u53c2\u6570\u63a7\u4ef6\u5171\u6709\u7684\u53ef\u914d\u7f6e\u5c5e\u6027\u3002\n \"\"\"\n\n default_value: Any = None\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\u3002\"\"\"\n\n label: Optional[str] = None\n \"\"\"\u63a7\u4ef6\u7684\u6807\u7b7e\u3002\u82e5\u4e0d\u6307\u5b9a\u6b64\u5c5e\u6027\uff0c\u5219\u4f7f\u7528\u53c2\u6570\u540d\u4f5c\u4e3a\u6807\u7b7e\u3002\"\"\"\n\n description: Optional[str] = None\n \"\"\"\u63a7\u4ef6\u7684\u63cf\u8ff0\u6587\u672c\u3002\u82e5\u4e0d\u6307\u5b9a\u6b64\u5c5e\u6027\uff0c\u5219\u4ece\u5c1d\u8bd5\u4ece\u51fd\u6570\u7684docstring\u4e2d\u83b7\u53d6\u5bf9\u5e94\u53c2\u6570\u7684\u63cf\u8ff0\u6587\u672c\u3002\"\"\"\n\n default_value_description: Optional[str] = DEFAULT_VALUE_DESCRIPTION\n \"\"\"\u4f7f\u7528\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u7684\u63cf\u8ff0\u6587\u672c\u3002\u5f53default_value\u4e3aNone\u6216\u5f00\u53d1\u8005\u660e\u786e\u6307\u5b9a\u663e\u793a\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u65f6\uff0c\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u624d\u4f1a\u663e\u793a\u3002\"\"\"\n\n group: Optional[str] = None\n \"\"\"\u53c2\u6570\u5206\u7ec4\u540d\u79f0\u3002\u4e3aNone\u65f6\uff0c\u53c2\u89c1\u5c06\u88ab\u6dfb\u52a0\u5230\u9ed8\u8ba4\u5206\u7ec4\u3002\"\"\"\n\n stylesheet: Optional[str] = None\n \"\"\"\u53c2\u6570\u63a7\u4ef6\u7684\u6837\u5f0f\u8868\u3002\"\"\"\n\n @classmethod\n @abstractmethod\n def target_widget_class(cls) -> Type[\"BaseParameterWidget\"]:\n \"\"\"\n \u76ee\u6807\u63a7\u4ef6\u7c7b\uff0c\u5373\u672c\u914d\u7f6e\u7c7b\u9002\u7528\u7684\u53c2\u6570\u63a7\u4ef6\u7c7b\u3002\u5b50\u7c7b\u5fc5\u987b\u5b9e\u73b0\u6b64\u65b9\u6cd5\u3002\n\n Returns:\n \u76ee\u6807\u63a7\u4ef6\u7c7b\n \"\"\"\n pass\n\n @classmethod\n def new(cls, **kwargs) -> \"BaseParameterWidgetConfig\":\n return cls(**kwargs)\n
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidgetConfig.default_value","title":"default_value: Any = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\u3002
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidgetConfig.default_value_description","title":"default_value_description: Optional[str] = DEFAULT_VALUE_DESCRIPTION
class-attribute
instance-attribute
","text":"\u4f7f\u7528\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u7684\u63cf\u8ff0\u6587\u672c\u3002\u5f53default_value\u4e3aNone\u6216\u5f00\u53d1\u8005\u660e\u786e\u6307\u5b9a\u663e\u793a\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u65f6\uff0c\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u624d\u4f1a\u663e\u793a\u3002
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidgetConfig.description","title":"description: Optional[str] = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u63cf\u8ff0\u6587\u672c\u3002\u82e5\u4e0d\u6307\u5b9a\u6b64\u5c5e\u6027\uff0c\u5219\u4ece\u5c1d\u8bd5\u4ece\u51fd\u6570\u7684docstring\u4e2d\u83b7\u53d6\u5bf9\u5e94\u53c2\u6570\u7684\u63cf\u8ff0\u6587\u672c\u3002
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidgetConfig.group","title":"group: Optional[str] = None
class-attribute
instance-attribute
","text":"\u53c2\u6570\u5206\u7ec4\u540d\u79f0\u3002\u4e3aNone\u65f6\uff0c\u53c2\u89c1\u5c06\u88ab\u6dfb\u52a0\u5230\u9ed8\u8ba4\u5206\u7ec4\u3002
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidgetConfig.label","title":"label: Optional[str] = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u6807\u7b7e\u3002\u82e5\u4e0d\u6307\u5b9a\u6b64\u5c5e\u6027\uff0c\u5219\u4f7f\u7528\u53c2\u6570\u540d\u4f5c\u4e3a\u6807\u7b7e\u3002
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidgetConfig.stylesheet","title":"stylesheet: Optional[str] = None
class-attribute
instance-attribute
","text":"\u53c2\u6570\u63a7\u4ef6\u7684\u6837\u5f0f\u8868\u3002
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidgetConfig.target_widget_class","title":"target_widget_class() -> Type[BaseParameterWidget]
abstractmethod
classmethod
","text":"\u76ee\u6807\u63a7\u4ef6\u7c7b\uff0c\u5373\u672c\u914d\u7f6e\u7c7b\u9002\u7528\u7684\u53c2\u6570\u63a7\u4ef6\u7c7b\u3002\u5b50\u7c7b\u5fc5\u987b\u5b9e\u73b0\u6b64\u65b9\u6cd5\u3002
Returns:
Type Description Type[BaseParameterWidget]
\u76ee\u6807\u63a7\u4ef6\u7c7b
Source code in pyguiadapter\\paramwidget.py
@classmethod\n@abstractmethod\ndef target_widget_class(cls) -> Type[\"BaseParameterWidget\"]:\n \"\"\"\n \u76ee\u6807\u63a7\u4ef6\u7c7b\uff0c\u5373\u672c\u914d\u7f6e\u7c7b\u9002\u7528\u7684\u53c2\u6570\u63a7\u4ef6\u7c7b\u3002\u5b50\u7c7b\u5fc5\u987b\u5b9e\u73b0\u6b64\u65b9\u6cd5\u3002\n\n Returns:\n \u76ee\u6807\u63a7\u4ef6\u7c7b\n \"\"\"\n pass\n
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidget","title":"BaseParameterWidget
","text":" Bases: QWidget
\u53c2\u6570\u63a7\u4ef6\u57fa\u7c7b\u3002\u5b9a\u4e49\u4e86\u6240\u6709\u53c2\u6570\u63a7\u4ef6\u5171\u6709\u7684\u63a5\u53e3\u3002
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidget.ConfigClass","title":"ConfigClass: Type[_T] = NotImplemented
class-attribute
instance-attribute
","text":"\u53c2\u6570\u63a7\u4ef6\u5bf9\u5e94\u7684\u914d\u7f6e\u7c7b\u3002\u5fc5\u987b\u4e3aBaseParameterWidgetConfig\u7684\u5b50\u7c7b\u3002\u5fc5\u987b\u5728\u5b50\u7c7b\u4e2d\u5b9e\u73b0\u3002
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidget.__init__","title":"__init__(parent: Optional[QWidget], parameter_name: str, config: BaseParameterWidgetConfig)
","text":"\u6784\u9020\u51fd\u6570\u3002
Parameters:
Name Type Description Default parent
Optional[QWidget]
\u7236\u63a7\u4ef6
required parameter_name
str
\u53c2\u6570\u540d
required config
BaseParameterWidgetConfig
\u53c2\u6570\u63a7\u4ef6\u914d\u7f6e
required"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidget.build","title":"build() -> BaseParameterWidget
abstractmethod
","text":"\u6784\u5efa\u53c2\u6570\u63a7\u4ef6\u3002\u5b50\u7c7b\u5fc5\u987b\u5b9e\u73b0\u6b64\u65b9\u6cd5\u3002
Returns:
Type Description BaseParameterWidget
\u53c2\u6570\u63a7\u4ef6\u5b9e\u4f8b
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidget.get_value","title":"get_value() -> Any
abstractmethod
","text":"\u4ece\u63a7\u4ef6\u83b7\u53d6\u53c2\u6570\u503c\u3002\u5b50\u7c7b\u5fc5\u987b\u5b9e\u73b0\u6b64\u65b9\u6cd5\u3002
Returns:
Type Description Any
\u53c2\u6570\u503c
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidget.on_clear_parameter_error","title":"on_clear_parameter_error(parameter_name: Optional[str]) -> None
","text":"\u6e05\u9664\u53c2\u6570\u9519\u8bef\u65f6\u56de\u8c03\u3002\u5b50\u7c7b\u53ef\u91cd\u5199\u6b64\u65b9\u6cd5\u3002
Parameters:
Name Type Description Default parameter_name
Optional[str]
\u53c2\u6570\u540d\uff0c\u82e5\u4e3aNone\uff0c\u8868\u793a\u6e05\u9664\u6240\u6709\u53c2\u6570\u9519\u8bef\u3002
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidget.on_parameter_error","title":"on_parameter_error(parameter_name: str, error: Any) -> None
","text":"\u53c2\u6570\u9519\u8bef\u65f6\u56de\u8c03\u3002\u5b50\u7c7b\u53ef\u91cd\u5199\u6b64\u65b9\u6cd5\u3002
Parameters:
Name Type Description Default parameter_name
str
\u53c2\u6570\u540d
required error
Any
\u9519\u8bef\u4fe1\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidget.set_value","title":"set_value(value: Any) -> None
abstractmethod
","text":"\u8bbe\u7f6e\u53c2\u6570\u503c\u3002\u5b50\u7c7b\u5fc5\u987b\u5b9e\u73b0\u6b64\u65b9\u6cd5\u3002
Parameters:
Name Type Description Default value
Any
\u53c2\u6570\u503c
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.textbrowser/","title":"pyguiadapter.textbrowser","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig","title":"TextBrowserConfig
dataclass
","text":" Bases: object
\u6587\u672c\u6d4f\u89c8\u5668\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\textbrowser.py
@dataclasses.dataclass\nclass TextBrowserConfig(object):\n \"\"\"\u6587\u672c\u6d4f\u89c8\u5668\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n text_color: str = COLOR_BASE_TEXT\n \"\"\"\u6587\u672c\u989c\u8272\u3002\"\"\"\n\n font_family: Union[Sequence[str], str] = None\n \"\u6587\u672c\u7684\u5b57\u4f53\u7cfb\u5217\u3002\"\n\n font_size: Optional[int] = None\n \"\"\"\u6587\u672c\u7684\u5b57\u4f53\u5927\u5c0f\uff08px\uff09\u3002\"\"\"\n\n background_color: str = COLOR_BASE_BACKGROUND\n \"\"\"\u80cc\u666f\u989c\u8272\u3002\"\"\"\n\n line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap\n \"\"\"\u6362\u884c\u6a21\u5f0f\u3002\"\"\"\n\n line_wrap_width: int = 88\n \"\"\"\u6362\u884c\u5bbd\u5ea6\u3002\"\"\"\n\n word_wrap_mode: WordWrapMode = WordWrapMode.WordWrap\n \"\"\"\u201c\u5355\u8bcd\u6362\u884c\u6a21\u5f0f\"\"\"\n\n open_external_links: bool = True\n \"\"\"\u662f\u5426\u5141\u8bb8\u6253\u5f00\u5916\u90e8\u94fe\u63a5\u3002\"\"\"\n\n stylesheet: str = \"\"\n \"\"\"\u6837\u5f0f\u8868\uff08QSS\u683c\u5f0f\uff09\u3002\"\"\"\n
"},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig.background_color","title":"background_color: str = COLOR_BASE_BACKGROUND
class-attribute
instance-attribute
","text":"\u80cc\u666f\u989c\u8272\u3002
"},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig.font_family","title":"font_family: Union[Sequence[str], str] = None
class-attribute
instance-attribute
","text":"\u6587\u672c\u7684\u5b57\u4f53\u7cfb\u5217\u3002
"},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig.font_size","title":"font_size: Optional[int] = None
class-attribute
instance-attribute
","text":"\u6587\u672c\u7684\u5b57\u4f53\u5927\u5c0f\uff08px\uff09\u3002
"},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig.line_wrap_mode","title":"line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap
class-attribute
instance-attribute
","text":"\u6362\u884c\u6a21\u5f0f\u3002
"},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig.line_wrap_width","title":"line_wrap_width: int = 88
class-attribute
instance-attribute
","text":"\u6362\u884c\u5bbd\u5ea6\u3002
"},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig.open_external_links","title":"open_external_links: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5141\u8bb8\u6253\u5f00\u5916\u90e8\u94fe\u63a5\u3002
"},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig.stylesheet","title":"stylesheet: str = ''
class-attribute
instance-attribute
","text":"\u6837\u5f0f\u8868\uff08QSS\u683c\u5f0f\uff09\u3002
"},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig.text_color","title":"text_color: str = COLOR_BASE_TEXT
class-attribute
instance-attribute
","text":"\u6587\u672c\u989c\u8272\u3002
"},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig.word_wrap_mode","title":"word_wrap_mode: WordWrapMode = WordWrapMode.WordWrap
class-attribute
instance-attribute
","text":"\u201c\u5355\u8bcd\u6362\u884c\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.textbrowser/#_1","title":"\u7c7b\u578b\u548c\u5e38\u91cf","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.LineWrapMode","title":"LineWrapMode = QTextBrowser.LineWrapMode
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.NoLineWrap","title":"NoLineWrap = QTextBrowser.NoWrap
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.WidgetWidth","title":"WidgetWidth = QTextBrowser.WidgetWidth
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.FixedPixelWidth","title":"FixedPixelWidth = QTextBrowser.FixedPixelWidth
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.FixedColumnWidth","title":"FixedColumnWidth = QTextBrowser.FixedColumnWidth
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.WordWrapMode","title":"WordWrapMode = QTextOption.WrapMode
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.NoWrap","title":"NoWrap = QTextOption.NoWrap
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.WordWrap","title":"WordWrap = QTextOption.WordWrap
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.ManualWrap","title":"ManualWrap = QTextOption.ManualWrap
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.WrapAnywhere","title":"WrapAnywhere = QTextOption.WrapAnywhere
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.WrapAtWordBoundaryOrAnywhere","title":"WrapAtWordBoundaryOrAnywhere = QTextOption.WrapAtWordBoundaryOrAnywhere
module-attribute
","text":""},{"location":"apis/pyguiadapter.toast/","title":"pyguiadapter.toast","text":""},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig","title":"ToastConfig
dataclass
","text":" Bases: object
Toast\u63a7\u4ef6\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\toast.py
@dataclasses.dataclass(frozen=True)\nclass ToastConfig(object):\n \"\"\"\n Toast\u63a7\u4ef6\u914d\u7f6e\u7c7b\n \"\"\"\n\n opacity: float = 0.9\n \"\"\"\u4e0d\u900f\u660e\u5ea6\"\"\"\n\n background_color: str = COLOR_TOAST_BACKGROUND_CLASSIC\n \"\"\"\u80cc\u666f\u989c\u8272\"\"\"\n\n text_color: str = COLOR_TOAST_TEXT_CLASSIC\n \"\"\"\u6587\u5b57\u989c\u8272\"\"\"\n\n text_padding: int = 50\n \"\"\"\u6587\u5b57\u8fb9\u8ddd\"\"\"\n\n text_alignment: Optional[TextAlignment] = None\n \"\"\"\u6587\u5b57\u5bf9\u9f50\u65b9\u5f0f\"\"\"\n\n font_family: Union[Sequence[str], str] = FONT_FAMILY\n \"\"\"\u5b57\u4f53\"\"\"\n\n font_size: int = 26\n \"\"\"\u5b57\u4f53\u5927\u5c0f\"\"\"\n\n position: Optional[Tuple[Union[int, float, None], Union[int, float, None]]] = (\n DEFAULT_POSITION\n )\n \"\"\"\u663e\u793a\u4f4d\u7f6e\uff0c\u53ef\u4ee5\u4f7f\u7528\u767e\u5206\u6bd4\u6216\u7edd\u5bf9\u5750\u6807\uff0c\u6bd4\u5982`(0.5, 0.5)`\u8868\u793a\u5728\u5c4f\u5e55\u4e2d\u5fc3\u663e\u793a\uff0c`(100, 100)`\u8868\u793a\u5728\u5c4f\u5e55\u5750\u6807x=100 y=100\u5904\u663e\u793a\"\"\"\n\n fixed_size: Optional[Tuple[int, int]] = None\n \"\"\"\u56fa\u5b9a\u5c3a\u5bf8\"\"\"\n\n fade_out: Optional[int] = None\n \"\"\"\u6de1\u51fa\u65f6\u95f4\"\"\"\n\n styles: Optional[Dict[str, str]] = None\n \"\"\"\u989d\u5916\u6837\u5f0f\"\"\"\n
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.background_color","title":"background_color: str = COLOR_TOAST_BACKGROUND_CLASSIC
class-attribute
instance-attribute
","text":"\u80cc\u666f\u989c\u8272
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.fade_out","title":"fade_out: Optional[int] = None
class-attribute
instance-attribute
","text":"\u6de1\u51fa\u65f6\u95f4
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.fixed_size","title":"fixed_size: Optional[Tuple[int, int]] = None
class-attribute
instance-attribute
","text":"\u56fa\u5b9a\u5c3a\u5bf8
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.font_family","title":"font_family: Union[Sequence[str], str] = FONT_FAMILY
class-attribute
instance-attribute
","text":"\u5b57\u4f53
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.font_size","title":"font_size: int = 26
class-attribute
instance-attribute
","text":"\u5b57\u4f53\u5927\u5c0f
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.opacity","title":"opacity: float = 0.9
class-attribute
instance-attribute
","text":"\u4e0d\u900f\u660e\u5ea6
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.position","title":"position: Optional[Tuple[Union[int, float, None], Union[int, float, None]]] = DEFAULT_POSITION
class-attribute
instance-attribute
","text":"\u663e\u793a\u4f4d\u7f6e\uff0c\u53ef\u4ee5\u4f7f\u7528\u767e\u5206\u6bd4\u6216\u7edd\u5bf9\u5750\u6807\uff0c\u6bd4\u5982(0.5, 0.5)
\u8868\u793a\u5728\u5c4f\u5e55\u4e2d\u5fc3\u663e\u793a\uff0c(100, 100)
\u8868\u793a\u5728\u5c4f\u5e55\u5750\u6807x=100 y=100\u5904\u663e\u793a
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.styles","title":"styles: Optional[Dict[str, str]] = None
class-attribute
instance-attribute
","text":"\u989d\u5916\u6837\u5f0f
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.text_alignment","title":"text_alignment: Optional[TextAlignment] = None
class-attribute
instance-attribute
","text":"\u6587\u5b57\u5bf9\u9f50\u65b9\u5f0f
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.text_color","title":"text_color: str = COLOR_TOAST_TEXT_CLASSIC
class-attribute
instance-attribute
","text":"\u6587\u5b57\u989c\u8272
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.text_padding","title":"text_padding: int = 50
class-attribute
instance-attribute
","text":"\u6587\u5b57\u8fb9\u8ddd
"},{"location":"apis/pyguiadapter.toast/#_1","title":"\u7c7b\u578b\u4e0e\u5e38\u91cf","text":""},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.TextAlignment","title":"TextAlignment = Union[Qt.AlignmentFlag, int]
module-attribute
","text":"\u6587\u5b57\u5bf9\u9f50\u65b9\u5f0f
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.AlignCenter","title":"AlignCenter = Qt.AlignVCenter | Qt.AlignHCenter
module-attribute
","text":"\u5c45\u4e2d\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.AlignLeft","title":"AlignLeft = Qt.AlignLeft | Qt.AlignVCenter
module-attribute
","text":"\u5de6\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.AlignRight","title":"AlignRight = Qt.AlignRight | Qt.AlignVCenter
module-attribute
","text":"\u53f3\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.toolbar/","title":"pyguiadapter.toolbar","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBar","title":"ToolBar
dataclass
","text":" Bases: object
\u8be5\u7c7b\u7528\u4e8e\u914d\u7f6e\u7a97\u53e3\u4e0a\u7684\u5de5\u5177\u680f
Source code in pyguiadapter\\toolbar.py
@dataclasses.dataclass(frozen=True)\nclass ToolBar(object):\n \"\"\"\u8be5\u7c7b\u7528\u4e8e\u914d\u7f6e\u7a97\u53e3\u4e0a\u7684\u5de5\u5177\u680f\"\"\"\n\n actions: List[Union[Action, Separator]]\n \"\"\"\u8981\u6dfb\u52a0\u5230\u5de5\u5177\u680f\u4e2d\u7684\u52a8\u4f5c\uff08`Action`\uff09\u6216\u5206\u9694\u7b26\uff08`Separator`\uff09\u5217\u8868\u3002\u5728\u5de5\u5177\u680f\u4e2d\uff0c\u52a8\u4f5c`Action`\u4ee5\u5de5\u5177\u680f\u6309\u94ae\u7684\u5f62\u5f0f\u51fa\u73b0\u3002\"\"\"\n\n moveable: bool = True\n \"\"\"\u5de5\u5177\u680f\u662f\u5426\u53ef\u4ee5\u79fb\u52a8\u3002\"\"\"\n\n floatable: bool = True\n \"\"\"\u5de5\u5177\u680f\u662f\u5426\u53ef\u4ee5\u6f02\u6d6e\u5728\u4e3b\u7a97\u53e3\u4e4b\u5916\u3002\"\"\"\n\n icon_size: Union[int, Tuple[int, int], QSize, None] = None\n \"\"\"\u5de5\u5177\u680f\u6309\u94ae\u7684\u56fe\u6807\u5927\u5c0f\uff0c\"\"\"\n\n initial_area: Optional[ToolBarArea] = None\n \"\"\"\u5de5\u5177\u680f\u5728\u7a97\u53e3\u4e0a\u7684\u521d\u59cb\u4f4d\u7f6e\u3002\"\"\"\n\n allowed_areas: Optional[ToolBarAreas] = None\n \"\"\"\u7a97\u53e3\u4e0a\u5141\u8bb8\u5de5\u5177\u680f\u505c\u9760\u7684\u4f4d\u7f6e\u3002\"\"\"\n\n button_style: Optional[ToolButtonStyle] = None\n \"\"\"\u5de5\u5177\u680f\u6309\u7684\u6837\u5f0f\u3002\"\"\"\n\n def remove_action(self, action: Union[str, Action, Separator]):\n if isinstance(action, str):\n for action_ in self.actions:\n if isinstance(action_, Action):\n if action_.text == action:\n action = action_\n break\n if action in self.actions:\n self.actions.remove(action)\n return\n if action in self.actions:\n self.actions.remove(action)\n return\n
"},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBar.actions","title":"actions: List[Union[Action, Separator]]
instance-attribute
","text":"\u8981\u6dfb\u52a0\u5230\u5de5\u5177\u680f\u4e2d\u7684\u52a8\u4f5c\uff08Action
\uff09\u6216\u5206\u9694\u7b26\uff08Separator
\uff09\u5217\u8868\u3002\u5728\u5de5\u5177\u680f\u4e2d\uff0c\u52a8\u4f5cAction
\u4ee5\u5de5\u5177\u680f\u6309\u94ae\u7684\u5f62\u5f0f\u51fa\u73b0\u3002
"},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBar.allowed_areas","title":"allowed_areas: Optional[ToolBarAreas] = None
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u4e0a\u5141\u8bb8\u5de5\u5177\u680f\u505c\u9760\u7684\u4f4d\u7f6e\u3002
"},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBar.button_style","title":"button_style: Optional[ToolButtonStyle] = None
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u6309\u7684\u6837\u5f0f\u3002
"},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBar.floatable","title":"floatable: bool = True
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u662f\u5426\u53ef\u4ee5\u6f02\u6d6e\u5728\u4e3b\u7a97\u53e3\u4e4b\u5916\u3002
"},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBar.icon_size","title":"icon_size: Union[int, Tuple[int, int], QSize, None] = None
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u6309\u94ae\u7684\u56fe\u6807\u5927\u5c0f\uff0c
"},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBar.initial_area","title":"initial_area: Optional[ToolBarArea] = None
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u5728\u7a97\u53e3\u4e0a\u7684\u521d\u59cb\u4f4d\u7f6e\u3002
"},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBar.moveable","title":"moveable: bool = True
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u662f\u5426\u53ef\u4ee5\u79fb\u52a8\u3002
"},{"location":"apis/pyguiadapter.toolbar/#_1","title":"\u7c7b\u578b\u4e0e\u5e38\u91cf","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBarArea","title":"ToolBarArea = Qt.ToolBarArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.TopToolBarArea","title":"TopToolBarArea = ToolBarArea.TopToolBarArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.BottomToolBarArea","title":"BottomToolBarArea = ToolBarArea.BottomToolBarArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.LeftToolBarArea","title":"LeftToolBarArea = ToolBarArea.LeftToolBarArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.RightToolBarArea","title":"RightToolBarArea = ToolBarArea.RightToolBarArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBarAreas","title":"ToolBarAreas = Union[ToolBarArea, int]
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.AllToolBarAreas","title":"AllToolBarAreas = Qt.AllToolBarAreas
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolButtonStyle","title":"ToolButtonStyle = Qt.ToolButtonStyle
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolButtonIconOnly","title":"ToolButtonIconOnly = ToolButtonStyle.ToolButtonIconOnly
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolButtonTextBesideIcon","title":"ToolButtonTextBesideIcon = ToolButtonStyle.ToolButtonTextBesideIcon
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolButtonTextUnderIcon","title":"ToolButtonTextUnderIcon = ToolButtonStyle.ToolButtonTextUnderIcon
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolButtonFollowStyle","title":"ToolButtonFollowStyle = ToolButtonStyle.ToolButtonFollowStyle
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolButtonTextOnly","title":"ToolButtonTextOnly = ToolButtonStyle.ToolButtonTextOnly
module-attribute
","text":""},{"location":"apis/pyguiadapter.widgets.boolbox/","title":"pyguiadapter.widgets.boolbox","text":""},{"location":"apis/pyguiadapter.widgets.boolbox/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.boolbox/#pyguiadapter.widgets.BoolBoxConfig","title":"BoolBoxConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
BoolBox\u63a7\u4ef6\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\basic\\boolbox.py
@dataclasses.dataclass(frozen=True)\nclass BoolBoxConfig(CommonParameterWidgetConfig):\n \"\"\"\n BoolBox\u63a7\u4ef6\u7684\u914d\u7f6e\u7c7b\u3002\n \"\"\"\n\n default_value: Optional[bool] = False\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\u3002\"\"\"\n\n true_text: str = \"True\"\n \"\"\"\u503c\u4e3aTrue\u7684\u9009\u9879\u6587\u672c\"\"\"\n\n false_text: str = \"False\"\n \"\"\"\u503c\u4e3aFalse\u7684\u9009\u9879\u6587\u672c\"\"\"\n\n true_icon: IconType = None\n \"\"\"\u503c\u4e3aTrue\u7684\u9009\u9879\u56fe\u6807\"\"\"\n\n false_icon: IconType = None\n \"\"\"\u503c\u4e3aFalse\u7684\u9009\u9879\u56fe\u6807\"\"\"\n\n vertical: bool = False\n \"\"\"\u662f\u5426\u4e3a\u5782\u76f4\u5e03\u5c40\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"BoolBox\"]:\n return BoolBox\n
"},{"location":"apis/pyguiadapter.widgets.boolbox/#pyguiadapter.widgets.BoolBoxConfig.default_value","title":"default_value: Optional[bool] = False
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\u3002
"},{"location":"apis/pyguiadapter.widgets.boolbox/#pyguiadapter.widgets.BoolBoxConfig.false_icon","title":"false_icon: IconType = None
class-attribute
instance-attribute
","text":"\u503c\u4e3aFalse\u7684\u9009\u9879\u56fe\u6807
"},{"location":"apis/pyguiadapter.widgets.boolbox/#pyguiadapter.widgets.BoolBoxConfig.false_text","title":"false_text: str = 'False'
class-attribute
instance-attribute
","text":"\u503c\u4e3aFalse\u7684\u9009\u9879\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.boolbox/#pyguiadapter.widgets.BoolBoxConfig.true_icon","title":"true_icon: IconType = None
class-attribute
instance-attribute
","text":"\u503c\u4e3aTrue\u7684\u9009\u9879\u56fe\u6807
"},{"location":"apis/pyguiadapter.widgets.boolbox/#pyguiadapter.widgets.BoolBoxConfig.true_text","title":"true_text: str = 'True'
class-attribute
instance-attribute
","text":"\u503c\u4e3aTrue\u7684\u9009\u9879\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.boolbox/#pyguiadapter.widgets.BoolBoxConfig.vertical","title":"vertical: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u4e3a\u5782\u76f4\u5e03\u5c40
"},{"location":"apis/pyguiadapter.widgets.boolbox/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.boolbox/#pyguiadapter.widgets.BoolBox","title":"BoolBox
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.boolbox/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" bool
"},{"location":"apis/pyguiadapter.widgets.choicebox/","title":"pyguiadapter.widgets.choicebox","text":""},{"location":"apis/pyguiadapter.widgets.choicebox/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.choicebox/#pyguiadapter.widgets.ChoiceBoxConfig","title":"ChoiceBoxConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
ChoiceBox\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\extend\\choicebox.py
@dataclasses.dataclass(frozen=True)\nclass ChoiceBoxConfig(CommonParameterWidgetConfig):\n \"\"\"ChoiceBox\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[Any] = _FIRST_ITEM\n \"\"\"\u9ed8\u8ba4\u9009\u9879\uff0c`_FIRST_ITEM`\u662f\u4e00\u4e2a\u7279\u6b8a\u503c\uff0c\u8868\u793a\u9009\u62e9\u9009\u9879\u5217\u8868\u4e2d\u7684\u7b2c\u4e00\u4e2a\"\"\"\n\n choices: Union[Dict[str, Any], Sequence[Any]] = dataclasses.field(\n default_factory=list\n )\n \"\"\"\u9009\u9879\u5217\u8868\uff0c\u53ef\u4ee5\u662f\u5b57\u5178\u6216\u5217\u8868\u3001\u5143\u7ec4\u7b49\u5e8f\u5217\u5bf9\u8c61\u3002\u4e3a\u5b57\u5178\u65f6\uff0c\u952e\u503c\u5bf9\u7684\u952e\u4e3a\u663e\u793a\u6587\u672c\uff0c\u503c\u4e3a\u5b9e\u9645\u503c\uff1b\u4e3a\u5e8f\u5217\u5bf9\u8c61\u65f6\uff0c\u5bf9\u5e8f\u5217\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u8c03\u7528`str()`\uff0c\n \u4ee5\u5176\u8fd4\u56de\u503c\u4f5c\u4e3a\u663e\u793a\u6587\u672c\uff0c\u5143\u7d20\u672c\u8eab\u4f5c\u4e3a\u5b9e\u9645\u503c\u3002\"\"\"\n\n editable: bool = False\n \"\"\"\u662f\u5426\u5141\u8bb8\u7f16\u8f91\"\"\"\n\n add_user_input: bool = True\n \"\"\"\u5728`editable`\u4e3a`True`\u65f6\uff0c\u7528\u6237\u8f93\u5165\u7684\u5185\u5bb9\u662f\u5426\u4f5c\u4e3a\u65b0\u7684\u9009\u9879\u6dfb\u52a0\u5230\u9009\u9879\u5217\u8868\u4e2d\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"ChoiceBox\"]:\n return ChoiceBox\n
"},{"location":"apis/pyguiadapter.widgets.choicebox/#pyguiadapter.widgets.ChoiceBoxConfig.add_user_input","title":"add_user_input: bool = True
class-attribute
instance-attribute
","text":"\u5728editable
\u4e3aTrue
\u65f6\uff0c\u7528\u6237\u8f93\u5165\u7684\u5185\u5bb9\u662f\u5426\u4f5c\u4e3a\u65b0\u7684\u9009\u9879\u6dfb\u52a0\u5230\u9009\u9879\u5217\u8868\u4e2d
"},{"location":"apis/pyguiadapter.widgets.choicebox/#pyguiadapter.widgets.ChoiceBoxConfig.choices","title":"choices: Union[Dict[str, Any], Sequence[Any]] = dataclasses.field(default_factory=list)
class-attribute
instance-attribute
","text":"\u9009\u9879\u5217\u8868\uff0c\u53ef\u4ee5\u662f\u5b57\u5178\u6216\u5217\u8868\u3001\u5143\u7ec4\u7b49\u5e8f\u5217\u5bf9\u8c61\u3002\u4e3a\u5b57\u5178\u65f6\uff0c\u952e\u503c\u5bf9\u7684\u952e\u4e3a\u663e\u793a\u6587\u672c\uff0c\u503c\u4e3a\u5b9e\u9645\u503c\uff1b\u4e3a\u5e8f\u5217\u5bf9\u8c61\u65f6\uff0c\u5bf9\u5e8f\u5217\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u8c03\u7528str()
\uff0c \u4ee5\u5176\u8fd4\u56de\u503c\u4f5c\u4e3a\u663e\u793a\u6587\u672c\uff0c\u5143\u7d20\u672c\u8eab\u4f5c\u4e3a\u5b9e\u9645\u503c\u3002
"},{"location":"apis/pyguiadapter.widgets.choicebox/#pyguiadapter.widgets.ChoiceBoxConfig.default_value","title":"default_value: Optional[Any] = _FIRST_ITEM
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u9009\u9879\uff0c_FIRST_ITEM
\u662f\u4e00\u4e2a\u7279\u6b8a\u503c\uff0c\u8868\u793a\u9009\u62e9\u9009\u9879\u5217\u8868\u4e2d\u7684\u7b2c\u4e00\u4e2a
"},{"location":"apis/pyguiadapter.widgets.choicebox/#pyguiadapter.widgets.ChoiceBoxConfig.editable","title":"editable: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5141\u8bb8\u7f16\u8f91
"},{"location":"apis/pyguiadapter.widgets.choicebox/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.choicebox/#pyguiadapter.widgets.ChoiceBox","title":"ChoiceBox
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.choicebox/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" choice_t
"},{"location":"apis/pyguiadapter.widgets.colorpicker/","title":"pyguiadapter.widgets.colorpicker","text":""},{"location":"apis/pyguiadapter.widgets.colorpicker/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.colorpicker/#pyguiadapter.widgets.ColorPickerConfig","title":"ColorPickerConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
ColorPicker\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\extend\\colorpicker.py
@dataclasses.dataclass(frozen=True)\nclass ColorPickerConfig(CommonParameterWidgetConfig):\n \"\"\"ColorPicker\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[ColorType] = \"white\"\n \"\"\"\u9ed8\u8ba4\u989c\u8272\u503c\uff0c\u53ef\u4ee5\u4e3a\u989c\u8272\u540d\u79f0\uff0cRGB\uff08\u6216RGBA\uff09\u5b57\u7b26\u4e32\uff0cQColor\uff0c\u6216\u989c\u8272\u5143\u7ec4\uff08\u5217\u8868\uff09\"\"\"\n\n initial_color: ColorType = \"white\"\n\n alpha_channel: bool = True\n \"\"\"\u662f\u5426\u663e\u793aAlpha\u901a\u9053\"\"\"\n\n display_color_name: bool = True\n \"\"\"\u989c\u8272\u6807\u7b7e\u4e0a\u662f\u5426\u663e\u793a\u989c\u8272\u540d\u79f0\"\"\"\n\n width: Optional[int] = None\n \"\"\"\u989c\u8272\u6807\u7b7e\u7684\u5bbd\u5ea6\"\"\"\n\n height: Optional[int] = 45\n \"\"\"\u989c\u8272\u6807\u7b7e\u7684\u9ad8\u5ea6\"\"\"\n\n return_type: Literal[\"tuple\", \"QColor\", \"str\"] = \"tuple\"\n \"\"\"\u8fd4\u56de\u503c\u7c7b\u578b\uff0c\u5373\u4ece\u63a7\u4ef6\u83b7\u53d6\u503c\u65f6\u5f97\u5230\u7684\u503c\u7684\u7c7b\u578b\uff0c\u53ef\u4ee5\u4e3a\u201ctuple\u201d\uff08\u8fd4\u56deRGB\u6216RGBA\u5143\u7ec4\uff09\uff0c\u201cQColor\u201d\uff08\u8fd4\u56deQColor\u5bf9\u8c61\uff09\uff0c\n \u6216\u201cstr\u201d\uff08\u8fd4\u56deRGB\u6216RGBA\u5341\u516d\u8fdb\u5236\u5b57\u7b26\u4e32\uff09\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"ColorPicker\"]:\n return ColorPicker\n
"},{"location":"apis/pyguiadapter.widgets.colorpicker/#pyguiadapter.widgets.ColorPickerConfig.alpha_channel","title":"alpha_channel: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793aAlpha\u901a\u9053
"},{"location":"apis/pyguiadapter.widgets.colorpicker/#pyguiadapter.widgets.ColorPickerConfig.default_value","title":"default_value: Optional[ColorType] = 'white'
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u989c\u8272\u503c\uff0c\u53ef\u4ee5\u4e3a\u989c\u8272\u540d\u79f0\uff0cRGB\uff08\u6216RGBA\uff09\u5b57\u7b26\u4e32\uff0cQColor\uff0c\u6216\u989c\u8272\u5143\u7ec4\uff08\u5217\u8868\uff09
"},{"location":"apis/pyguiadapter.widgets.colorpicker/#pyguiadapter.widgets.ColorPickerConfig.display_color_name","title":"display_color_name: bool = True
class-attribute
instance-attribute
","text":"\u989c\u8272\u6807\u7b7e\u4e0a\u662f\u5426\u663e\u793a\u989c\u8272\u540d\u79f0
"},{"location":"apis/pyguiadapter.widgets.colorpicker/#pyguiadapter.widgets.ColorPickerConfig.height","title":"height: Optional[int] = 45
class-attribute
instance-attribute
","text":"\u989c\u8272\u6807\u7b7e\u7684\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.colorpicker/#pyguiadapter.widgets.ColorPickerConfig.return_type","title":"return_type: Literal['tuple', 'QColor', 'str'] = 'tuple'
class-attribute
instance-attribute
","text":"\u8fd4\u56de\u503c\u7c7b\u578b\uff0c\u5373\u4ece\u63a7\u4ef6\u83b7\u53d6\u503c\u65f6\u5f97\u5230\u7684\u503c\u7684\u7c7b\u578b\uff0c\u53ef\u4ee5\u4e3a\u201ctuple\u201d\uff08\u8fd4\u56deRGB\u6216RGBA\u5143\u7ec4\uff09\uff0c\u201cQColor\u201d\uff08\u8fd4\u56deQColor\u5bf9\u8c61\uff09\uff0c \u6216\u201cstr\u201d\uff08\u8fd4\u56deRGB\u6216RGBA\u5341\u516d\u8fdb\u5236\u5b57\u7b26\u4e32\uff09
"},{"location":"apis/pyguiadapter.widgets.colorpicker/#pyguiadapter.widgets.ColorPickerConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"\u989c\u8272\u6807\u7b7e\u7684\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.colorpicker/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.colorpicker/#pyguiadapter.widgets.ColorHexPicker","title":"ColorHexPicker
","text":" Bases: ColorPicker
"},{"location":"apis/pyguiadapter.widgets.colorpicker/#pyguiadapter.widgets.ColorTuplePicker","title":"ColorTuplePicker
","text":" Bases: ColorPicker
"},{"location":"apis/pyguiadapter.widgets.colorpicker/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" color_hex_t
color_tuple_t
"},{"location":"apis/pyguiadapter.widgets.common/","title":"pyguiadapter.widgets.common","text":""},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig","title":"CommonParameterWidgetConfig
dataclass
","text":" Bases: BaseParameterWidgetConfig
\u901a\u7528\u53c2\u6570\u63a7\u4ef6\u914d\u7f6e\u7c7b\u3002\u7ee7\u627f\u81ea BaseParameterWidgetConfig
\u7c7b\u3002\u662f\u6240\u6709\u901a\u7528\u53c2\u6570\u63a7\u4ef6\u7684\u914d\u7f6e\u57fa\u7c7b\u3002
Source code in pyguiadapter\\widgets\\common.py
@dataclasses.dataclass(frozen=True)\nclass CommonParameterWidgetConfig(BaseParameterWidgetConfig):\n \"\"\"\n \u901a\u7528\u53c2\u6570\u63a7\u4ef6\u914d\u7f6e\u7c7b\u3002\u7ee7\u627f\u81ea `BaseParameterWidgetConfig` \u7c7b\u3002\u662f\u6240\u6709\u901a\u7528\u53c2\u6570\u63a7\u4ef6\u7684\u914d\u7f6e\u57fa\u7c7b\u3002\n \"\"\"\n\n set_default_value_on_init: bool = True\n \"\"\"\n \u662f\u5426\u5728\u63a7\u4ef6\u521d\u59cb\u5316\u65f6\u8bbe\u7f6e\u9ed8\u8ba4\u503c\u3002\u9ed8\u8ba4\u4e3a `True`\u3002\n \"\"\"\n\n hide_default_value_checkbox: bool = True\n \"\"\"\u662f\u5426\u9690\u85cf\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u3002\u5f53default_value\u4e3aNone\u65f6\uff0c\u6b64\u9009\u9879\u65e0\u6548\uff0c\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u59cb\u7ec8\u663e\u793a\u3002\"\"\"\n\n set_deepcopy: bool = True\n get_deepcopy: bool = True\n\n description_font_size: Optional[int] = None\n \"\"\"\u63a7\u4ef6\u63cf\u8ff0\u6587\u672c\u5b57\u4f53\u5927\u5c0f\u3002\"\"\"\n\n description_color: Optional[str] = COLOR_REGULAR_TEXT\n \"\"\"\u63a7\u4ef6\u63cf\u8ff0\u6587\u672c\u989c\u8272\u3002\u9ed8\u8ba4\u4e3a `COLOR_REGULAR_TEXT`\u3002\"\"\"\n\n parameter_error_font_size: Optional[int] = None\n \"\"\"ParameterError\u6587\u672c\u5b57\u4f53\u5927\u5c0f\u3002\"\"\"\n\n parameter_error_color: Optional[str] = COLOR_FATAL\n \"\"\"ParameterError\u6587\u672c\u989c\u8272\u3002\u9ed8\u8ba4\u4e3a `COLOR_FATAL`\u3002\"\"\"\n\n highlight_effect: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u9ad8\u4eae\u6548\u679c\u3002\u5f53\u542f\u7528\u9ad8\u4eae\u6548\u679c\u65f6\uff0c\u5141\u8bb8\u5f00\u53d1\u8005\u9ad8\u4eae\u663e\u793a\u8be5\u63a7\u4ef6\u3002\"\"\"\n\n effect_class: Optional[Type[QGraphicsEffect]] = QGraphicsDropShadowEffect\n \"\"\"\u9ad8\u4eae\u6548\u679c\u7c7b\u3002\u9ed8\u8ba4\u4e3a `QGraphicsDropShadowEffect`\u3002\"\"\"\n\n effect_properties: Optional[dict] = dataclasses.field(\n default_factory=_default_highlight_effect_properties\n )\n \"\"\"\u9ad8\u4eae\u6548\u679c\u5c5e\u6027\u3002\u9ed8\u8ba4\u4e3a `None`\u3002\"\"\"\n\n drag_n_drop: bool = False\n \"\"\"\u662f\u5426\u542f\u7528\u62d6\u653e\u529f\u80fd\u3002\u9ed8\u8ba4\u4e3a `False`\u3002\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"CommonParameterWidget\"]:\n return CommonParameterWidget\n
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.description_color","title":"description_color: Optional[str] = COLOR_REGULAR_TEXT
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u63cf\u8ff0\u6587\u672c\u989c\u8272\u3002\u9ed8\u8ba4\u4e3a COLOR_REGULAR_TEXT
\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.description_font_size","title":"description_font_size: Optional[int] = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u63cf\u8ff0\u6587\u672c\u5b57\u4f53\u5927\u5c0f\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.drag_n_drop","title":"drag_n_drop: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u62d6\u653e\u529f\u80fd\u3002\u9ed8\u8ba4\u4e3a False
\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.effect_class","title":"effect_class: Optional[Type[QGraphicsEffect]] = QGraphicsDropShadowEffect
class-attribute
instance-attribute
","text":"\u9ad8\u4eae\u6548\u679c\u7c7b\u3002\u9ed8\u8ba4\u4e3a QGraphicsDropShadowEffect
\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.effect_properties","title":"effect_properties: Optional[dict] = dataclasses.field(default_factory=_default_highlight_effect_properties)
class-attribute
instance-attribute
","text":"\u9ad8\u4eae\u6548\u679c\u5c5e\u6027\u3002\u9ed8\u8ba4\u4e3a None
\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.hide_default_value_checkbox","title":"hide_default_value_checkbox: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u9690\u85cf\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u3002\u5f53default_value\u4e3aNone\u65f6\uff0c\u6b64\u9009\u9879\u65e0\u6548\uff0c\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u59cb\u7ec8\u663e\u793a\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.highlight_effect","title":"highlight_effect: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u9ad8\u4eae\u6548\u679c\u3002\u5f53\u542f\u7528\u9ad8\u4eae\u6548\u679c\u65f6\uff0c\u5141\u8bb8\u5f00\u53d1\u8005\u9ad8\u4eae\u663e\u793a\u8be5\u63a7\u4ef6\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.parameter_error_color","title":"parameter_error_color: Optional[str] = COLOR_FATAL
class-attribute
instance-attribute
","text":"ParameterError\u6587\u672c\u989c\u8272\u3002\u9ed8\u8ba4\u4e3a COLOR_FATAL
\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.parameter_error_font_size","title":"parameter_error_font_size: Optional[int] = None
class-attribute
instance-attribute
","text":"ParameterError\u6587\u672c\u5b57\u4f53\u5927\u5c0f\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.set_default_value_on_init","title":"set_default_value_on_init: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5728\u63a7\u4ef6\u521d\u59cb\u5316\u65f6\u8bbe\u7f6e\u9ed8\u8ba4\u503c\u3002\u9ed8\u8ba4\u4e3a True
\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidget","title":"CommonParameterWidget
","text":" Bases: BaseParameterWidget
\u901a\u7528\u53c2\u6570\u63a7\u4ef6\u57fa\u7c7b\u3002\u7ee7\u627f\u81ea BaseParameterWidget
\u7c7b\u3002\u4e3a\u6240\u6709\u53c2\u6570\u63a7\u4ef6\u5b9a\u4e49\u4e86\u57fa\u672c\u7684\u5e03\u5c40\u548c\u6574\u4f53\u5916\u89c2\u3002\u76ee\u524d\u5185\u7f6e\u63a7\u4ef6\u5747\u7ee7\u627f\u81ea\u6b64\u7c7b\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidget.value_widget","title":"value_widget: QWidget
abstractmethod
property
","text":"\u8fd4\u56de\u201c\u503c\u63a7\u4ef6\u201d\u3002\u6b64\u4e3a\u62bd\u8c61\u65b9\u6cd5\uff0c\u5fc5\u987b\u5728\u5b50\u7c7b\u4e2d\u5b9e\u73b0\u3002
Returns:
Type Description QWidget
\u63a7\u4ef6\u793a\u4f8b\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidget.get_value_from_widget","title":"get_value_from_widget() -> Any
abstractmethod
","text":"\u4ece\u201c\u503c\u63a7\u4ef6\u201d\u4e2d\u83b7\u53d6\u7528\u6237\u5f53\u524d\u8f93\u5165\u7684\u503c\u3002\u6b64\u4e3a\u62bd\u8c61\u65b9\u6cd5\uff0c\u5fc5\u987b\u5728\u5b50\u7c7b\u4e2d\u5b9e\u73b0\u3002
Returns:
Type Description Any
\u7528\u6237\u5f53\u524d\u8f93\u5165\u7684\u503c
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidget.set_value_to_widget","title":"set_value_to_widget(value: Any) -> None
abstractmethod
","text":"\u5c06\u7528\u6237\u4f20\u5165\u7684\u503c\u8bbe\u7f6e\u5230\u201c\u503c\u63a7\u4ef6\u201d\u4e2d\u3002\u6b64\u4e3a\u62bd\u8c61\u65b9\u6cd5\uff0c\u5fc5\u987b\u5728\u5b50\u7c7b\u4e2d\u5b9e\u73b0\u3002
Parameters:
Name Type Description Default value
Any
\u7528\u6237\u4f20\u5165\u7684\u503c
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.widgets.dateedit/","title":"pyguiadapter.widgets.dateedit","text":""},{"location":"apis/pyguiadapter.widgets.dateedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEditConfig","title":"DateEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
DateEdit\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\basic\\dateedit.py
@dataclasses.dataclass(frozen=True)\nclass DateEditConfig(CommonParameterWidgetConfig):\n \"\"\"DateEdit\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Union[date, QDate, None] = date.today()\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n min_date: Union[date, QDate, None] = None\n \"\"\"\u63a7\u4ef6\u7684\u6700\u5c0f\u65e5\u671f\"\"\"\n\n max_date: Union[date, QDate, None] = None\n \"\"\"\u63a7\u4ef6\u7684\u6700\u5927\u65e5\u671f\"\"\"\n\n display_format: Optional[str] = None\n \"\"\"\u65e5\u671f\u7684\u663e\u793a\u683c\u5f0f\uff0c\u53ef\u4ee5\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863\uff1a\n [displayFormat](https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/QDateTimeEdit.html#PySide2.QtWidgets.PySide2.QtWidgets.QDateTimeEdit.displayFormat)\n \"\"\"\n\n time_spec: Optional[TimeSpec] = None\n \"\"\"\u65f6\u95f4\u65e5\u671f\u6807\u51c6\uff0c\u53ef\u4ee5\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863:\n [TimeSpec](https://doc.qt.io/qtforpython-5/PySide2/QtCore/Qt.html#PySide2.QtCore.PySide2.QtCore.Qt.TimeSpec)\n \"\"\"\n\n alignment: Alignment = Qt.AlignLeft | Qt.AlignVCenter\n \"\"\"\u5bf9\u9f50\u65b9\u5f0f\uff0c\u53ef\u9009\u503c\u6709\uff1aAlignLeft\u3001AlignRight\u3001AlignCenter\u3001AlignJustify\u7b49\u3002\"\"\"\n\n calendar_popup: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u65e5\u5386\u5f39\u7a97\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"DateEdit\"]:\n return DateEdit\n
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEditConfig.alignment","title":"alignment: Alignment = Qt.AlignLeft | Qt.AlignVCenter
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff0c\u53ef\u9009\u503c\u6709\uff1aAlignLeft\u3001AlignRight\u3001AlignCenter\u3001AlignJustify\u7b49\u3002
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEditConfig.calendar_popup","title":"calendar_popup: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u65e5\u5386\u5f39\u7a97
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEditConfig.default_value","title":"default_value: Union[date, QDate, None] = date.today()
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEditConfig.display_format","title":"display_format: Optional[str] = None
class-attribute
instance-attribute
","text":"\u65e5\u671f\u7684\u663e\u793a\u683c\u5f0f\uff0c\u53ef\u4ee5\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863\uff1a displayFormat
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEditConfig.max_date","title":"max_date: Union[date, QDate, None] = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u6700\u5927\u65e5\u671f
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEditConfig.min_date","title":"min_date: Union[date, QDate, None] = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u6700\u5c0f\u65e5\u671f
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEditConfig.time_spec","title":"time_spec: Optional[TimeSpec] = None
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u6807\u51c6\uff0c\u53ef\u4ee5\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863: TimeSpec
"},{"location":"apis/pyguiadapter.widgets.dateedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEdit","title":"DateEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEdit.AlignCenter","title":"AlignCenter = Qt.AlignCenter
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u5c45\u4e2d\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEdit.AlignJustify","title":"AlignJustify = Qt.AlignJustify
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u4e24\u7aef\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEdit.AlignLeft","title":"AlignLeft = Qt.AlignLeft
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u5de6\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEdit.AlignRight","title":"AlignRight = Qt.AlignRight
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u53f3\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEdit.LocalTime","title":"LocalTime = Qt.LocalTime
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1a\u672c\u5730\u65f6\u95f4
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEdit.OffsetFromUTC","title":"OffsetFromUTC = Qt.OffsetFromUTC
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1aOffsetFromUTC
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEdit.TimeZone","title":"TimeZone = Qt.TimeZone
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1aTimeZone
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEdit.UTC","title":"UTC = Qt.UTC
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1aUTC
"},{"location":"apis/pyguiadapter.widgets.dateedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" datetime.date
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/","title":"pyguiadapter.widgets.datetimeedit","text":""},{"location":"apis/pyguiadapter.widgets.datetimeedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEditConfig","title":"DateTimeEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
DateTimeEdit\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\basic\\datetimeedit.py
@dataclasses.dataclass(frozen=True)\nclass DateTimeEditConfig(CommonParameterWidgetConfig):\n \"\"\"DateTimeEdit\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Union[datetime, QDateTime, None] = dataclasses.field(\n default_factory=datetime.now\n )\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n min_datetime: Union[datetime, QDateTime, None] = None\n \"\"\"\u65f6\u95f4\u65e5\u671f\u7684\u6700\u5c0f\u503c\"\"\"\n\n max_datetime: Union[datetime, QDateTime, None] = None\n \"\"\"\u65f6\u95f4\u65e5\u671f\u7684\u6700\u5927\u503c\"\"\"\n\n display_format: Optional[str] = None\n \"\"\"\u65f6\u95f4\u65e5\u671f\u7684\u663e\u793a\u683c\u5f0f\u3002\u53ef\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863\uff1a\n [displayFormat](https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/QDateTimeEdit.html#PySide2.QtWidgets.PySide2.QtWidgets.QDateTimeEdit.displayFormat)\n \"\"\"\n\n time_spec: Optional[TimeSpec] = None\n \"\"\"\u65f6\u95f4\u65e5\u671f\u6807\u51c6\uff0c\u53ef\u9009\u503c\u6709\uff1aLocalTime\u3001UTC\u3001OffsetFromUTC\u3001TimeZone\u3002\n \u53ef\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863\uff1a\n [TimeSpec](https://doc.qt.io/qtforpython-5/PySide2/QtCore/Qt.html#PySide2.QtCore.PySide2.QtCore.Qt.TimeSpec)\n \"\"\"\n\n alignment: Alignment = Qt.AlignLeft | Qt.AlignVCenter\n \"\"\"\u5bf9\u9f50\u65b9\u5f0f\uff0c\u53ef\u9009\u503c\u6709\uff1aAlignLeft\u3001AlignRight\u3001AlignCenter\u3001AlignJustify\u7b49\u3002\"\"\"\n\n calendar_popup: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u65e5\u5386\u5f39\u7a97\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"DateTimeEdit\"]:\n return DateTimeEdit\n
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEditConfig.alignment","title":"alignment: Alignment = Qt.AlignLeft | Qt.AlignVCenter
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff0c\u53ef\u9009\u503c\u6709\uff1aAlignLeft\u3001AlignRight\u3001AlignCenter\u3001AlignJustify\u7b49\u3002
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEditConfig.calendar_popup","title":"calendar_popup: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u65e5\u5386\u5f39\u7a97
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEditConfig.default_value","title":"default_value: Union[datetime, QDateTime, None] = dataclasses.field(default_factory=datetime.now)
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEditConfig.display_format","title":"display_format: Optional[str] = None
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u663e\u793a\u683c\u5f0f\u3002\u53ef\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863\uff1a displayFormat
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEditConfig.max_datetime","title":"max_datetime: Union[datetime, QDateTime, None] = None
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6700\u5927\u503c
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEditConfig.min_datetime","title":"min_datetime: Union[datetime, QDateTime, None] = None
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6700\u5c0f\u503c
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEditConfig.time_spec","title":"time_spec: Optional[TimeSpec] = None
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u6807\u51c6\uff0c\u53ef\u9009\u503c\u6709\uff1aLocalTime\u3001UTC\u3001OffsetFromUTC\u3001TimeZone\u3002 \u53ef\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863\uff1a TimeSpec
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEdit","title":"DateTimeEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEdit.AlignCenter","title":"AlignCenter = Qt.AlignCenter
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u5c45\u4e2d\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEdit.AlignJustify","title":"AlignJustify = Qt.AlignJustify
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u4e24\u7aef\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEdit.AlignLeft","title":"AlignLeft = Qt.AlignLeft
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u5de6\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEdit.AlignRight","title":"AlignRight = Qt.AlignRight
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u53f3\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEdit.LocalTime","title":"LocalTime = Qt.LocalTime
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1a\u672c\u5730\u65f6\u95f4
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEdit.OffsetFromUTC","title":"OffsetFromUTC = Qt.OffsetFromUTC
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1aOffsetFromUTC
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEdit.TimeZone","title":"TimeZone = Qt.TimeZone
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1aTimeZone
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEdit.UTC","title":"UTC = Qt.UTC
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1aUTC
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" datetime.datetime
"},{"location":"apis/pyguiadapter.widgets.dial/","title":"pyguiadapter.widgets.dial","text":""},{"location":"apis/pyguiadapter.widgets.dial/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig","title":"DialConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
Dial\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\dial.py
@dataclasses.dataclass(frozen=True)\nclass DialConfig(CommonParameterWidgetConfig):\n \"\"\"Dial\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Optional[int] = 0\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n min_value: int = 0\n \"\"\"\u6700\u5c0f\u503c\"\"\"\n\n max_value: int = 100\n \"\"\"\u6700\u5927\u503c\"\"\"\n\n notch_target: Optional[float] = None\n \"\"\"\u7f3a\u53e3\u4e4b\u95f4\u7684\u76ee\u6807\u50cf\u7d20\u6570\"\"\"\n\n notches_visible: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u7f3a\u53e3\"\"\"\n\n wrapping: bool = False\n \"\"\"\u662f\u5426\u5faa\u73af\"\"\"\n\n single_step: int = 1\n \"\"\"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f\"\"\"\n\n page_step: Optional[int] = None\n \"\"\"\u4f7f\u7528PageUp/PageDown\u952e\u65f6\u8c03\u6574\u7684\u6b65\u957f\"\"\"\n\n tracking: bool = True\n \"\"\"\u662f\u5426\u8ddf\u8e2a\u9f20\u6807\"\"\"\n\n inverted_controls: bool = False\n \"\"\"\u662f\u5426\u542f\u7528\u53cd\u8f6c\u63a7\u5236\"\"\"\n\n inverted_appearance: bool = False\n \"\"\"\u662f\u5426\u542f\u7528\u53cd\u8f6c\u5916\u89c2\"\"\"\n\n show_value_label: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u503c\u6807\u7b7e\"\"\"\n\n prefix: str = \"\"\n \"\"\"\u503c\u6807\u7b7e\u7684\u524d\u7f00\"\"\"\n\n suffix: str = \"\"\n \"\"\"\u503c\u6807\u7b7e\u7684\u540e\u7f00\"\"\"\n\n height: Optional[int] = 120\n \"\"\"\u63a7\u4ef6\u7684\u9ad8\u5ea6\"\"\"\n\n width: Optional[int] = None\n \"\"\"\u63a7\u4ef6\u7684\u5bbd\u5ea6\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"Dial\"]:\n return Dial\n
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.default_value","title":"default_value: Optional[int] = 0
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.height","title":"height: Optional[int] = 120
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.inverted_appearance","title":"inverted_appearance: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u53cd\u8f6c\u5916\u89c2
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.inverted_controls","title":"inverted_controls: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u53cd\u8f6c\u63a7\u5236
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.max_value","title":"max_value: int = 100
class-attribute
instance-attribute
","text":"\u6700\u5927\u503c
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.min_value","title":"min_value: int = 0
class-attribute
instance-attribute
","text":"\u6700\u5c0f\u503c
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.notch_target","title":"notch_target: Optional[float] = None
class-attribute
instance-attribute
","text":"\u7f3a\u53e3\u4e4b\u95f4\u7684\u76ee\u6807\u50cf\u7d20\u6570
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.notches_visible","title":"notches_visible: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u7f3a\u53e3
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.page_step","title":"page_step: Optional[int] = None
class-attribute
instance-attribute
","text":"\u4f7f\u7528PageUp/PageDown\u952e\u65f6\u8c03\u6574\u7684\u6b65\u957f
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.prefix","title":"prefix: str = ''
class-attribute
instance-attribute
","text":"\u503c\u6807\u7b7e\u7684\u524d\u7f00
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.show_value_label","title":"show_value_label: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u503c\u6807\u7b7e
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.single_step","title":"single_step: int = 1
class-attribute
instance-attribute
","text":"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.suffix","title":"suffix: str = ''
class-attribute
instance-attribute
","text":"\u503c\u6807\u7b7e\u7684\u540e\u7f00
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.tracking","title":"tracking: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u8ddf\u8e2a\u9f20\u6807
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.wrapping","title":"wrapping: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5faa\u73af
"},{"location":"apis/pyguiadapter.widgets.dial/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.Dial","title":"Dial
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.dial/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" int_dial_t
"},{"location":"apis/pyguiadapter.widgets.dictedit/","title":"pyguiadapter.widgets.dictedit","text":""},{"location":"apis/pyguiadapter.widgets.dictedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.DictEditConfig","title":"DictEditConfig
dataclass
","text":" Bases: PyLiteralEditConfig
DictEdit\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\dictedit.py
@dataclasses.dataclass(frozen=True)\nclass DictEditConfig(PyLiteralEditConfig):\n \"\"\"DictEdit\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[dict] = dataclasses.field(default_factory=dict)\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n height: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6\"\"\"\n\n width: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6\"\"\"\n\n standalone_editor: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668\"\"\"\n\n standalone_editor_button_text: str = \"Edit Dict\"\n \"\"\"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c\"\"\"\n\n standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(\n default_factory=StandaloneCodeEditorConfig\n )\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\"\"\"\n\n initial_text: str = \"{}\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"DictEdit\"]:\n return DictEdit\n
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.DictEditConfig.default_value","title":"default_value: Optional[dict] = dataclasses.field(default_factory=dict)
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.DictEditConfig.height","title":"height: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.DictEditConfig.standalone_editor","title":"standalone_editor: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.DictEditConfig.standalone_editor_button_text","title":"standalone_editor_button_text: str = 'Edit Dict'
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.DictEditConfig.standalone_editor_config","title":"standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(default_factory=StandaloneCodeEditorConfig)
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u914d\u7f6e
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.DictEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig","title":"StandaloneCodeEditorConfig
dataclass
","text":" Bases: object
standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\base.py
@dataclasses.dataclass\nclass StandaloneCodeEditorConfig(object):\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b\"\"\"\n\n title: str = STANDALONE_EDITOR_TITLE\n \"\"\"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898\"\"\"\n\n text_font_family: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\"\"\"\n\n text_font_size: Optional[int] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f\"\"\"\n\n line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n line_wrap_width: int = LINE_WRAP_WIDTH\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6\"\"\"\n\n word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n file_filters: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668\"\"\"\n\n start_dir: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55\"\"\"\n\n use_default_menus: bool = True\n \"\"\"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f\"\"\"\n\n excluded_menus: Tuple[str] = ()\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\"\"\"\n\n excluded_menu_actions: Tuple[Tuple[str, str]] = (\n (MENU_FILE, ACTION_SAVE),\n (MENU_FILE, ACTION_SAVE_AS),\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879\"\"\"\n\n use_default_toolbar: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f\"\"\"\n\n excluded_toolbar_actions: Tuple[str] = (\n ACTION_SAVE,\n ACTION_SAVE_AS,\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879\"\"\"\n\n confirm_dialog: bool = True\n \"\"\"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n confirm_dialog_title: str = CONFIRM_DIALOG_TITLE\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_dialog_message: str = CONFIRM_MSG\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9\"\"\"\n
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog","title":"confirm_dialog: bool = True
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_message","title":"confirm_dialog_message: str = CONFIRM_MSG
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_title","title":"confirm_dialog_title: str = CONFIRM_DIALOG_TITLE
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menu_actions","title":"excluded_menu_actions: Tuple[Tuple[str, str]] = ((MENU_FILE, ACTION_SAVE), (MENU_FILE, ACTION_SAVE_AS))
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menus","title":"excluded_menus: Tuple[str] = ()
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_toolbar_actions","title":"excluded_toolbar_actions: Tuple[str] = (ACTION_SAVE, ACTION_SAVE_AS)
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.file_filters","title":"file_filters: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_mode","title":"line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_width","title":"line_wrap_width: int = LINE_WRAP_WIDTH
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.start_dir","title":"start_dir: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_family","title":"text_font_family: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_size","title":"text_font_size: Optional[int] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.title","title":"title: str = STANDALONE_EDITOR_TITLE
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_menus","title":"use_default_menus: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_toolbar","title":"use_default_toolbar: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.word_wrap_mode","title":"word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.dictedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.DictEdit","title":"DictEdit
","text":" Bases: PyLiteralEdit
"},{"location":"apis/pyguiadapter.widgets.dictedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" dict
typing.Dict
typing.Mapping
typing.MutableMapping
typing.TypedDict
"},{"location":"apis/pyguiadapter.widgets.dirselect/","title":"pyguiadapter.widgets.dirselect","text":""},{"location":"apis/pyguiadapter.widgets.dirselect/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelectConfig","title":"DirSelectConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
DirSelect\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\dirselect.py
@dataclasses.dataclass(frozen=True)\nclass DirSelectConfig(CommonParameterWidgetConfig):\n \"\"\"DirSelect\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Optional[str] = \"\"\n \"\"\"\u9ed8\u8ba4\u503c\"\"\"\n\n placeholder: str = \"\"\n \"\"\"\u5360\u4f4d\u7b26\u6587\u5b57\"\"\"\n\n start_dir: str = \"\"\n \"\"\"\u8d77\u59cb\u76ee\u5f55\"\"\"\n\n dialog_title: str = \"\"\n \"\"\"\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n select_button_text: str = \"...\"\n \"\"\"\u9009\u62e9\u6309\u94ae\u6587\u5b57\"\"\"\n\n clear_button: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae\"\"\"\n\n normalize_path: bool = False\n \"\"\"\u662f\u5426\u5c06\u8def\u5f84\u6807\u51c6\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u8bbe\u7f6e\u63a7\u4ef6\u503c\u6216\u8005\u4ece\u63a7\u4ef6\u83b7\u53d6\u503c\u65f6\uff0c\u4f7f\u7528os.path.normpath()\u51fd\u6570\u8fdb\u884c\u6807\u51c6\u5316\"\"\"\n\n absolutize_path: bool = False\n \"\"\"\u662f\u5426\u5c06\u8def\u5f84\u7edd\u5bf9\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u8bbe\u7f6e\u63a7\u4ef6\u503c\u6216\u8005\u4ece\u63a7\u4ef6\u83b7\u53d6\u503c\u65f6\uff0c\u5c06\u4f7f\u7528os.path.abspath()\u51fd\u6570\u8fdb\u884c\u7edd\u5bf9\u5316\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"DirSelect\"]:\n return DirSelect\n
"},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelectConfig.absolutize_path","title":"absolutize_path: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8def\u5f84\u7edd\u5bf9\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u8bbe\u7f6e\u63a7\u4ef6\u503c\u6216\u8005\u4ece\u63a7\u4ef6\u83b7\u53d6\u503c\u65f6\uff0c\u5c06\u4f7f\u7528os.path.abspath()\u51fd\u6570\u8fdb\u884c\u7edd\u5bf9\u5316
"},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelectConfig.clear_button","title":"clear_button: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae
"},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelectConfig.default_value","title":"default_value: Optional[str] = ''
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelectConfig.dialog_title","title":"dialog_title: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelectConfig.normalize_path","title":"normalize_path: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8def\u5f84\u6807\u51c6\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u8bbe\u7f6e\u63a7\u4ef6\u503c\u6216\u8005\u4ece\u63a7\u4ef6\u83b7\u53d6\u503c\u65f6\uff0c\u4f7f\u7528os.path.normpath()\u51fd\u6570\u8fdb\u884c\u6807\u51c6\u5316
"},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelectConfig.placeholder","title":"placeholder: str = ''
class-attribute
instance-attribute
","text":"\u5360\u4f4d\u7b26\u6587\u5b57
"},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelectConfig.select_button_text","title":"select_button_text: str = '...'
class-attribute
instance-attribute
","text":"\u9009\u62e9\u6309\u94ae\u6587\u5b57
"},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelectConfig.start_dir","title":"start_dir: str = ''
class-attribute
instance-attribute
","text":"\u8d77\u59cb\u76ee\u5f55
"},{"location":"apis/pyguiadapter.widgets.dirselect/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelect","title":"DirSelect
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.dirselect/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" directory_t
dir_t
"},{"location":"apis/pyguiadapter.widgets.enumselect/","title":"pyguiadapter.widgets.enumselect","text":""},{"location":"apis/pyguiadapter.widgets.enumselect/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.enumselect/#pyguiadapter.widgets.EnumSelectConfig","title":"EnumSelectConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
EnumSelect\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\enumselect.py
@dataclasses.dataclass(frozen=True)\nclass EnumSelectConfig(CommonParameterWidgetConfig):\n \"\"\"EnumSelect\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Union[Enum, str, int, None] = 0\n \"\"\"\u9ed8\u8ba4\u7684\u679a\u4e3e\u503c\uff0c\u53ef\u4ee5\u4e3a\u679a\u4e3e\u7c7b\u5bf9\u8c61\u3001\u679a\u4e3e\u5bf9\u8c61\u7684\u540d\u79f0\u6216\u8005\u662f\u9009\u9879\u7684\u7d22\u5f15\"\"\"\n\n icons: Optional[Dict[Union[Enum, str], IconType]] = None\n \"\"\"\u9009\u9879\u7684\u56fe\u6807\uff0c\u9700\u63d0\u4f9b\u679a\u4e3e\u5bf9\u8c61\uff08\u6216\u679a\u4e3e\u5bf9\u8c61\u7684\u540d\u79f0\uff09\u5230\u56fe\u6807\u7684\u6620\u5c04\"\"\"\n\n icon_size: Union[int, Tuple[int, int], QSize, None] = None\n \"\"\"\u9009\u9879\u56fe\u6807\u7684\u5927\u5c0f\"\"\"\n\n enum_class: Optional[Type[Enum]] = None\n\n @classmethod\n def target_widget_class(cls) -> Type[\"EnumSelect\"]:\n return EnumSelect\n
"},{"location":"apis/pyguiadapter.widgets.enumselect/#pyguiadapter.widgets.EnumSelectConfig.default_value","title":"default_value: Union[Enum, str, int, None] = 0
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u7684\u679a\u4e3e\u503c\uff0c\u53ef\u4ee5\u4e3a\u679a\u4e3e\u7c7b\u5bf9\u8c61\u3001\u679a\u4e3e\u5bf9\u8c61\u7684\u540d\u79f0\u6216\u8005\u662f\u9009\u9879\u7684\u7d22\u5f15
"},{"location":"apis/pyguiadapter.widgets.enumselect/#pyguiadapter.widgets.EnumSelectConfig.icon_size","title":"icon_size: Union[int, Tuple[int, int], QSize, None] = None
class-attribute
instance-attribute
","text":"\u9009\u9879\u56fe\u6807\u7684\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.enumselect/#pyguiadapter.widgets.EnumSelectConfig.icons","title":"icons: Optional[Dict[Union[Enum, str], IconType]] = None
class-attribute
instance-attribute
","text":"\u9009\u9879\u7684\u56fe\u6807\uff0c\u9700\u63d0\u4f9b\u679a\u4e3e\u5bf9\u8c61\uff08\u6216\u679a\u4e3e\u5bf9\u8c61\u7684\u540d\u79f0\uff09\u5230\u56fe\u6807\u7684\u6620\u5c04
"},{"location":"apis/pyguiadapter.widgets.enumselect/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.enumselect/#pyguiadapter.widgets.EnumSelect","title":"EnumSelect
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.enumselect/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" enum.Enum
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/","title":"pyguiadapter.widgets.exclusivechoice","text":""},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig","title":"ExclusiveChoiceBoxConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
ExclusiveChoiceBox\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\basic\\exclusivechoice.py
@dataclasses.dataclass(frozen=True)\nclass ExclusiveChoiceBoxConfig(CommonParameterWidgetConfig):\n \"\"\"ExclusiveChoiceBox\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Any = _FIRST_OPTION\n \"\"\"\u9ed8\u8ba4\u9009\u9879\u3002`_FIRST_OPTION`\u662f\u4e00\u4e2a\u7279\u6b8a\u503c\uff0c\u8868\u793a\u9009\u62e9\u9009\u9879\u5217\u8868\u4e2d\u7684\u7b2c\u4e00\u4e2a\u9009\u9879\u3002\"\"\"\n\n choices: Optional[List[Any]] = None\n \"\"\"\u9009\u9879\u5217\u8868\"\"\"\n\n columns: int = 1\n \"\"\"\u9009\u9879\u5217\u6570\"\"\"\n\n show_type_icon: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u9009\u9879\u7c7b\u578b\u56fe\u6807\"\"\"\n\n int_icon: IconType = \"mdi6.alpha-i-circle\"\n \"\"\"\u6574\u6570\u7c7b\u578b\u9009\u9879\u7684\u56fe\u6807\"\"\"\n\n bool_icon: str = \"mdi6.alpha-b-circle\"\n \"\"\"\u5e03\u5c14\u7c7b\u578b\u9009\u9879\u7684\u56fe\u6807\"\"\"\n\n str_icon: str = \"mdi6.alpha-s-box\"\n \"\"\"\u5b57\u7b26\u4e32\u7c7b\u578b\u9009\u9879\u7684\u56fe\u6807\"\"\"\n\n object_icon: str_icon = \"mdi6.alpha-o-box\"\n \"\"\"\u5bf9\u8c61\u7c7b\u578b\u9009\u9879\u7684\u56fe\u6807\"\"\"\n\n icon_size: Union[Tuple[int, int], int, QSize, None] = None\n \"\"\"\u9009\u9879\u56fe\u6807\u5927\u5c0f\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"ExclusiveChoiceBox\"]:\n return ExclusiveChoiceBox\n
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig.bool_icon","title":"bool_icon: str = 'mdi6.alpha-b-circle'
class-attribute
instance-attribute
","text":"\u5e03\u5c14\u7c7b\u578b\u9009\u9879\u7684\u56fe\u6807
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig.choices","title":"choices: Optional[List[Any]] = None
class-attribute
instance-attribute
","text":"\u9009\u9879\u5217\u8868
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig.columns","title":"columns: int = 1
class-attribute
instance-attribute
","text":"\u9009\u9879\u5217\u6570
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig.default_value","title":"default_value: Any = _FIRST_OPTION
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u9009\u9879\u3002_FIRST_OPTION
\u662f\u4e00\u4e2a\u7279\u6b8a\u503c\uff0c\u8868\u793a\u9009\u62e9\u9009\u9879\u5217\u8868\u4e2d\u7684\u7b2c\u4e00\u4e2a\u9009\u9879\u3002
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig.icon_size","title":"icon_size: Union[Tuple[int, int], int, QSize, None] = None
class-attribute
instance-attribute
","text":"\u9009\u9879\u56fe\u6807\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig.int_icon","title":"int_icon: IconType = 'mdi6.alpha-i-circle'
class-attribute
instance-attribute
","text":"\u6574\u6570\u7c7b\u578b\u9009\u9879\u7684\u56fe\u6807
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig.object_icon","title":"object_icon: str_icon = 'mdi6.alpha-o-box'
class-attribute
instance-attribute
","text":"\u5bf9\u8c61\u7c7b\u578b\u9009\u9879\u7684\u56fe\u6807
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig.show_type_icon","title":"show_type_icon: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u9009\u9879\u7c7b\u578b\u56fe\u6807
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig.str_icon","title":"str_icon: str = 'mdi6.alpha-s-box'
class-attribute
instance-attribute
","text":"\u5b57\u7b26\u4e32\u7c7b\u578b\u9009\u9879\u7684\u56fe\u6807
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBox","title":"ExclusiveChoiceBox
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" typing.Literal
"},{"location":"apis/pyguiadapter.widgets.fileselect/","title":"pyguiadapter.widgets.fileselect","text":""},{"location":"apis/pyguiadapter.widgets.fileselect/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig","title":"FileSelectConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
FileSelect\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\fileselect.py
@dataclasses.dataclass(frozen=True)\nclass FileSelectConfig(CommonParameterWidgetConfig):\n \"\"\"FileSelect\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Optional[str] = \"\"\n \"\"\"\u9ed8\u8ba4\u503c\"\"\"\n\n placeholder: str = \"\"\n \"\"\"\u5360\u4f4d\u7b26\u6587\u5b57\"\"\"\n\n dialog_title: str = \"\"\n \"\"\"\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n start_dir: str = \"\"\n \"\"\"\u6587\u4ef6\u5bf9\u8bdd\u6846\u8d77\u59cb\u8def\u5f84\"\"\"\n\n filters: str = \"\"\n \"\"\"\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668\"\"\"\n\n save_file: bool = False\n \"\"\"\u662f\u5426\u4e3a\u4fdd\u5b58\u6587\u4ef6\u5bf9\u8bdd\u6846\"\"\"\n\n select_button_text: str = \"...\"\n \"\"\"\u9009\u62e9\u6309\u94ae\u6587\u5b57\"\"\"\n\n clear_button: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae\"\"\"\n\n drag_n_drop: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u6587\u4ef6\u62d6\u653e\u529f\u80fd\"\"\"\n\n drag_n_drop_filter: Optional[Callable[[str, str], bool]] = default_dnd_filter\n \"\"\"\u6587\u4ef6\u62d6\u653e\u529f\u80fd\u7684\u8fc7\u6ee4\u51fd\u6570\u3002\u8be5\u51fd\u6570\u5e94\u63a5\u6536\u4e24\u4e2a\u53c2\u6570\uff1a\u6587\u4ef6\u8fc7\u6ee4\u5668\uff08\u5373\u672c\u7c7b\u7684`filters`\u5c5e\u6027\uff09\u548c\u62d6\u653e\u7684\u6587\u4ef6\u8def\u5f84\u3002\n \u82e5\u8fd4\u56deTrue\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u53ef\u4ee5\u88ab\u62d6\u653e\uff1b\u5426\u5219\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u4e0d\u80fd\u88ab\u62d6\u653e\u3002\u8be5\u5c5e\u6027\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u4e3aNone\uff0c\u8868\u793a\u4e0d\u5bf9\u62d6\u653e\u6587\u4ef6\u8fdb\u884c\u8fc7\u6ee4\u3002\n \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528`default_dnd_filter`\u51fd\u6570\u4f5c\u4e3a\u8fc7\u6ee4\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u4f1a\u5c06\u5f85\u62d6\u653e\u7684\u6587\u4ef6\u7684\u6587\u4ef6\u540d\u4e0e\u6587\u4ef6\u8fc7\u6ee4\u5668\u8fdb\u884c\u5339\u914d\uff0c\u82e5\u547d\u4e2d\u4efb\u610f\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u5219\u8fd4\u56deTrue\uff0c\n \u5426\u5219\u8fd4\u56deFalse\u3002\u6bd4\u5982\uff0c\u82e5\u6587\u4ef6\u8fc7\u6ee4\u5668\u4e3a'Text files (*.txt);;Python files (*.py)', \u5219\u6587\u4ef6'hello.txt'\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Text files (*.txt)';\n \u6587\u4ef6'hello.py'\u4e5f\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Python files (*.py)'\uff1b\u6587\u4ef6'hello.png'\u5219\u4e0d\u80fd\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u6ca1\u6709\u547d\u4e2d\u4efb\u4f55\u6587\u4ef6\u8fc7\u6ee4\u5668\u3002\"\"\"\n\n normalize_path: bool = False\n \"\"\"\u662f\u5426\u5c06\u8def\u5f84\u6807\u51c6\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u83b7\u53d6\u8def\u5f84\u65f6\uff0c\u5c06\u4f7f\u7528os.path.normpath()\u51fd\u6570\u8fdb\u884c\u6807\u51c6\u5316\"\"\"\n\n absolutize_path: bool = False\n \"\"\"\u662f\u5426\u5c06\u8def\u5f84\u7edd\u5bf9\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u83b7\u53d6\u8def\u5f84\u65f6\uff0c\u5c06\u4f7f\u7528os.path.abspath()\u51fd\u6570\u8fdb\u884c\u7edd\u5bf9\u5316\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"FileSelect\"]:\n return FileSelect\n
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.absolutize_path","title":"absolutize_path: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8def\u5f84\u7edd\u5bf9\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u83b7\u53d6\u8def\u5f84\u65f6\uff0c\u5c06\u4f7f\u7528os.path.abspath()\u51fd\u6570\u8fdb\u884c\u7edd\u5bf9\u5316
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.clear_button","title":"clear_button: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.default_value","title":"default_value: Optional[str] = ''
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.dialog_title","title":"dialog_title: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.drag_n_drop","title":"drag_n_drop: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u6587\u4ef6\u62d6\u653e\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.drag_n_drop_filter","title":"drag_n_drop_filter: Optional[Callable[[str, str], bool]] = default_dnd_filter
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u62d6\u653e\u529f\u80fd\u7684\u8fc7\u6ee4\u51fd\u6570\u3002\u8be5\u51fd\u6570\u5e94\u63a5\u6536\u4e24\u4e2a\u53c2\u6570\uff1a\u6587\u4ef6\u8fc7\u6ee4\u5668\uff08\u5373\u672c\u7c7b\u7684filters
\u5c5e\u6027\uff09\u548c\u62d6\u653e\u7684\u6587\u4ef6\u8def\u5f84\u3002 \u82e5\u8fd4\u56deTrue\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u53ef\u4ee5\u88ab\u62d6\u653e\uff1b\u5426\u5219\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u4e0d\u80fd\u88ab\u62d6\u653e\u3002\u8be5\u5c5e\u6027\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u4e3aNone\uff0c\u8868\u793a\u4e0d\u5bf9\u62d6\u653e\u6587\u4ef6\u8fdb\u884c\u8fc7\u6ee4\u3002 \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528default_dnd_filter
\u51fd\u6570\u4f5c\u4e3a\u8fc7\u6ee4\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u4f1a\u5c06\u5f85\u62d6\u653e\u7684\u6587\u4ef6\u7684\u6587\u4ef6\u540d\u4e0e\u6587\u4ef6\u8fc7\u6ee4\u5668\u8fdb\u884c\u5339\u914d\uff0c\u82e5\u547d\u4e2d\u4efb\u610f\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u5219\u8fd4\u56deTrue\uff0c \u5426\u5219\u8fd4\u56deFalse\u3002\u6bd4\u5982\uff0c\u82e5\u6587\u4ef6\u8fc7\u6ee4\u5668\u4e3a'Text files (.txt);;Python files (.py)', \u5219\u6587\u4ef6'hello.txt'\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Text files (.txt)'; \u6587\u4ef6'hello.py'\u4e5f\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Python files (.py)'\uff1b\u6587\u4ef6'hello.png'\u5219\u4e0d\u80fd\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u6ca1\u6709\u547d\u4e2d\u4efb\u4f55\u6587\u4ef6\u8fc7\u6ee4\u5668\u3002
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.filters","title":"filters: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.normalize_path","title":"normalize_path: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8def\u5f84\u6807\u51c6\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u83b7\u53d6\u8def\u5f84\u65f6\uff0c\u5c06\u4f7f\u7528os.path.normpath()\u51fd\u6570\u8fdb\u884c\u6807\u51c6\u5316
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.placeholder","title":"placeholder: str = ''
class-attribute
instance-attribute
","text":"\u5360\u4f4d\u7b26\u6587\u5b57
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.save_file","title":"save_file: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u4e3a\u4fdd\u5b58\u6587\u4ef6\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.select_button_text","title":"select_button_text: str = '...'
class-attribute
instance-attribute
","text":"\u9009\u62e9\u6309\u94ae\u6587\u5b57
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.start_dir","title":"start_dir: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5bf9\u8bdd\u6846\u8d77\u59cb\u8def\u5f84
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig","title":"MultiFileSelectConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
MultiFileSelect\u7684\u914d\u7f6e\u7c7b\u3002
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.absolutize_path","title":"absolutize_path: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8def\u5f84\u7edd\u5bf9\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u8bbe\u7f6e\u63a7\u4ef6\u503c\u6216\u8005\u4ece\u63a7\u4ef6\u83b7\u53d6\u503c\u65f6\uff0c\u5c06\u4f7f\u7528os.path.abspath()\u51fd\u6570\u8fdb\u884c\u7edd\u5bf9\u5316
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.clear_button","title":"clear_button: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.default_value","title":"default_value: Union[Sequence[str], str, type(None)] = ()
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.dialog_title","title":"dialog_title: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.drag_n_drop","title":"drag_n_drop: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u6587\u4ef6\u62d6\u653e\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.drag_n_drop_filter","title":"drag_n_drop_filter: Optional[Callable[[str, str], bool]] = default_dnd_filter
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u62d6\u653e\u529f\u80fd\u7684\u8fc7\u6ee4\u51fd\u6570\u3002\u8be5\u51fd\u6570\u5e94\u63a5\u6536\u4e24\u4e2a\u53c2\u6570\uff1a\u6587\u4ef6\u8fc7\u6ee4\u5668\uff08\u5373\u672c\u7c7b\u7684filters
\u5c5e\u6027\uff09\u548c\u62d6\u653e\u7684\u6587\u4ef6\u8def\u5f84\u3002 \u82e5\u8fd4\u56deTrue\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u53ef\u4ee5\u88ab\u62d6\u653e\uff1b\u5426\u5219\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u4e0d\u80fd\u88ab\u62d6\u653e\u3002\u8be5\u5c5e\u6027\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u4e3aNone\uff0c\u8868\u793a\u4e0d\u5bf9\u62d6\u653e\u6587\u4ef6\u8fdb\u884c\u8fc7\u6ee4\u3002 \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528default_dnd_filter
\u51fd\u6570\u4f5c\u4e3a\u8fc7\u6ee4\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u4f1a\u5c06\u5f85\u62d6\u653e\u7684\u6587\u4ef6\u7684\u6587\u4ef6\u540d\u4e0e\u6587\u4ef6\u8fc7\u6ee4\u5668\u8fdb\u884c\u5339\u914d\uff0c\u82e5\u547d\u4e2d\u4efb\u610f\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u5219\u8fd4\u56deTrue\uff0c \u5426\u5219\u8fd4\u56deFalse\u3002\u6bd4\u5982\uff0c\u82e5\u6587\u4ef6\u8fc7\u6ee4\u5668\u4e3a'Text files (.txt);;Python files (.py)', \u5219\u6587\u4ef6'hello.txt'\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Text files (.txt)'; \u6587\u4ef6'hello.py'\u4e5f\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Python files (.py)'\uff1b\u6587\u4ef6'hello.png'\u5219\u4e0d\u80fd\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u6ca1\u6709\u547d\u4e2d\u4efb\u4f55\u6587\u4ef6\u8fc7\u6ee4\u5668\u3002
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.file_separator","title":"file_separator: str = ';;'
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5206\u9694\u7b26
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.filters","title":"filters: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.normalize_path","title":"normalize_path: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8def\u5f84\u6807\u51c6\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u8bbe\u7f6e\u63a7\u4ef6\u503c\u6216\u8005\u4ece\u63a7\u4ef6\u83b7\u53d6\u503c\u65f6\uff0c\u4f7f\u7528os.path.normpath()\u51fd\u6570\u8fdb\u884c\u6807\u51c6\u5316
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.placeholder","title":"placeholder: str = ''
class-attribute
instance-attribute
","text":"\u5360\u4f4d\u7b26\u6587\u5b57
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.select_button_text","title":"select_button_text: str = '...'
class-attribute
instance-attribute
","text":"\u9009\u62e9\u6309\u94ae\u6587\u5b57
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.start_dir","title":"start_dir: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5bf9\u8bdd\u6846\u8d77\u59cb\u8def\u5f84
"},{"location":"apis/pyguiadapter.widgets.fileselect/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelect","title":"FileSelect
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelect","title":"MultiFileSelect
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.fileselect/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" file_t
files_t
"},{"location":"apis/pyguiadapter.widgets.floatedit/","title":"pyguiadapter.widgets.floatedit","text":""},{"location":"apis/pyguiadapter.widgets.floatedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEditConfig","title":"FloatLineEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
FloatLineEdit\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\floatedit.py
@dataclasses.dataclass(frozen=True)\nclass FloatLineEditConfig(CommonParameterWidgetConfig):\n \"\"\"FloatLineEdit\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Optional[float] = 0.0\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n min_value: float = -2147483648.0\n \"\"\"\u6700\u5c0f\u503c\"\"\"\n\n max_value: float = 2147483647.0\n \"\"\"\u6700\u5927\u503c\"\"\"\n\n decimals: int = 2\n \"\"\"\u5c0f\u6570\u70b9\u540e\u4f4d\u6570\"\"\"\n\n scientific_notation: bool = False\n \"\"\"\u662f\u5426\u4f7f\u7528\u79d1\u5b66\u8ba1\u6570\u6cd5\"\"\"\n\n placeholder: str = \"\"\n \"\"\"\u5360\u4f4d\u7b26\u6587\u672c\"\"\"\n\n clear_button: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae\"\"\"\n\n empty_value: Optional[float] = 0.0\n \"\"\"\u8f93\u5165\u6846\u4e3a\u7a7a\u65f6\u7684\u9ed8\u8ba4\u503c\uff0c\u82e5\u8bbe\u7f6e\u4e3aNone\u5219\u8868\u793a\u4e0d\u5141\u8bb8\u8f93\u5165\u7a7a\u503c\uff0c\u7528\u6237\u8f93\u5165\u7a7a\u503c\uff0c\u83b7\u53d6\u548c\u8bbe\u7f6e\u503c\u65f6\u4f1a\u629b\u51faParameterError\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"FloatLineEdit\"]:\n return FloatLineEdit\n
"},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEditConfig.clear_button","title":"clear_button: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae
"},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEditConfig.decimals","title":"decimals: int = 2
class-attribute
instance-attribute
","text":"\u5c0f\u6570\u70b9\u540e\u4f4d\u6570
"},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEditConfig.default_value","title":"default_value: Optional[float] = 0.0
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEditConfig.empty_value","title":"empty_value: Optional[float] = 0.0
class-attribute
instance-attribute
","text":"\u8f93\u5165\u6846\u4e3a\u7a7a\u65f6\u7684\u9ed8\u8ba4\u503c\uff0c\u82e5\u8bbe\u7f6e\u4e3aNone\u5219\u8868\u793a\u4e0d\u5141\u8bb8\u8f93\u5165\u7a7a\u503c\uff0c\u7528\u6237\u8f93\u5165\u7a7a\u503c\uff0c\u83b7\u53d6\u548c\u8bbe\u7f6e\u503c\u65f6\u4f1a\u629b\u51faParameterError
"},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEditConfig.max_value","title":"max_value: float = 2147483647.0
class-attribute
instance-attribute
","text":"\u6700\u5927\u503c
"},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEditConfig.min_value","title":"min_value: float = -2147483648.0
class-attribute
instance-attribute
","text":"\u6700\u5c0f\u503c
"},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEditConfig.placeholder","title":"placeholder: str = ''
class-attribute
instance-attribute
","text":"\u5360\u4f4d\u7b26\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEditConfig.scientific_notation","title":"scientific_notation: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7f\u7528\u79d1\u5b66\u8ba1\u6570\u6cd5
"},{"location":"apis/pyguiadapter.widgets.floatedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEdit","title":"FloatLineEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.floatedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" float_t
"},{"location":"apis/pyguiadapter.widgets.floatspin/","title":"pyguiadapter.widgets.floatspin","text":""},{"location":"apis/pyguiadapter.widgets.floatspin/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.floatspin/#pyguiadapter.widgets.FloatSpinBoxConfig","title":"FloatSpinBoxConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
Source code in pyguiadapter\\widgets\\basic\\floatspin.py
@dataclasses.dataclass(frozen=True)\nclass FloatSpinBoxConfig(CommonParameterWidgetConfig):\n default_value: Optional[float] = 0.0\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n min_value: float = -2147483648.0\n \"\"\"\u6700\u5c0f\u503c\"\"\"\n\n max_value: float = 2147483647.0\n \"\"\"\u6700\u5927\u503c\"\"\"\n\n step: Optional[float] = 1.0\n \"\"\"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f\"\"\"\n\n decimals: Optional[int] = 2\n \"\"\"\u5c0f\u6570\u70b9\u540e\u663e\u793a\u7684\u4f4d\u6570\"\"\"\n\n prefix: str = \"\"\n \"\"\"\u524d\u7f00\"\"\"\n\n suffix: str = \"\"\n \"\"\"\u540e\u7f00\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"FloatSpinBox\"]:\n return FloatSpinBox\n
"},{"location":"apis/pyguiadapter.widgets.floatspin/#pyguiadapter.widgets.FloatSpinBoxConfig.decimals","title":"decimals: Optional[int] = 2
class-attribute
instance-attribute
","text":"\u5c0f\u6570\u70b9\u540e\u663e\u793a\u7684\u4f4d\u6570
"},{"location":"apis/pyguiadapter.widgets.floatspin/#pyguiadapter.widgets.FloatSpinBoxConfig.default_value","title":"default_value: Optional[float] = 0.0
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.floatspin/#pyguiadapter.widgets.FloatSpinBoxConfig.max_value","title":"max_value: float = 2147483647.0
class-attribute
instance-attribute
","text":"\u6700\u5927\u503c
"},{"location":"apis/pyguiadapter.widgets.floatspin/#pyguiadapter.widgets.FloatSpinBoxConfig.min_value","title":"min_value: float = -2147483648.0
class-attribute
instance-attribute
","text":"\u6700\u5c0f\u503c
"},{"location":"apis/pyguiadapter.widgets.floatspin/#pyguiadapter.widgets.FloatSpinBoxConfig.prefix","title":"prefix: str = ''
class-attribute
instance-attribute
","text":"\u524d\u7f00
"},{"location":"apis/pyguiadapter.widgets.floatspin/#pyguiadapter.widgets.FloatSpinBoxConfig.step","title":"step: Optional[float] = 1.0
class-attribute
instance-attribute
","text":"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f
"},{"location":"apis/pyguiadapter.widgets.floatspin/#pyguiadapter.widgets.FloatSpinBoxConfig.suffix","title":"suffix: str = ''
class-attribute
instance-attribute
","text":"\u540e\u7f00
"},{"location":"apis/pyguiadapter.widgets.floatspin/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.floatspin/#pyguiadapter.widgets.FloatSpinBox","title":"FloatSpinBox
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.floatspin/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" float
"},{"location":"apis/pyguiadapter.widgets.fontselect/","title":"pyguiadapter.widgets.fontselect","text":""},{"location":"apis/pyguiadapter.widgets.fontselect/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelectConfig","title":"FontSelectConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
FontSelect\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\extend\\fontselect.py
@dataclasses.dataclass(frozen=True)\nclass FontSelectConfig(CommonParameterWidgetConfig):\n \"\"\"FontSelect\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Union[str, Type[_DefaultFont], Type[_FirstFont], None] = _DefaultFont\n \"\"\"\u9ed8\u8ba4\u503c\uff0c\u53ef\u4ee5\u4e3a\u5b57\u4f53\u540d\u79f0\uff08\u5b57\u7b26\u4e32\uff09\uff0c\u6216\u8005\u4ee5\u4e0b\u7279\u6b8a\u503c\uff1a`_DefaultFont`(\u9ed8\u8ba4\u5b57\u4f53)\uff0c`_FirstFont`(\u7b2c\u4e00\u4e2a\u53ef\u7528\u5b57\u4f53)\"\"\"\n\n font_filters: Union[FontFilter, int, None] = None\n \"\"\"\u5b57\u4f53\u8fc7\u6ee4\u5668\uff0c\u53ef\u4ee5\u4e3a\u5355\u4e2a`FontFilter`\u679a\u4e3e\u503c\uff0c\u591a\u79cd\u591a\u4e2a\u679a\u4e3e\u503c\u7684\u8054\u5408\uff0c\u6bd4\u5982\uff1a`FontFilter.ScalableFonts | FontFilter.ProportionalFonts`\"\"\"\n\n writing_system: Optional[WritingSystem] = None\n \"\"\"\u4e66\u5199\u7cfb\u7edf\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"FontSelect\"]:\n return FontSelect\n
"},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelectConfig.default_value","title":"default_value: Union[str, Type[_DefaultFont], Type[_FirstFont], None] = _DefaultFont
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c\uff0c\u53ef\u4ee5\u4e3a\u5b57\u4f53\u540d\u79f0\uff08\u5b57\u7b26\u4e32\uff09\uff0c\u6216\u8005\u4ee5\u4e0b\u7279\u6b8a\u503c\uff1a_DefaultFont
(\u9ed8\u8ba4\u5b57\u4f53)\uff0c_FirstFont
(\u7b2c\u4e00\u4e2a\u53ef\u7528\u5b57\u4f53)
"},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelectConfig.font_filters","title":"font_filters: Union[FontFilter, int, None] = None
class-attribute
instance-attribute
","text":"\u5b57\u4f53\u8fc7\u6ee4\u5668\uff0c\u53ef\u4ee5\u4e3a\u5355\u4e2aFontFilter
\u679a\u4e3e\u503c\uff0c\u591a\u79cd\u591a\u4e2a\u679a\u4e3e\u503c\u7684\u8054\u5408\uff0c\u6bd4\u5982\uff1aFontFilter.ScalableFonts | FontFilter.ProportionalFonts
"},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelectConfig.writing_system","title":"writing_system: Optional[WritingSystem] = None
class-attribute
instance-attribute
","text":"\u4e66\u5199\u7cfb\u7edf
"},{"location":"apis/pyguiadapter.widgets.fontselect/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelect","title":"FontSelect
","text":" Bases: CommonParameterWidget
\u5b57\u4f53\u9009\u62e9\u63a7\u4ef6
"},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelect.AllFonts","title":"AllFonts = FontFilter.AllFonts
class-attribute
instance-attribute
","text":"\u5b57\u4f53\u8fc7\u6ee4\u5668\uff1a\u6240\u6709\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelect.MonospacedFonts","title":"MonospacedFonts = FontFilter.MonospacedFonts
class-attribute
instance-attribute
","text":"\u5b57\u4f53\u8fc7\u6ee4\u5668\uff1a\u7b49\u5bbd\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelect.NonScalableFonts","title":"NonScalableFonts = FontFilter.NonScalableFonts
class-attribute
instance-attribute
","text":"\u5b57\u4f53\u8fc7\u6ee4\u5668\uff1a\u4e0d\u53ef\u7f29\u653e\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelect.ProportionalFonts","title":"ProportionalFonts = FontFilter.ProportionalFonts
class-attribute
instance-attribute
","text":"\u5b57\u4f53\u8fc7\u6ee4\u5668\uff1a\u6bd4\u4f8b\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelect.ScalableFonts","title":"ScalableFonts = FontFilter.ScalableFonts
class-attribute
instance-attribute
","text":"\u5b57\u4f53\u8fc7\u6ee4\u5668\uff1a\u53ef\u7f29\u653e\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelect.WritingSystem","title":"WritingSystem = QFontDatabase.WritingSystem
class-attribute
instance-attribute
","text":"\u4e66\u5199\u7cfb\u7edf
"},{"location":"apis/pyguiadapter.widgets.fontselect/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" font_t
"},{"location":"apis/pyguiadapter.widgets.intedit/","title":"pyguiadapter.widgets.intedit","text":""},{"location":"apis/pyguiadapter.widgets.intedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.intedit/#pyguiadapter.widgets.IntLineEditConfig","title":"IntLineEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
IntLineEdit\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\extend\\intedit.py
@dataclasses.dataclass(frozen=True)\nclass IntLineEditConfig(CommonParameterWidgetConfig):\n \"\"\"IntLineEdit\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[int] = 0\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n placeholder: str = \"\"\n \"\"\"\u8f93\u5165\u6846\u7684\u5360\u4f4d\u7b26\u6587\u672c\"\"\"\n\n clear_button: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae\"\"\"\n\n min_value: int = -2147483648\n \"\"\"\u6700\u5c0f\u503c\"\"\"\n\n max_value: int = 2147483647\n \"\"\"\u6700\u5927\u503c\"\"\"\n\n empty_value: Optional[int] = 0\n \"\"\"\u8f93\u5165\u6846\u4e3a\u7a7a\u65f6\u7684\u9ed8\u8ba4\u503c\uff0c\u82e5\u8bbe\u7f6e\u4e3aNone\u5219\u8868\u793a\u4e0d\u5141\u8bb8\u8f93\u5165\u7a7a\u503c\uff0c\u7528\u6237\u8f93\u5165\u7a7a\u503c\uff0c\u83b7\u53d6\u548c\u8bbe\u7f6e\u503c\u65f6\u4f1a\u629b\u51faParameterError\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"IntLineEdit\"]:\n return IntLineEdit\n
"},{"location":"apis/pyguiadapter.widgets.intedit/#pyguiadapter.widgets.IntLineEditConfig.clear_button","title":"clear_button: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae
"},{"location":"apis/pyguiadapter.widgets.intedit/#pyguiadapter.widgets.IntLineEditConfig.default_value","title":"default_value: Optional[int] = 0
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.intedit/#pyguiadapter.widgets.IntLineEditConfig.empty_value","title":"empty_value: Optional[int] = 0
class-attribute
instance-attribute
","text":"\u8f93\u5165\u6846\u4e3a\u7a7a\u65f6\u7684\u9ed8\u8ba4\u503c\uff0c\u82e5\u8bbe\u7f6e\u4e3aNone\u5219\u8868\u793a\u4e0d\u5141\u8bb8\u8f93\u5165\u7a7a\u503c\uff0c\u7528\u6237\u8f93\u5165\u7a7a\u503c\uff0c\u83b7\u53d6\u548c\u8bbe\u7f6e\u503c\u65f6\u4f1a\u629b\u51faParameterError
"},{"location":"apis/pyguiadapter.widgets.intedit/#pyguiadapter.widgets.IntLineEditConfig.max_value","title":"max_value: int = 2147483647
class-attribute
instance-attribute
","text":"\u6700\u5927\u503c
"},{"location":"apis/pyguiadapter.widgets.intedit/#pyguiadapter.widgets.IntLineEditConfig.min_value","title":"min_value: int = -2147483648
class-attribute
instance-attribute
","text":"\u6700\u5c0f\u503c
"},{"location":"apis/pyguiadapter.widgets.intedit/#pyguiadapter.widgets.IntLineEditConfig.placeholder","title":"placeholder: str = ''
class-attribute
instance-attribute
","text":"\u8f93\u5165\u6846\u7684\u5360\u4f4d\u7b26\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.intedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.intedit/#pyguiadapter.widgets.IntLineEdit","title":"IntLineEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.intedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" int_t
"},{"location":"apis/pyguiadapter.widgets.intspin/","title":"pyguiadapter.widgets.intspin","text":""},{"location":"apis/pyguiadapter.widgets.intspin/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.intspin/#pyguiadapter.widgets.IntSpinBoxConfig","title":"IntSpinBoxConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
IntSpinBox\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\intspin.py
@dataclasses.dataclass(frozen=True)\nclass IntSpinBoxConfig(CommonParameterWidgetConfig):\n \"\"\"IntSpinBox\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[int] = 0\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n min_value: int = -2147483648\n \"\"\"\u6700\u5c0f\u503c\"\"\"\n\n max_value: int = 2147483647\n \"\"\"\u6700\u5927\u503c\"\"\"\n\n step: int = 1\n \"\"\"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f\"\"\"\n\n prefix: str = \"\"\n \"\"\"\u524d\u7f00\"\"\"\n\n suffix: str = \"\"\n \"\"\"\u540e\u7f00\"\"\"\n\n display_integer_base: int = 10\n \"\"\"\u6574\u6570\u663e\u793a\u8fdb\u5236\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"IntSpinBox\"]:\n return IntSpinBox\n
"},{"location":"apis/pyguiadapter.widgets.intspin/#pyguiadapter.widgets.IntSpinBoxConfig.default_value","title":"default_value: Optional[int] = 0
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.intspin/#pyguiadapter.widgets.IntSpinBoxConfig.display_integer_base","title":"display_integer_base: int = 10
class-attribute
instance-attribute
","text":"\u6574\u6570\u663e\u793a\u8fdb\u5236
"},{"location":"apis/pyguiadapter.widgets.intspin/#pyguiadapter.widgets.IntSpinBoxConfig.max_value","title":"max_value: int = 2147483647
class-attribute
instance-attribute
","text":"\u6700\u5927\u503c
"},{"location":"apis/pyguiadapter.widgets.intspin/#pyguiadapter.widgets.IntSpinBoxConfig.min_value","title":"min_value: int = -2147483648
class-attribute
instance-attribute
","text":"\u6700\u5c0f\u503c
"},{"location":"apis/pyguiadapter.widgets.intspin/#pyguiadapter.widgets.IntSpinBoxConfig.prefix","title":"prefix: str = ''
class-attribute
instance-attribute
","text":"\u524d\u7f00
"},{"location":"apis/pyguiadapter.widgets.intspin/#pyguiadapter.widgets.IntSpinBoxConfig.step","title":"step: int = 1
class-attribute
instance-attribute
","text":"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f
"},{"location":"apis/pyguiadapter.widgets.intspin/#pyguiadapter.widgets.IntSpinBoxConfig.suffix","title":"suffix: str = ''
class-attribute
instance-attribute
","text":"\u540e\u7f00
"},{"location":"apis/pyguiadapter.widgets.intspin/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.intspin/#pyguiadapter.widgets.IntSpinBox","title":"IntSpinBox
","text":" Bases: CommonParameterWidget
\u6574\u6570\u8f93\u5165\u6846\u63a7\u4ef6\uff0cSpinBox\u5f62\u5f0f\u3002\u662fint
\u7c7b\u578b\u53c2\u6570\u7684\u9ed8\u8ba4\u63a7\u4ef6\u3002
"},{"location":"apis/pyguiadapter.widgets.intspin/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" int
"},{"location":"apis/pyguiadapter.widgets.jsonedit/","title":"pyguiadapter.widgets.jsonedit","text":""},{"location":"apis/pyguiadapter.widgets.jsonedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.jsonedit/#pyguiadapter.widgets.JsonEditConfig","title":"JsonEditConfig
dataclass
","text":" Bases: BaseCodeEditConfig
JsonEdit\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\jsonedit.py
@dataclasses.dataclass(frozen=True)\nclass JsonEditConfig(BaseCodeEditConfig):\n \"\"\"JsonEdit\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Optional[Any] = dataclasses.field(default_factory=dict)\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n height: Optional[int] = 230\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6\"\"\"\n\n width: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6\"\"\"\n\n standalone_editor: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668\"\"\"\n\n standalone_editor_button_text: str = \"Edit Json\"\n \"\"\"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c\"\"\"\n\n standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(\n default_factory=StandaloneCodeEditorConfig\n )\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\"\"\"\n\n indent_size: int = 2\n \"\"\"json\u683c\u5f0f\u5316\u7f29\u8fdb\u5927\u5c0f\"\"\"\n\n initial_text: str = \"{}\"\n\n highlighter: Type[QJSONHighlighter] = QJSONHighlighter\n formatter: JsonFormatter = dataclasses.field(default_factory=JsonFormatter)\n\n @classmethod\n def target_widget_class(cls) -> Type[\"JsonEdit\"]:\n return JsonEdit\n
"},{"location":"apis/pyguiadapter.widgets.jsonedit/#pyguiadapter.widgets.JsonEditConfig.default_value","title":"default_value: Optional[Any] = dataclasses.field(default_factory=dict)
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.jsonedit/#pyguiadapter.widgets.JsonEditConfig.height","title":"height: Optional[int] = 230
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.jsonedit/#pyguiadapter.widgets.JsonEditConfig.indent_size","title":"indent_size: int = 2
class-attribute
instance-attribute
","text":"json\u683c\u5f0f\u5316\u7f29\u8fdb\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.jsonedit/#pyguiadapter.widgets.JsonEditConfig.standalone_editor","title":"standalone_editor: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668
"},{"location":"apis/pyguiadapter.widgets.jsonedit/#pyguiadapter.widgets.JsonEditConfig.standalone_editor_button_text","title":"standalone_editor_button_text: str = 'Edit Json'
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.jsonedit/#pyguiadapter.widgets.JsonEditConfig.standalone_editor_config","title":"standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(default_factory=StandaloneCodeEditorConfig)
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u914d\u7f6e
"},{"location":"apis/pyguiadapter.widgets.jsonedit/#pyguiadapter.widgets.JsonEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.jsonedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.jsonedit/#pyguiadapter.widgets.JsonEdit","title":"JsonEdit
","text":" Bases: BaseCodeEdit
"},{"location":"apis/pyguiadapter.widgets.jsonedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" json_obj_t
"},{"location":"apis/pyguiadapter.widgets.keysequenceedit/","title":"pyguiadapter.widgets.keysequenceedit","text":""},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#pyguiadapter.widgets.KeySequenceEditConfig","title":"KeySequenceEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
KeySequenceEdit\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\keysequenceedit.py
@dataclasses.dataclass(frozen=True)\nclass KeySequenceEditConfig(CommonParameterWidgetConfig):\n \"\"\"KeySequenceEdit\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Union[str, QKeySequence, None] = \"\"\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n key_sequence_format: KeySequenceFormat = QKeySequence.PortableText\n \"\"\"\u6309\u952e\u5e8f\u5217\u683c\u5f0f\"\"\"\n\n return_type: Literal[\"str\", \"list\"] = \"str\"\n \"\"\"\u8fd4\u56de\u503c\u7c7b\u578b\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"KeySequenceEdit\"]:\n return KeySequenceEdit\n
"},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#pyguiadapter.widgets.KeySequenceEditConfig.default_value","title":"default_value: Union[str, QKeySequence, None] = ''
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#pyguiadapter.widgets.KeySequenceEditConfig.key_sequence_format","title":"key_sequence_format: KeySequenceFormat = QKeySequence.PortableText
class-attribute
instance-attribute
","text":"\u6309\u952e\u5e8f\u5217\u683c\u5f0f
"},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#pyguiadapter.widgets.KeySequenceEditConfig.return_type","title":"return_type: Literal['str', 'list'] = 'str'
class-attribute
instance-attribute
","text":"\u8fd4\u56de\u503c\u7c7b\u578b
"},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#pyguiadapter.widgets.KeySequenceEdit","title":"KeySequenceEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#pyguiadapter.widgets.KeySequenceEdit.NativeText","title":"NativeText = QKeySequence.NativeText
class-attribute
instance-attribute
","text":"\u6309\u952e\u5e8f\u5217\u683c\u5f0f\uff1aNativeText
"},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#pyguiadapter.widgets.KeySequenceEdit.PortableText","title":"PortableText = QKeySequence.PortableText
class-attribute
instance-attribute
","text":"\u6309\u952e\u5e8f\u5217\u683c\u5f0f\uff1aPortableText
"},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#pyguiadapter.widgets.KeySequenceEdit.split_key_sequences","title":"split_key_sequences(key_sequences: str) -> list
staticmethod
","text":"\u5c06\u4e00\u7ec4\u6309\u952e\u5e8f\u5217\u5b57\u7b26\u4e32\u5206\u5272\u6210\u5355\u4e2a\u6309\u952e\u5e8f\u5217\u7ec4\u6210\u7684\u5217\u8868\u3002
\u6bd4\u5982\uff1a
\"Ctrl+Alt+A, Ctrl+B, Ctrl+C\" -> [\"Ctrl+Alt+A\", \"Ctrl+B\", \"Ctrl+C\"]
\u53c8\u6bd4\u5982\uff1a
\"Ctrl+A, Ctrl+B, ,, Ctrl+,, B, C\" -> [\"Ctrl+A\", \"Ctrl+B\", \"Ctrl+,\", \",\", \"B\", \"C\"]
Parameters:
Name Type Description Default key_sequences
str
\u6309\u952e\u5e8f\u5217\u5b57\u7b26\u4e32
required Returns:
Type Description list
\u6309\u952e\u5e8f\u5217\u7ec4\u6210\u7684\u5217\u8868
"},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" key_sequence_t
"},{"location":"apis/pyguiadapter.widgets.lineedit/","title":"pyguiadapter.widgets.lineedit","text":""},{"location":"apis/pyguiadapter.widgets.lineedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig","title":"LineEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
LineEdit\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\lineedit.py
@dataclasses.dataclass(frozen=True)\nclass LineEditConfig(CommonParameterWidgetConfig):\n \"\"\"LineEdit\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[str] = \"\"\n \"\"\"\u9ed8\u8ba4\u503c\"\"\"\n\n placeholder: str = \"\"\n \"\"\"\u5360\u4f4d\u6587\u672c\uff0c\u8f93\u5165\u6846\u4e3a\u7a7a\u65f6\u5c06\u663e\u793a\u8be5\u6587\u672c\"\"\"\n\n clear_button: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae\"\"\"\n\n echo_mode: Optional[EchoMode] = None\n \"\"\"\u56de\u663e\u6a21\u5f0f\uff0c\u9ed8\u8ba4\u4e3aNormal\"\"\"\n\n alignment: Optional[Alignment] = None\n \"\"\"\u8f93\u5165\u6587\u672c\u7684\u5bf9\u9f50\u65b9\u5f0f\uff0c\u9ed8\u8ba4\u4e3aAlignLeft\"\"\"\n\n input_mask: Optional[str] = None\n \"\"\"\u8f93\u5165\u63a9\u7801\uff0c\u7528\u4e8e\u9650\u5236\u7528\u6237\u8f93\u5165\uff0c\u53ef\u4ee5\u53c2\u8003\uff1ahttps://doc.qt.io/qt-5/qlineedit.html#inputMask-prop\"\"\"\n\n max_length: Optional[int] = None\n \"\"\"\u6700\u5927\u957f\u5ea6\"\"\"\n\n validator: Union[QValidator, str, None] = None\n \"\"\"\u8f93\u5165\u9a8c\u8bc1\u5668\uff0c\u53ef\u4ee5\u662fQValidator\u5bf9\u8c61\uff0c\u4e5f\u53ef\u4ee5\u662f\u6b63\u5219\u8868\u8fbe\u5f0f\u5b57\u7b26\u4e32\uff0c\u9ed8\u8ba4\u65e0\u9a8c\u8bc1\u5668\"\"\"\n\n drag_enabled: bool = True\n \"\"\"\u662f\u5426\u5141\u8bb8\u62d6\u62fd\"\"\"\n\n frame: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u8fb9\u6846\"\"\"\n\n readonly: bool = False\n \"\"\"\u662f\u5426\u53ea\u8bfb\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"LineEdit\"]:\n return LineEdit\n
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.alignment","title":"alignment: Optional[Alignment] = None
class-attribute
instance-attribute
","text":"\u8f93\u5165\u6587\u672c\u7684\u5bf9\u9f50\u65b9\u5f0f\uff0c\u9ed8\u8ba4\u4e3aAlignLeft
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.clear_button","title":"clear_button: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.default_value","title":"default_value: Optional[str] = ''
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.drag_enabled","title":"drag_enabled: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5141\u8bb8\u62d6\u62fd
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.echo_mode","title":"echo_mode: Optional[EchoMode] = None
class-attribute
instance-attribute
","text":"\u56de\u663e\u6a21\u5f0f\uff0c\u9ed8\u8ba4\u4e3aNormal
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.frame","title":"frame: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u8fb9\u6846
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.input_mask","title":"input_mask: Optional[str] = None
class-attribute
instance-attribute
","text":"\u8f93\u5165\u63a9\u7801\uff0c\u7528\u4e8e\u9650\u5236\u7528\u6237\u8f93\u5165\uff0c\u53ef\u4ee5\u53c2\u8003\uff1ahttps://doc.qt.io/qt-5/qlineedit.html#inputMask-prop
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.max_length","title":"max_length: Optional[int] = None
class-attribute
instance-attribute
","text":"\u6700\u5927\u957f\u5ea6
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.placeholder","title":"placeholder: str = ''
class-attribute
instance-attribute
","text":"\u5360\u4f4d\u6587\u672c\uff0c\u8f93\u5165\u6846\u4e3a\u7a7a\u65f6\u5c06\u663e\u793a\u8be5\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.readonly","title":"readonly: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u53ea\u8bfb
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.validator","title":"validator: Union[QValidator, str, None] = None
class-attribute
instance-attribute
","text":"\u8f93\u5165\u9a8c\u8bc1\u5668\uff0c\u53ef\u4ee5\u662fQValidator\u5bf9\u8c61\uff0c\u4e5f\u53ef\u4ee5\u662f\u6b63\u5219\u8868\u8fbe\u5f0f\u5b57\u7b26\u4e32\uff0c\u9ed8\u8ba4\u65e0\u9a8c\u8bc1\u5668
"},{"location":"apis/pyguiadapter.widgets.lineedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEdit","title":"LineEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEdit.AlignCenter","title":"AlignCenter = Alignment.AlignCenter
class-attribute
instance-attribute
","text":"\u6587\u672c\u5bf9\u9f50\u65b9\u5f0f\uff1a\u5c45\u4e2d\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEdit.AlignLeft","title":"AlignLeft = Alignment.AlignRight
class-attribute
instance-attribute
","text":"\u6587\u672c\u5bf9\u9f50\u65b9\u5f0f\uff1a\u5de6\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEdit.AlignRight","title":"AlignRight = Alignment.AlignRight
class-attribute
instance-attribute
","text":"\u6587\u672c\u5bf9\u9f50\u65b9\u5f0f\uff1a\u53f3\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEdit.NoEchoMode","title":"NoEchoMode = EchoMode.NoEcho
class-attribute
instance-attribute
","text":"\u56de\u663e\u6a21\u5f0f\uff1a\u9690\u85cf\u8f93\u5165\u5185\u5bb9
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEdit.NormalEchoMode","title":"NormalEchoMode = EchoMode.Normal
class-attribute
instance-attribute
","text":"\u56de\u663e\u6a21\u5f0f\uff1a\u6b63\u5e38\u663e\u793a
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEdit.PasswordEchoMode","title":"PasswordEchoMode = EchoMode.Password
class-attribute
instance-attribute
","text":"\u56de\u663e\u6a21\u5f0f\uff1a\u663e\u793a\u4e3a\u5bc6\u7801
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEdit.PasswordEchoOnEditMode","title":"PasswordEchoOnEditMode = EchoMode.PasswordEchoOnEdit
class-attribute
instance-attribute
","text":"\u56de\u663e\u6a21\u5f0f\uff1a\u8f93\u5165\u65f6\u6b63\u5e38\u663e\u793a\uff0c\u8f93\u5165\u7ed3\u675f\u540e\u663e\u793a\u4e3a\u5bc6\u7801
"},{"location":"apis/pyguiadapter.widgets.lineedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" str
"},{"location":"apis/pyguiadapter.widgets.listedit/","title":"pyguiadapter.widgets.listedit","text":""},{"location":"apis/pyguiadapter.widgets.listedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.ListEditConfig","title":"ListEditConfig
dataclass
","text":" Bases: PyLiteralEditConfig
ListEdit\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\listedit.py
@dataclasses.dataclass(frozen=True)\nclass ListEditConfig(PyLiteralEditConfig):\n \"\"\"ListEdit\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[list] = dataclasses.field(default_factory=list)\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n height: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6\"\"\"\n\n width: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6\"\"\"\n\n standalone_editor: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668\"\"\"\n\n standalone_editor_button_text: str = \"Edit List\"\n \"\"\"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c\"\"\"\n\n standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(\n default_factory=StandaloneCodeEditorConfig\n )\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\"\"\"\n\n initial_text: str = \"[]\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"ListEdit\"]:\n return ListEdit\n
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.ListEditConfig.default_value","title":"default_value: Optional[list] = dataclasses.field(default_factory=list)
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.ListEditConfig.height","title":"height: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.ListEditConfig.standalone_editor","title":"standalone_editor: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.ListEditConfig.standalone_editor_button_text","title":"standalone_editor_button_text: str = 'Edit List'
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.ListEditConfig.standalone_editor_config","title":"standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(default_factory=StandaloneCodeEditorConfig)
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u914d\u7f6e
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.ListEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig","title":"StandaloneCodeEditorConfig
dataclass
","text":" Bases: object
standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\base.py
@dataclasses.dataclass\nclass StandaloneCodeEditorConfig(object):\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b\"\"\"\n\n title: str = STANDALONE_EDITOR_TITLE\n \"\"\"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898\"\"\"\n\n text_font_family: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\"\"\"\n\n text_font_size: Optional[int] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f\"\"\"\n\n line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n line_wrap_width: int = LINE_WRAP_WIDTH\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6\"\"\"\n\n word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n file_filters: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668\"\"\"\n\n start_dir: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55\"\"\"\n\n use_default_menus: bool = True\n \"\"\"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f\"\"\"\n\n excluded_menus: Tuple[str] = ()\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\"\"\"\n\n excluded_menu_actions: Tuple[Tuple[str, str]] = (\n (MENU_FILE, ACTION_SAVE),\n (MENU_FILE, ACTION_SAVE_AS),\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879\"\"\"\n\n use_default_toolbar: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f\"\"\"\n\n excluded_toolbar_actions: Tuple[str] = (\n ACTION_SAVE,\n ACTION_SAVE_AS,\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879\"\"\"\n\n confirm_dialog: bool = True\n \"\"\"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n confirm_dialog_title: str = CONFIRM_DIALOG_TITLE\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_dialog_message: str = CONFIRM_MSG\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9\"\"\"\n
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog","title":"confirm_dialog: bool = True
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_message","title":"confirm_dialog_message: str = CONFIRM_MSG
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_title","title":"confirm_dialog_title: str = CONFIRM_DIALOG_TITLE
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menu_actions","title":"excluded_menu_actions: Tuple[Tuple[str, str]] = ((MENU_FILE, ACTION_SAVE), (MENU_FILE, ACTION_SAVE_AS))
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menus","title":"excluded_menus: Tuple[str] = ()
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_toolbar_actions","title":"excluded_toolbar_actions: Tuple[str] = (ACTION_SAVE, ACTION_SAVE_AS)
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.file_filters","title":"file_filters: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_mode","title":"line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_width","title":"line_wrap_width: int = LINE_WRAP_WIDTH
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.start_dir","title":"start_dir: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_family","title":"text_font_family: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_size","title":"text_font_size: Optional[int] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.title","title":"title: str = STANDALONE_EDITOR_TITLE
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_menus","title":"use_default_menus: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_toolbar","title":"use_default_toolbar: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.word_wrap_mode","title":"word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.listedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.ListEdit","title":"ListEdit
","text":" Bases: PyLiteralEdit
"},{"location":"apis/pyguiadapter.widgets.listedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" list
typing.List
"},{"location":"apis/pyguiadapter.widgets.multichoice/","title":"pyguiadapter.widgets.multichoice","text":""},{"location":"apis/pyguiadapter.widgets.multichoice/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.multichoice/#pyguiadapter.widgets.MultiChoiceBoxConfig","title":"MultiChoiceBoxConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
MultiChoiceBox\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\multichoice.py
@dataclasses.dataclass(frozen=True)\nclass MultiChoiceBoxConfig(CommonParameterWidgetConfig):\n \"\"\"MultiChoiceBox\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Optional[Sequence[Any]] = dataclasses.field(default_factory=list)\n \"\"\"\u9ed8\u8ba4\u9009\u4e2d\u7684\u503c\"\"\"\n\n choices: Union[Sequence[Any], Dict[str, Any]] = dataclasses.field(\n default_factory=list\n )\n \"\"\"\u53ef\u9009\u9879\u5217\u8868\u3002\u4e3a\u5b57\u5178\u65f6\uff0c\u5c06\u952e\u503c\u5bf9\u7684\u952e\u4f5c\u4e3a\u663e\u793a\u6587\u672c\uff0c\u952e\u503c\u5bf9\u7684\u503c\u4f5c\u4e3a\u5b9e\u9645\u7684\u503c\uff1b\u5426\u5219\uff0c\u5bf9\u6bcf\u4e2a\u9009\u9879\u8c03\u7528str()\uff0c\u5c06\u8fd4\u56de\u503c\u4f5c\u4e3a\u663e\u793a\u6587\u672c\uff0c\u9009\u9879\u672c\u8eab\u4f5c\u4e3a\u5b9e\u9645\u7684\u503c\u3002\"\"\"\n\n columns: int = 1\n \"\"\"\u9009\u9879\u7684\u5217\u6570\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"MultiChoiceBox\"]:\n return MultiChoiceBox\n
"},{"location":"apis/pyguiadapter.widgets.multichoice/#pyguiadapter.widgets.MultiChoiceBoxConfig.choices","title":"choices: Union[Sequence[Any], Dict[str, Any]] = dataclasses.field(default_factory=list)
class-attribute
instance-attribute
","text":"\u53ef\u9009\u9879\u5217\u8868\u3002\u4e3a\u5b57\u5178\u65f6\uff0c\u5c06\u952e\u503c\u5bf9\u7684\u952e\u4f5c\u4e3a\u663e\u793a\u6587\u672c\uff0c\u952e\u503c\u5bf9\u7684\u503c\u4f5c\u4e3a\u5b9e\u9645\u7684\u503c\uff1b\u5426\u5219\uff0c\u5bf9\u6bcf\u4e2a\u9009\u9879\u8c03\u7528str()\uff0c\u5c06\u8fd4\u56de\u503c\u4f5c\u4e3a\u663e\u793a\u6587\u672c\uff0c\u9009\u9879\u672c\u8eab\u4f5c\u4e3a\u5b9e\u9645\u7684\u503c\u3002
"},{"location":"apis/pyguiadapter.widgets.multichoice/#pyguiadapter.widgets.MultiChoiceBoxConfig.columns","title":"columns: int = 1
class-attribute
instance-attribute
","text":"\u9009\u9879\u7684\u5217\u6570
"},{"location":"apis/pyguiadapter.widgets.multichoice/#pyguiadapter.widgets.MultiChoiceBoxConfig.default_value","title":"default_value: Optional[Sequence[Any]] = dataclasses.field(default_factory=list)
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u9009\u4e2d\u7684\u503c
"},{"location":"apis/pyguiadapter.widgets.multichoice/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.multichoice/#pyguiadapter.widgets.MultiChoiceBox","title":"MultiChoiceBox
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.multichoice/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" choice_t
"},{"location":"apis/pyguiadapter.widgets.objecteditor/","title":"pyguiadapter.widgets.objecteditor","text":""},{"location":"apis/pyguiadapter.widgets.objecteditor/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.objecteditor/#pyguiadapter.widgets.SchemaObjectEditorConfig","title":"SchemaObjectEditorConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
Source code in pyguiadapter\\widgets\\extend\\objecteditor.py
@dataclasses.dataclass(frozen=True)\nclass SchemaObjectEditorConfig(CommonParameterWidgetConfig):\n default_value: Optional[Dict[str, Any]] = None\n schema: Dict[str, ValueType] = None\n ignore_unknown_keys: bool = False\n fill_missing_keys: bool = False\n display_text: str = \"Edit\"\n window_title: str = \"Object Editor\"\n window_size: Tuple[int, int] = (500, 600)\n center_container_title: str = \"\"\n key_column_header: str = \"Key\"\n value_column_header: str = \"Value\"\n item_text_alignment: Union[Qt.AlignmentFlag, int, None] = Qt.AlignCenter\n value_item_alignment: Union[Qt.AlignmentFlag, int, None] = None\n key_item_selectable: bool = False\n row_selection_mode: bool = True\n real_key_as_tooltip: bool = False\n stretch_last_section: bool = True\n alternating_row_colors: bool = False\n show_vertical_header: bool = False\n\n @classmethod\n def target_widget_class(cls) -> Type[\"SchemaObjectEditor\"]:\n return SchemaObjectEditor\n
"},{"location":"apis/pyguiadapter.widgets.objecteditor/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.objecteditor/#pyguiadapter.widgets.SchemaObjectEditor","title":"SchemaObjectEditor
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.objectseditor/","title":"pyguiadapter.widgets.objectseditor","text":""},{"location":"apis/pyguiadapter.widgets.objectseditor/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.objectseditor/#pyguiadapter.widgets.SchemaObjectsEditorConfig","title":"SchemaObjectsEditorConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
Source code in pyguiadapter\\widgets\\extend\\objectseditor.py
@dataclasses.dataclass(frozen=True)\nclass SchemaObjectsEditorConfig(CommonParameterWidgetConfig):\n default_value: Optional[List[Dict[str, Any]]] = None\n schema: Dict[str, ValueType] = None\n ignore_unknown_keys: bool = False\n fill_missing_keys: bool = False\n display_text: str = \"Edit - {object_count} objects in list\"\n window_title: str = \"Objects Editor\"\n window_size: Tuple[int, int] = (800, 600)\n center_container_title: str = \"\"\n item_editor_title: str = \"\"\n item_editor_size: Tuple[int, int] = (500, 600)\n item_editor_center_container_title: str = \"\"\n wrap_movement: bool = False\n add_button_text: str = \"Add\"\n edit_button_text: str = \"Edit\"\n remove_button_text: str = \"Remove\"\n clear_button_text: str = \"Clear\"\n move_up_button_text: str = \"Move Up\"\n move_down_button_text: str = \"Move Down\"\n stretch_last_section: bool = True\n no_selection_warning_message: Optional[str] = NO_OBJECT_SELECTED_WARNING_MESSAGE\n no_items_warning_message: Optional[str] = NO_OBJECT_ADDED_WARNING_MESSAGE\n remove_confirm_message: Optional[str] = REMOVE_CONFIRM_MESSAGE\n clear_confirm_message: Optional[str] = CLEAR_CONFIRM_MESSAGE\n multiple_selection_warning_message: Optional[str] = MULTIPLE_OBJECTS_WARNING_MESSAGE\n double_click_to_edit: bool = False\n resize_rows_to_contents: bool = True\n alternating_row_colors: bool = False\n show_horizontal_header: bool = True\n show_vertical_header: bool = True\n show_grid: bool = True\n continuous_selection: bool = True\n item_text_alignment: Union[int, Qt.AlignmentFlag, None] = None\n item_data_as_tooltip: bool = False\n item_data_as_status_tip: bool = False\n column_widths: Optional[Dict[int, int]] = None\n horizontal_resize_modes: Union[\n Dict[int, QHeaderView.ResizeMode], QHeaderView.ResizeMode, None\n ] = None\n vertical_resize_modes: Union[\n Dict[int, QHeaderView.ResizeMode], QHeaderView.ResizeMode, None\n ] = None\n\n @classmethod\n def target_widget_class(cls) -> Type[\"SchemaObjectsEditor\"]:\n return SchemaObjectsEditor\n
"},{"location":"apis/pyguiadapter.widgets.objectseditor/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.objectseditor/#pyguiadapter.widgets.SchemaObjectsEditor","title":"SchemaObjectsEditor
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.pathlist/","title":"pyguiadapter.widgets.pathlist","text":""},{"location":"apis/pyguiadapter.widgets.pathlist/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig","title":"PathEditDialogConfig
dataclass
","text":" Bases: object
PathEditDialog\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\pathlist.py
@dataclasses.dataclass(frozen=True)\nclass PathEditDialogConfig(object):\n \"\"\"PathEditDialog\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n title: str = \"Edit Path\"\n \"\"\"\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n select_file: bool = True\n \"\"\"\u662f\u5426\u5f00\u542f\u9009\u62e9\u6587\u4ef6\u529f\u80fd\"\"\"\n\n select_dir: bool = True\n \"\"\"\u662f\u5426\u5f00\u542f\u9009\u62e9\u76ee\u5f55\u529f\u80fd\"\"\"\n\n select_file_button_text: str = \"File\"\n \"\"\"\u9009\u62e9\u6587\u4ef6\u6309\u94ae\u6587\u672c\"\"\"\n\n select_dir_button_text: str = \"Directory\"\n \"\"\"\u9009\u62e9\u76ee\u5f55\u6309\u94ae\u6587\u672c\"\"\"\n\n cancel_button_text: str = \"Cancel\"\n \"\"\"\u53d6\u6d88\u6309\u94ae\u6587\u672c\"\"\"\n\n confirm_button_text: str = \"Confirm\"\n \"\"\"\u786e\u8ba4\u6309\u94ae\u6587\u672c\"\"\"\n\n file_dialog_title: str = \"Select File\"\n \"\"\"\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n dir_dialog_title: str = \"Select Directory\"\n \"\"\"\u76ee\u5f55\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n file_filters: str = \"\"\n \"\"\"\u6587\u4ef6\u8fc7\u6ee4\u5668\"\"\"\n\n start_dir: str = \"\"\n \"\"\"\u8d77\u59cb\u8def\u5f84\"\"\"\n
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.cancel_button_text","title":"cancel_button_text: str = 'Cancel'
class-attribute
instance-attribute
","text":"\u53d6\u6d88\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.confirm_button_text","title":"confirm_button_text: str = 'Confirm'
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.dir_dialog_title","title":"dir_dialog_title: str = 'Select Directory'
class-attribute
instance-attribute
","text":"\u76ee\u5f55\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.file_dialog_title","title":"file_dialog_title: str = 'Select File'
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.file_filters","title":"file_filters: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u8fc7\u6ee4\u5668
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.select_dir","title":"select_dir: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f00\u542f\u9009\u62e9\u76ee\u5f55\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.select_dir_button_text","title":"select_dir_button_text: str = 'Directory'
class-attribute
instance-attribute
","text":"\u9009\u62e9\u76ee\u5f55\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.select_file","title":"select_file: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f00\u542f\u9009\u62e9\u6587\u4ef6\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.select_file_button_text","title":"select_file_button_text: str = 'File'
class-attribute
instance-attribute
","text":"\u9009\u62e9\u6587\u4ef6\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.start_dir","title":"start_dir: str = ''
class-attribute
instance-attribute
","text":"\u8d77\u59cb\u8def\u5f84
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.title","title":"title: str = 'Edit Path'
class-attribute
instance-attribute
","text":"\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig","title":"PathListEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
PathListEdit\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\pathlist.py
@dataclasses.dataclass(frozen=True)\nclass PathListEditConfig(CommonParameterWidgetConfig):\n \"\"\"PathListEdit\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Optional[List[str]] = dataclasses.field(default_factory=list)\n \"\"\"\u9ed8\u8ba4\u503c\"\"\"\n\n empty_string_strategy: Literal[\"keep_all\", \"keep_one\", \"remove_all\"] = \"remove_all\"\n \"\"\"\u5bf9\u5f85\u5217\u8868\u4e2d\u7a7a\u5b57\u7b26\u4e32\u7684\u7b56\u7565\uff0ckeep_all\u8868\u793a\u4fdd\u7559\u6240\u6709\u7a7a\u5b57\u7b26\u4e32\uff0ckeep_one\u8868\u793a\u53ea\u4fdd\u7559\u7b2c\u4e00\u4e2a\u7a7a\u5b57\u7b26\u4e32\uff0cremove_all\u8868\u793a\u5220\u9664\u6240\u6709\u7a7a\u5b57\u7b26\u4e32\"\"\"\n\n add_files: bool = True\n \"\"\"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u529f\u80fd\"\"\"\n\n add_dirs: bool = True\n \"\"\"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u5939\u8def\u5f84\u529f\u80fd\"\"\"\n\n file_filters: str = \"\"\n \"\"\"\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u7528\u4e8e\u6587\u4ef6\u5bf9\u8bdd\u6846\"\"\"\n\n start_dir: str = \"\"\n \"\"\"\u8d77\u59cb\u8def\u5f84\uff0c\u7528\u4e8e\u6587\u4ef6\u5bf9\u8bdd\u6846\"\"\"\n\n normalize_path: bool = True\n \"\"\"\u662f\u5426\u5c06\u8def\u5f84\u89c4\u8303\u5316\"\"\"\n\n absolutize_path: bool = True\n \"\"\"\u662f\u5426\u5c06\u8def\u5f84\u8f6c\u6362\u4e3a\u7edd\u5bf9\u8def\u5f84\"\"\"\n\n add_file_button_text: str = \"Add Files\"\n \"\"\"\u6dfb\u52a0\u6587\u4ef6\u6309\u94ae\u6587\u672c\"\"\"\n\n add_dir_button_text: str = \"Add Dir\"\n \"\"\"\u6dfb\u52a0\u76ee\u5f55\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n remove_button_text: str = \"Remove\"\n \"\"\"\u5220\u9664\u6309\u94ae\u6587\u672c\"\"\"\n\n clear_button_text: str = \"Clear\"\n \"\"\"\u6e05\u7a7a\u5168\u90e8\u6309\u94ae\u6587\u672c\"\"\"\n\n file_dialog_title: str = \"Select File\"\n \"\"\"\u6dfb\u52a0\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n dir_dialog_title: str = \"Select Directory\"\n \"\"\"\u6dfb\u52a0\u6587\u4ef6\u5939\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_dialog_title: str = \"Confirm\"\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n warning_dialog_title: str = \"Warning\"\n \"\"\"\u8b66\u544a\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_remove: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u79fb\u9664\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n confirm_clear: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u6e05\u7a7a\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n remove_confirm_message: str = \"Are you sure to remove the selected item?\"\n \"\"\"\u79fb\u9664\u786e\u8ba4\u5bf9\u8bdd\u6846\u6d88\u606f\"\"\"\n\n clear_confirm_message: str = \"Are you sure to remove all items?\"\n \"\"\"\u6e05\u7a7a\u786e\u8ba4\u5bf9\u8bdd\u6846\u6d88\u606f\"\"\"\n\n no_selection_message: str = \"No items are selected!\"\n \"\"\"\u672a\u9009\u62e9\u4efb\u4f55\u9879\u7684\u63d0\u793a\"\"\"\n\n drag_enabled: bool = True\n \"\"\"\u662f\u5426\u5141\u8bb8\u62d6\u62fd\"\"\"\n\n wrapping: bool = False\n \"\"\"\u662f\u5426\u5141\u8bb8\u6362\u884c\"\"\"\n\n text_elide_mode: Optional[TextElideMode] = None\n \"\"\"\u6587\u672c\u7701\u7565\u6a21\u5f0f\"\"\"\n\n alternating_row_colors: bool = True\n \"\"\"\u662f\u5426\u4f7f\u7528\u4ea4\u66ff\u884c\u989c\u8272\"\"\"\n\n width: Optional[int] = None\n \"\"\"\u8868\u683c\u7684\u6700\u5c0f\u5bbd\u5ea6\"\"\"\n\n height: Optional[int] = 210\n \"\"\"\u8868\u683c\u7684\u6700\u5c0f\u9ad8\u5ea6\"\"\"\n\n drag_n_drop: bool = True\n \"\"\"\u662f\u5426\u5141\u8bb8\u62d6\u62fd\u6587\u4ef6\u6216\u76ee\u5f55\u5230\u8868\u683c\"\"\"\n\n drag_n_drop_filter: Optional[Callable[[str, str], bool]] = default_dnd_filter\n \"\"\"\u6587\u4ef6\u62d6\u653e\u529f\u80fd\u7684\u8fc7\u6ee4\u51fd\u6570\u3002\u8be5\u51fd\u6570\u5e94\u63a5\u6536\u4e24\u4e2a\u53c2\u6570\uff1a\u6587\u4ef6\u8fc7\u6ee4\u5668\uff08\u5373\u672c\u7c7b\u7684`filters`\u5c5e\u6027\uff09\u548c\u62d6\u653e\u7684\u6587\u4ef6\u8def\u5f84\u3002\n \u82e5\u8fd4\u56deTrue\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u53ef\u4ee5\u88ab\u62d6\u653e\uff1b\u5426\u5219\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u4e0d\u80fd\u88ab\u62d6\u653e\u3002\u8be5\u5c5e\u6027\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u4e3aNone\uff0c\u8868\u793a\u4e0d\u5bf9\u62d6\u653e\u6587\u4ef6\u8fdb\u884c\u8fc7\u6ee4\u3002\n \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528`default_dnd_filter`\u51fd\u6570\u4f5c\u4e3a\u8fc7\u6ee4\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u4f1a\u5c06\u5f85\u62d6\u653e\u7684\u6587\u4ef6\u7684\u6587\u4ef6\u540d\u4e0e\u6587\u4ef6\u8fc7\u6ee4\u5668\u8fdb\u884c\u5339\u914d\uff0c\u82e5\u547d\u4e2d\u4efb\u610f\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u5219\u8fd4\u56deTrue\uff0c\n \u5426\u5219\u8fd4\u56deFalse\u3002\u6bd4\u5982\uff0c\u82e5\u6587\u4ef6\u8fc7\u6ee4\u5668\u4e3a'Text files (*.txt);;Python files (*.py)', \u5219\u6587\u4ef6'hello.txt'\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Text files (*.txt)';\n \u6587\u4ef6'hello.py'\u4e5f\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Python files (*.py)'\uff1b\u6587\u4ef6'hello.png'\u5219\u4e0d\u80fd\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u6ca1\u6709\u547d\u4e2d\u4efb\u4f55\u6587\u4ef6\u8fc7\u6ee4\u5668\u3002\"\"\"\n\n path_edit_dialog_config: Optional[PathEditDialogConfig] = None\n \"\"\"\u7f16\u8f91\u8def\u5f84\u5bf9\u8bdd\u6846\u7684\u914d\u7f6e\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"PathListEdit\"]:\n return PathListEdit\n
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.absolutize_path","title":"absolutize_path: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8def\u5f84\u8f6c\u6362\u4e3a\u7edd\u5bf9\u8def\u5f84
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.add_dir_button_text","title":"add_dir_button_text: str = 'Add Dir'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u76ee\u5f55\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.add_dirs","title":"add_dirs: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u5939\u8def\u5f84\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.add_file_button_text","title":"add_file_button_text: str = 'Add Files'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6587\u4ef6\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.add_files","title":"add_files: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.alternating_row_colors","title":"alternating_row_colors: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7f\u7528\u4ea4\u66ff\u884c\u989c\u8272
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.clear_button_text","title":"clear_button_text: str = 'Clear'
class-attribute
instance-attribute
","text":"\u6e05\u7a7a\u5168\u90e8\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.clear_confirm_message","title":"clear_confirm_message: str = 'Are you sure to remove all items?'
class-attribute
instance-attribute
","text":"\u6e05\u7a7a\u786e\u8ba4\u5bf9\u8bdd\u6846\u6d88\u606f
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.confirm_clear","title":"confirm_clear: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u7a7a\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.confirm_dialog_title","title":"confirm_dialog_title: str = 'Confirm'
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.confirm_remove","title":"confirm_remove: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u79fb\u9664\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.default_value","title":"default_value: Optional[List[str]] = dataclasses.field(default_factory=list)
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.dir_dialog_title","title":"dir_dialog_title: str = 'Select Directory'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6587\u4ef6\u5939\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.drag_enabled","title":"drag_enabled: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5141\u8bb8\u62d6\u62fd
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.drag_n_drop","title":"drag_n_drop: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5141\u8bb8\u62d6\u62fd\u6587\u4ef6\u6216\u76ee\u5f55\u5230\u8868\u683c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.drag_n_drop_filter","title":"drag_n_drop_filter: Optional[Callable[[str, str], bool]] = default_dnd_filter
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u62d6\u653e\u529f\u80fd\u7684\u8fc7\u6ee4\u51fd\u6570\u3002\u8be5\u51fd\u6570\u5e94\u63a5\u6536\u4e24\u4e2a\u53c2\u6570\uff1a\u6587\u4ef6\u8fc7\u6ee4\u5668\uff08\u5373\u672c\u7c7b\u7684filters
\u5c5e\u6027\uff09\u548c\u62d6\u653e\u7684\u6587\u4ef6\u8def\u5f84\u3002 \u82e5\u8fd4\u56deTrue\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u53ef\u4ee5\u88ab\u62d6\u653e\uff1b\u5426\u5219\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u4e0d\u80fd\u88ab\u62d6\u653e\u3002\u8be5\u5c5e\u6027\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u4e3aNone\uff0c\u8868\u793a\u4e0d\u5bf9\u62d6\u653e\u6587\u4ef6\u8fdb\u884c\u8fc7\u6ee4\u3002 \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528default_dnd_filter
\u51fd\u6570\u4f5c\u4e3a\u8fc7\u6ee4\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u4f1a\u5c06\u5f85\u62d6\u653e\u7684\u6587\u4ef6\u7684\u6587\u4ef6\u540d\u4e0e\u6587\u4ef6\u8fc7\u6ee4\u5668\u8fdb\u884c\u5339\u914d\uff0c\u82e5\u547d\u4e2d\u4efb\u610f\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u5219\u8fd4\u56deTrue\uff0c \u5426\u5219\u8fd4\u56deFalse\u3002\u6bd4\u5982\uff0c\u82e5\u6587\u4ef6\u8fc7\u6ee4\u5668\u4e3a'Text files (.txt);;Python files (.py)', \u5219\u6587\u4ef6'hello.txt'\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Text files (.txt)'; \u6587\u4ef6'hello.py'\u4e5f\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Python files (.py)'\uff1b\u6587\u4ef6'hello.png'\u5219\u4e0d\u80fd\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u6ca1\u6709\u547d\u4e2d\u4efb\u4f55\u6587\u4ef6\u8fc7\u6ee4\u5668\u3002
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.empty_string_strategy","title":"empty_string_strategy: Literal['keep_all', 'keep_one', 'remove_all'] = 'remove_all'
class-attribute
instance-attribute
","text":"\u5bf9\u5f85\u5217\u8868\u4e2d\u7a7a\u5b57\u7b26\u4e32\u7684\u7b56\u7565\uff0ckeep_all\u8868\u793a\u4fdd\u7559\u6240\u6709\u7a7a\u5b57\u7b26\u4e32\uff0ckeep_one\u8868\u793a\u53ea\u4fdd\u7559\u7b2c\u4e00\u4e2a\u7a7a\u5b57\u7b26\u4e32\uff0cremove_all\u8868\u793a\u5220\u9664\u6240\u6709\u7a7a\u5b57\u7b26\u4e32
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.file_dialog_title","title":"file_dialog_title: str = 'Select File'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.file_filters","title":"file_filters: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u7528\u4e8e\u6587\u4ef6\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.height","title":"height: Optional[int] = 210
class-attribute
instance-attribute
","text":"\u8868\u683c\u7684\u6700\u5c0f\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.no_selection_message","title":"no_selection_message: str = 'No items are selected!'
class-attribute
instance-attribute
","text":"\u672a\u9009\u62e9\u4efb\u4f55\u9879\u7684\u63d0\u793a
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.normalize_path","title":"normalize_path: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8def\u5f84\u89c4\u8303\u5316
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.path_edit_dialog_config","title":"path_edit_dialog_config: Optional[PathEditDialogConfig] = None
class-attribute
instance-attribute
","text":"\u7f16\u8f91\u8def\u5f84\u5bf9\u8bdd\u6846\u7684\u914d\u7f6e
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.remove_button_text","title":"remove_button_text: str = 'Remove'
class-attribute
instance-attribute
","text":"\u5220\u9664\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.remove_confirm_message","title":"remove_confirm_message: str = 'Are you sure to remove the selected item?'
class-attribute
instance-attribute
","text":"\u79fb\u9664\u786e\u8ba4\u5bf9\u8bdd\u6846\u6d88\u606f
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.start_dir","title":"start_dir: str = ''
class-attribute
instance-attribute
","text":"\u8d77\u59cb\u8def\u5f84\uff0c\u7528\u4e8e\u6587\u4ef6\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.text_elide_mode","title":"text_elide_mode: Optional[TextElideMode] = None
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.warning_dialog_title","title":"warning_dialog_title: str = 'Warning'
class-attribute
instance-attribute
","text":"\u8b66\u544a\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"\u8868\u683c\u7684\u6700\u5c0f\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.wrapping","title":"wrapping: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5141\u8bb8\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.FileListEditConfig","title":"FileListEditConfig
dataclass
","text":" Bases: PathListEditConfig
\u6587\u4ef6\u5217\u8868\u63a7\u4ef6\u7684\u914d\u7f6e
Source code in pyguiadapter\\widgets\\extend\\pathlist.py
@dataclasses.dataclass(frozen=True)\nclass FileListEditConfig(PathListEditConfig):\n \"\"\"\u6587\u4ef6\u5217\u8868\u63a7\u4ef6\u7684\u914d\u7f6e\"\"\"\n\n add_files = True\n add_dirs = False\n\n def target_widget_class(self) -> Type[\"FileListEdit\"]:\n return FileListEdit\n
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.DirectoryListEditConfig","title":"DirectoryListEditConfig
dataclass
","text":" Bases: PathListEditConfig
\u6587\u4ef6\u5217\u8868\u63a7\u4ef6\u7684\u914d\u7f6e
Source code in pyguiadapter\\widgets\\extend\\pathlist.py
@dataclasses.dataclass(frozen=True)\nclass DirectoryListEditConfig(PathListEditConfig):\n \"\"\"\u6587\u4ef6\u5217\u8868\u63a7\u4ef6\u7684\u914d\u7f6e\"\"\"\n\n add_files = False\n add_dirs = True\n file_filters = \"\"\n\n def target_widget_class(self) -> Type[\"DirectoryListEdit\"]:\n return DirectoryListEdit\n
"},{"location":"apis/pyguiadapter.widgets.pathlist/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEdit","title":"PathListEdit
","text":" Bases: CommonParameterWidget
\u8def\u5f84\u5217\u8868\u63a7\u4ef6\uff0c\u53ef\u4ee5\u7528\u4e8e\u5b58\u653e\u591a\u4e2a\u8def\u5f84\uff0c\u652f\u6301\u6587\u4ef6\u548c\u76ee\u5f55\u3002
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEdit.ElideLeft","title":"ElideLeft = TextElideMode.ElideLeft
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u7701\u7565\u5de6\u8fb9
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEdit.ElideMiddle","title":"ElideMiddle = TextElideMode.ElideMiddle
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u7701\u7565\u4e2d\u95f4
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEdit.ElideNone","title":"ElideNone = TextElideMode.ElideNone
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u4e0d\u7701\u7565
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEdit.ElideRight","title":"ElideRight = TextElideMode.ElideRight
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u7701\u7565\u53f3\u8fb9
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.FileListEdit","title":"FileListEdit
","text":" Bases: PathListEdit
\u6587\u4ef6\u5217\u8868\u63a7\u4ef6\uff0c\u7ee7\u627f\u81eaPathListEdit
\uff0c\u7528\u4e8e\u5b58\u653e\u6587\u4ef6\u8def\u5f84\u3002
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.DirectoryListEdit","title":"DirectoryListEdit
","text":" Bases: PathListEdit
\u76ee\u5f55\u5217\u8868\u63a7\u4ef6\uff0c\u7ee7\u627f\u81eaPathListEdit
\uff0c\u7528\u4e8e\u5b58\u653e\u76ee\u5f55\u8def\u5f84\u3002
"},{"location":"apis/pyguiadapter.widgets.pathlist/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" path_dict_t
-> PathListEdit
file_list_t
-> FileListEdit
dir_list_t
-> DirectoryListEdit
"},{"location":"apis/pyguiadapter.widgets.pathlist/#_4","title":"\u7c7b\u578b\u4e0e\u5e38\u91cf","text":""},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.extend.pathlist.TextElideMode","title":"TextElideMode = Qt.TextElideMode
module-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.pathseditor/","title":"pyguiadapter.widgets.pathseditor","text":""},{"location":"apis/pyguiadapter.widgets.pathseditor/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig","title":"PathsEditorConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
Source code in pyguiadapter\\widgets\\extend\\pathseditor.py
@dataclasses.dataclass(frozen=True)\nclass PathsEditorConfig(CommonParameterWidgetConfig):\n default_value: List[str] = dataclasses.field(default_factory=list)\n\n editor_button_text: str = \"Edit({} paths in list)\"\n \"\"\"\u7f16\u8f91\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n editor_title: str = \"\"\n \"\"\"\u8def\u5f84\u5217\u8868\u7f16\u8f91\u5668\u7684\u6807\u9898\"\"\"\n\n editor_size: Tuple[int, int] = (750, 600)\n \"\"\"\u8def\u5f84\u5217\u8868\u7f16\u8f91\u5668\u7a97\u53e3\u7684\u5927\u5c0f\"\"\"\n\n file_list_title: str = \"Paths\"\n \"\"\"\u8def\u5f84\u5217\u8868\u533a\u57df\u7684\u6807\u9898\"\"\"\n\n add_file: bool = True\n \"\"\"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u529f\u80fd\"\"\"\n\n add_dir: bool = True\n \"\"\"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u5939\u529f\u80fd\"\"\"\n\n add_file_button_text: str = \"File...\"\n \"\"\"\u6dfb\u52a0\u6587\u4ef6\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n file_filters: str = \"\"\n \"\"\"\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u7528\u4e8e\u9009\u62e9\u6587\u4ef6\u5bf9\u8bdd\u6846\"\"\"\n\n add_dir_button_text: str = \"Folder...\"\n \"\"\"\u6dfb\u52a0\u6587\u4ef6\u5939\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n start_dir: str = \"\"\n \"\"\"\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u521d\u59cb\u76ee\u5f55\"\"\"\n\n path_as_posix: bool = True\n \"\"\"\u662f\u5426\u5c06\u9009\u62e9\u7684\u6587\u4ef6\u6216\u6587\u4ef6\u5939\u7684\u8def\u5f84\u4ee5 Posix \u683c\u5f0f\u4fdd\u5b58\"\"\"\n\n edit_button_text: str = \"Edit\"\n \"\"\"\u7f16\u8f91\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n remove_button_text: str = \"Remove\"\n \"\"\"\u79fb\u9664\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n clear_button_text: str = \"Clear\"\n \"\"\"\u6e05\u7a7a\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n up_button_text: str = \"Up\"\n \"\"\"\u4e0a\u79fb\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n down_button_text: str = \"Down\"\n \"\"\"\u4e0b\u79fb\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n file_dialog_title: str = \"Select File\"\n \"\"\"\u9009\u62e9\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6807\u9898\"\"\"\n\n dir_dialog_title: str = \"Select Directory\"\n \"\"\"\u9009\u62e9\u6587\u4ef6\u5939\u5bf9\u8bdd\u6846\u7684\u6807\u9898\"\"\"\n\n confirm_dialog_title: str = \"Confirm\"\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u7684\u6807\u9898\"\"\"\n\n warning_dialog_title: str = \"Warning\"\n \"\"\"\u8b66\u544a\u5bf9\u8bdd\u6846\u7684\u6807\u9898\"\"\"\n\n confirm_clear_message: Optional[str] = \"Remove all the paths from the list?\"\n \"\"\"\u6e05\u7a7a\u6587\u4ef6\u5217\u8868\u7684\u786e\u8ba4\u6d88\u606f\u6587\u672c\uff0c\u5982\u679c\u4e3a None \u5219\u4e0d\u663e\u793a\u786e\u8ba4\u6d88\u606f\uff0c\u76f4\u63a5\u6e05\u7a7a\u6587\u4ef6\u5217\u8868\"\"\"\n\n confirm_remove_message: Optional[str] = \"Remove the selected path(s) from the list?\"\n \"\"\"\u79fb\u9664\u5f53\u524d\u9009\u4e2d\u9879\u7684\u786e\u8ba4\u6d88\u606f\u6587\u672c\uff0c\u5982\u679c\u4e3a None \u5219\u4e0d\u663e\u793a\u786e\u8ba4\u6d88\u606f\uff0c\u76f4\u63a5\u79fb\u9664\u5f53\u524d\u9009\u4e2d\u9879\"\"\"\n\n no_items_selected_message: Optional[str] = \"No path selected!\"\n \"\"\"\u6ca1\u6709\u9009\u4e2d\u4efb\u4f55\u9879\u65f6\u7684\u63d0\u793a\u6d88\u606f\"\"\"\n\n no_items_added_message: Optional[str] = \"No path added!\"\n \"\"\"\u6ca1\u6709\u6dfb\u52a0\u4efb\u4f55\u9879\u65f6\u7684\u63d0\u793a\u6d88\u606f\"\"\"\n\n double_click_to_edit: bool = True\n \"\"\"\u662f\u5426\u5141\u8bb8\u53cc\u51fb\u5217\u8868\u9879\u8fdb\u884c\u7f16\u8f91\"\"\"\n\n path_item_editor_title: str = \"Edit Path\"\n \"\"\"\u8def\u5f84\u7f16\u8f91\u5bf9\u8bdd\u6846\u7684\u6807\u9898\"\"\"\n\n path_item_editor_center_container_title: str = \"Path\"\n \"\"\"\u8def\u5f84\u7f16\u8f91\u5bf9\u8bdd\u6846\u4e2d\u4e2d\u5fc3\u5bb9\u5668\u7684\u6807\u9898\"\"\"\n\n @classmethod\n def target_widget_config(cls) -> Type[\"PathsEditor\"]:\n return PathsEditor\n
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.add_dir","title":"add_dir: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u5939\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.add_dir_button_text","title":"add_dir_button_text: str = 'Folder...'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6587\u4ef6\u5939\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.add_file","title":"add_file: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.add_file_button_text","title":"add_file_button_text: str = 'File...'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6587\u4ef6\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.clear_button_text","title":"clear_button_text: str = 'Clear'
class-attribute
instance-attribute
","text":"\u6e05\u7a7a\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.confirm_clear_message","title":"confirm_clear_message: Optional[str] = 'Remove all the paths from the list?'
class-attribute
instance-attribute
","text":"\u6e05\u7a7a\u6587\u4ef6\u5217\u8868\u7684\u786e\u8ba4\u6d88\u606f\u6587\u672c\uff0c\u5982\u679c\u4e3a None \u5219\u4e0d\u663e\u793a\u786e\u8ba4\u6d88\u606f\uff0c\u76f4\u63a5\u6e05\u7a7a\u6587\u4ef6\u5217\u8868
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.confirm_dialog_title","title":"confirm_dialog_title: str = 'Confirm'
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u7684\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.confirm_remove_message","title":"confirm_remove_message: Optional[str] = 'Remove the selected path(s) from the list?'
class-attribute
instance-attribute
","text":"\u79fb\u9664\u5f53\u524d\u9009\u4e2d\u9879\u7684\u786e\u8ba4\u6d88\u606f\u6587\u672c\uff0c\u5982\u679c\u4e3a None \u5219\u4e0d\u663e\u793a\u786e\u8ba4\u6d88\u606f\uff0c\u76f4\u63a5\u79fb\u9664\u5f53\u524d\u9009\u4e2d\u9879
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.dir_dialog_title","title":"dir_dialog_title: str = 'Select Directory'
class-attribute
instance-attribute
","text":"\u9009\u62e9\u6587\u4ef6\u5939\u5bf9\u8bdd\u6846\u7684\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.double_click_to_edit","title":"double_click_to_edit: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5141\u8bb8\u53cc\u51fb\u5217\u8868\u9879\u8fdb\u884c\u7f16\u8f91
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.down_button_text","title":"down_button_text: str = 'Down'
class-attribute
instance-attribute
","text":"\u4e0b\u79fb\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.edit_button_text","title":"edit_button_text: str = 'Edit'
class-attribute
instance-attribute
","text":"\u7f16\u8f91\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.editor_button_text","title":"editor_button_text: str = 'Edit({} paths in list)'
class-attribute
instance-attribute
","text":"\u7f16\u8f91\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.editor_size","title":"editor_size: Tuple[int, int] = (750, 600)
class-attribute
instance-attribute
","text":"\u8def\u5f84\u5217\u8868\u7f16\u8f91\u5668\u7a97\u53e3\u7684\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.editor_title","title":"editor_title: str = ''
class-attribute
instance-attribute
","text":"\u8def\u5f84\u5217\u8868\u7f16\u8f91\u5668\u7684\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.file_dialog_title","title":"file_dialog_title: str = 'Select File'
class-attribute
instance-attribute
","text":"\u9009\u62e9\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.file_filters","title":"file_filters: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u7528\u4e8e\u9009\u62e9\u6587\u4ef6\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.file_list_title","title":"file_list_title: str = 'Paths'
class-attribute
instance-attribute
","text":"\u8def\u5f84\u5217\u8868\u533a\u57df\u7684\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.no_items_added_message","title":"no_items_added_message: Optional[str] = 'No path added!'
class-attribute
instance-attribute
","text":"\u6ca1\u6709\u6dfb\u52a0\u4efb\u4f55\u9879\u65f6\u7684\u63d0\u793a\u6d88\u606f
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.no_items_selected_message","title":"no_items_selected_message: Optional[str] = 'No path selected!'
class-attribute
instance-attribute
","text":"\u6ca1\u6709\u9009\u4e2d\u4efb\u4f55\u9879\u65f6\u7684\u63d0\u793a\u6d88\u606f
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.path_as_posix","title":"path_as_posix: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u9009\u62e9\u7684\u6587\u4ef6\u6216\u6587\u4ef6\u5939\u7684\u8def\u5f84\u4ee5 Posix \u683c\u5f0f\u4fdd\u5b58
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.path_item_editor_center_container_title","title":"path_item_editor_center_container_title: str = 'Path'
class-attribute
instance-attribute
","text":"\u8def\u5f84\u7f16\u8f91\u5bf9\u8bdd\u6846\u4e2d\u4e2d\u5fc3\u5bb9\u5668\u7684\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.path_item_editor_title","title":"path_item_editor_title: str = 'Edit Path'
class-attribute
instance-attribute
","text":"\u8def\u5f84\u7f16\u8f91\u5bf9\u8bdd\u6846\u7684\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.remove_button_text","title":"remove_button_text: str = 'Remove'
class-attribute
instance-attribute
","text":"\u79fb\u9664\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.start_dir","title":"start_dir: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u521d\u59cb\u76ee\u5f55
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.up_button_text","title":"up_button_text: str = 'Up'
class-attribute
instance-attribute
","text":"\u4e0a\u79fb\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.warning_dialog_title","title":"warning_dialog_title: str = 'Warning'
class-attribute
instance-attribute
","text":"\u8b66\u544a\u5bf9\u8bdd\u6846\u7684\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditor","title":"PathsEditor
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" paths_t
-> PathsEditor
"},{"location":"apis/pyguiadapter.widgets.plaindict/","title":"pyguiadapter.widgets.plaindict","text":""},{"location":"apis/pyguiadapter.widgets.plaindict/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig","title":"PlainDictEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
PlainDictEdit\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\extend\\plaindict.py
@dataclasses.dataclass(frozen=True)\nclass PlainDictEditConfig(CommonParameterWidgetConfig):\n \"\"\"PlainDictEdit\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[Dict[str, Any]] = dataclasses.field(default_factory=dict)\n \"\"\"\u9ed8\u8ba4\u503c\"\"\"\n\n edit_button_text: str = \"Edit\"\n \"\"\"\u7f16\u8f91\u6309\u94ae\u6587\u672c\"\"\"\n\n add_button_text: str = \"Add\"\n \"\"\"\u6dfb\u52a0\u6309\u94ae\u6587\u672c\"\"\"\n\n remove_button_text: str = \"Remove\"\n \"\"\"\u79fb\u9664\u6309\u94ae\u6587\u672c\"\"\"\n\n clear_button_text: str = \"Clear\"\n \"\"\"\u6e05\u7a7a\u6309\u94ae\u6587\u672c\"\"\"\n\n key_header: str = \"Key\"\n \"\"\"\u952e\u503c\u5bf9\u4e2d\u952e\u7684\u8868\u5934\u6587\u672c\"\"\"\n\n value_header: str = \"Value\"\n \"\"\"\u952e\u503c\u5bf9\u4e2d\u503c\u7684\u8868\u5934\u6587\u672c\"\"\"\n\n show_grid: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u7f51\u683c\u7ebf\"\"\"\n\n grid_style: Optional[GridStyle] = GridStyle.SolidLine\n \"\"\"\u7f51\u683c\u7ebf\u6837\u5f0f\"\"\"\n\n alternating_row_colors: bool = True\n \"\"\"\u662f\u5426\u4ea4\u66ff\u663e\u793a\u884c\u989c\u8272\"\"\"\n\n text_elide_mode: Optional[TextElideMode] = TextElideMode.ElideRight\n \"\"\"\u6587\u672c\u7701\u7565\u6a21\u5f0f\"\"\"\n\n corner_button_enabled: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u8fb9\u89d2\u6309\u94ae\"\"\"\n\n vertical_header_visible: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u5782\u76f4\u8868\u5934\"\"\"\n\n horizontal_header_visible: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u6c34\u5e73\u8868\u5934\"\"\"\n\n min_height: int = 260\n\n confirm_remove: bool = True\n \"\"\"\u662f\u5426\u5728\u79fb\u9664\u6570\u636e\u65f6\u5f39\u51fa\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n warning_dialog_title: str = \"Warning\"\n \"\"\"\u8b66\u544a\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_dialog_title: str = \"Confirm\"\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n no_items_message: str = \"No item has been added!\"\n \"\"\"\u6ca1\u6709\u6dfb\u52a0\u9879\u65f6\u7684\u63d0\u793a\u4fe1\u606f\"\"\"\n\n no_selection_message: str = \"No item selected!\"\n \"\"\"\u6ca1\u6709\u9009\u62e9\u9879\u65f6\u7684\u63d0\u793a\u4fe1\u606f\"\"\"\n\n confirm_remove_message: str = \"Are you sure to remove the selected item?\"\n \"\"\"\u79fb\u9664\u9879\u65f6\u7684\u786e\u8ba4\u5bf9\u8bdd\u6846\u4fe1\u606f\"\"\"\n\n confirm_clear_message: str = \"Are you sure to remove all items?\"\n \"\"\"\u6e05\u7a7a\u9879\u65f6\u7684\u786e\u8ba4\u5bf9\u8bdd\u6846\u4fe1\u606f\"\"\"\n\n edit_item_title: str = \"Edit - {}\"\n \"\"\"\u7f16\u8f91\u9879\u5bf9\u8bdd\u6846\u6807\u9898\uff0c{}\u5c06\u88ab\u66ff\u6362\u4e3a\u5f53\u524d\u9879\u7684\u952e\"\"\"\n\n add_item_title: str = \"Add Item\"\n \"\"\"\u6dfb\u52a0\u9879\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n editor_size: Tuple[int, int] = (500, 400)\n \"\"\"\u7f16\u8f91/\u6dfb\u52a0\u9879\u5bf9\u8bdd\u6846\u5927\u5c0f\"\"\"\n\n width: Optional[int] = None\n \"\"\"\u8868\u683c\u6700\u5c0f\u5bbd\u5ea6\"\"\"\n\n height: Optional[int] = 200\n \"\"\"\u8868\u683c\u6700\u5c0f\u9ad8\u5ea6\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"PlainDictEdit\"]:\n return PlainDictEdit\n
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.add_button_text","title":"add_button_text: str = 'Add'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.add_item_title","title":"add_item_title: str = 'Add Item'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u9879\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.alternating_row_colors","title":"alternating_row_colors: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u4ea4\u66ff\u663e\u793a\u884c\u989c\u8272
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.clear_button_text","title":"clear_button_text: str = 'Clear'
class-attribute
instance-attribute
","text":"\u6e05\u7a7a\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.confirm_clear_message","title":"confirm_clear_message: str = 'Are you sure to remove all items?'
class-attribute
instance-attribute
","text":"\u6e05\u7a7a\u9879\u65f6\u7684\u786e\u8ba4\u5bf9\u8bdd\u6846\u4fe1\u606f
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.confirm_dialog_title","title":"confirm_dialog_title: str = 'Confirm'
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.confirm_remove","title":"confirm_remove: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5728\u79fb\u9664\u6570\u636e\u65f6\u5f39\u51fa\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.confirm_remove_message","title":"confirm_remove_message: str = 'Are you sure to remove the selected item?'
class-attribute
instance-attribute
","text":"\u79fb\u9664\u9879\u65f6\u7684\u786e\u8ba4\u5bf9\u8bdd\u6846\u4fe1\u606f
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.corner_button_enabled","title":"corner_button_enabled: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u8fb9\u89d2\u6309\u94ae
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.default_value","title":"default_value: Optional[Dict[str, Any]] = dataclasses.field(default_factory=dict)
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.edit_button_text","title":"edit_button_text: str = 'Edit'
class-attribute
instance-attribute
","text":"\u7f16\u8f91\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.edit_item_title","title":"edit_item_title: str = 'Edit - {}'
class-attribute
instance-attribute
","text":"\u7f16\u8f91\u9879\u5bf9\u8bdd\u6846\u6807\u9898\uff0c{}\u5c06\u88ab\u66ff\u6362\u4e3a\u5f53\u524d\u9879\u7684\u952e
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.editor_size","title":"editor_size: Tuple[int, int] = (500, 400)
class-attribute
instance-attribute
","text":"\u7f16\u8f91/\u6dfb\u52a0\u9879\u5bf9\u8bdd\u6846\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.grid_style","title":"grid_style: Optional[GridStyle] = GridStyle.SolidLine
class-attribute
instance-attribute
","text":"\u7f51\u683c\u7ebf\u6837\u5f0f
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.height","title":"height: Optional[int] = 200
class-attribute
instance-attribute
","text":"\u8868\u683c\u6700\u5c0f\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.horizontal_header_visible","title":"horizontal_header_visible: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6c34\u5e73\u8868\u5934
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.key_header","title":"key_header: str = 'Key'
class-attribute
instance-attribute
","text":"\u952e\u503c\u5bf9\u4e2d\u952e\u7684\u8868\u5934\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.no_items_message","title":"no_items_message: str = 'No item has been added!'
class-attribute
instance-attribute
","text":"\u6ca1\u6709\u6dfb\u52a0\u9879\u65f6\u7684\u63d0\u793a\u4fe1\u606f
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.no_selection_message","title":"no_selection_message: str = 'No item selected!'
class-attribute
instance-attribute
","text":"\u6ca1\u6709\u9009\u62e9\u9879\u65f6\u7684\u63d0\u793a\u4fe1\u606f
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.remove_button_text","title":"remove_button_text: str = 'Remove'
class-attribute
instance-attribute
","text":"\u79fb\u9664\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.show_grid","title":"show_grid: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u7f51\u683c\u7ebf
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.text_elide_mode","title":"text_elide_mode: Optional[TextElideMode] = TextElideMode.ElideRight
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.value_header","title":"value_header: str = 'Value'
class-attribute
instance-attribute
","text":"\u952e\u503c\u5bf9\u4e2d\u503c\u7684\u8868\u5934\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.vertical_header_visible","title":"vertical_header_visible: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u5782\u76f4\u8868\u5934
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.warning_dialog_title","title":"warning_dialog_title: str = 'Warning'
class-attribute
instance-attribute
","text":"\u8b66\u544a\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"\u8868\u683c\u6700\u5c0f\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.plaindict/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit","title":"PlainDictEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit.DashDotLine","title":"DashDotLine = GridStyle.DashDotLine
class-attribute
instance-attribute
","text":"\u7f51\u683c\u7ebf\u6837\u5f0f\uff1a\u70b9\u5212\u7ebf
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit.DashLine","title":"DashLine = GridStyle.DashLine
class-attribute
instance-attribute
","text":"\u7f51\u683c\u7ebf\u6837\u5f0f\uff1a\u865a\u7ebf
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit.DotLine","title":"DotLine = GridStyle.DotLine
class-attribute
instance-attribute
","text":"\u7f51\u683c\u7ebf\u6837\u5f0f\uff1a\u70b9\u7ebf
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit.ElideLeft","title":"ElideLeft = TextElideMode.ElideLeft
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u7701\u7565\u5de6\u8fb9
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit.ElideMiddle","title":"ElideMiddle = TextElideMode.ElideMiddle
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u7701\u7565\u4e2d\u95f4
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit.ElideNone","title":"ElideNone = TextElideMode.ElideNone
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u4e0d\u7701\u7565
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit.ElideRight","title":"ElideRight = TextElideMode.ElideRight
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u7701\u7565\u53f3\u8fb9
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit.NoGridLine","title":"NoGridLine = GridStyle.NoPen
class-attribute
instance-attribute
","text":"\u7f51\u683c\u7ebf\u6837\u5f0f\uff1a\u65e0\u7ebf
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit.SolidLine","title":"SolidLine = GridStyle.SolidLine
class-attribute
instance-attribute
","text":"\u7f51\u683c\u7ebf\u6837\u5f0f\uff1a\u5b9e\u7ebf
"},{"location":"apis/pyguiadapter.widgets.plaindict/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" plain_dict_t
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/","title":"pyguiadapter.widgets.pyliteraledit","text":""},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.PyLiteralEditConfig","title":"PyLiteralEditConfig
dataclass
","text":" Bases: BaseCodeEditConfig
PyLiteralEdit\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\pyliteraledit.py
@dataclasses.dataclass(frozen=True)\nclass PyLiteralEditConfig(BaseCodeEditConfig):\n \"\"\"PyLiteralEdit\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: PyLiteralType = \"\"\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n height: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6\"\"\"\n\n width: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6\"\"\"\n\n standalone_editor: bool = True\n \"\"\"\u662f\u5426\u4f7f\u7528\u72ec\u7acb\uff08standalone\uff09\u7f16\u8f91\u5668\u7a97\u53e3\"\"\"\n\n standalone_editor_button_text: str = \"Edit Python Literal\"\n \"\"\"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6253\u5f00\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(\n default_factory=StandaloneCodeEditorConfig\n )\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\"\"\"\n\n initial_text: str = \"\"\n\n # DON'T CHANGE THE VALUES BELOW\n highlighter: Type[QPythonHighlighter] = QPythonHighlighter\n formatter: PythonFormatter = PythonFormatter()\n\n @classmethod\n def target_widget_class(cls) -> Type[\"PyLiteralEdit\"]:\n return PyLiteralEdit\n
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.PyLiteralEditConfig.default_value","title":"default_value: PyLiteralType = ''
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.PyLiteralEditConfig.height","title":"height: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.PyLiteralEditConfig.standalone_editor","title":"standalone_editor: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7f\u7528\u72ec\u7acb\uff08standalone\uff09\u7f16\u8f91\u5668\u7a97\u53e3
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.PyLiteralEditConfig.standalone_editor_button_text","title":"standalone_editor_button_text: str = 'Edit Python Literal'
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6253\u5f00\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.PyLiteralEditConfig.standalone_editor_config","title":"standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(default_factory=StandaloneCodeEditorConfig)
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u914d\u7f6e
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.PyLiteralEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig","title":"StandaloneCodeEditorConfig
dataclass
","text":" Bases: object
standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\base.py
@dataclasses.dataclass\nclass StandaloneCodeEditorConfig(object):\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b\"\"\"\n\n title: str = STANDALONE_EDITOR_TITLE\n \"\"\"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898\"\"\"\n\n text_font_family: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\"\"\"\n\n text_font_size: Optional[int] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f\"\"\"\n\n line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n line_wrap_width: int = LINE_WRAP_WIDTH\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6\"\"\"\n\n word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n file_filters: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668\"\"\"\n\n start_dir: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55\"\"\"\n\n use_default_menus: bool = True\n \"\"\"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f\"\"\"\n\n excluded_menus: Tuple[str] = ()\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\"\"\"\n\n excluded_menu_actions: Tuple[Tuple[str, str]] = (\n (MENU_FILE, ACTION_SAVE),\n (MENU_FILE, ACTION_SAVE_AS),\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879\"\"\"\n\n use_default_toolbar: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f\"\"\"\n\n excluded_toolbar_actions: Tuple[str] = (\n ACTION_SAVE,\n ACTION_SAVE_AS,\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879\"\"\"\n\n confirm_dialog: bool = True\n \"\"\"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n confirm_dialog_title: str = CONFIRM_DIALOG_TITLE\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_dialog_message: str = CONFIRM_MSG\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9\"\"\"\n
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog","title":"confirm_dialog: bool = True
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_message","title":"confirm_dialog_message: str = CONFIRM_MSG
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_title","title":"confirm_dialog_title: str = CONFIRM_DIALOG_TITLE
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menu_actions","title":"excluded_menu_actions: Tuple[Tuple[str, str]] = ((MENU_FILE, ACTION_SAVE), (MENU_FILE, ACTION_SAVE_AS))
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menus","title":"excluded_menus: Tuple[str] = ()
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_toolbar_actions","title":"excluded_toolbar_actions: Tuple[str] = (ACTION_SAVE, ACTION_SAVE_AS)
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.file_filters","title":"file_filters: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_mode","title":"line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_width","title":"line_wrap_width: int = LINE_WRAP_WIDTH
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.start_dir","title":"start_dir: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_family","title":"text_font_family: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_size","title":"text_font_size: Optional[int] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.title","title":"title: str = STANDALONE_EDITOR_TITLE
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_menus","title":"use_default_menus: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_toolbar","title":"use_default_toolbar: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.word_wrap_mode","title":"word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.PyLiteralEdit","title":"PyLiteralEdit
","text":" Bases: BaseCodeEdit
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" object
typing.Any
Union[str, int, float, bool, bytes, list, tuple, dict, set, None]
"},{"location":"apis/pyguiadapter.widgets.quantitybox/","title":"pyguiadapter.widgets.quantitybox","text":""},{"location":"apis/pyguiadapter.widgets.quantitybox/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.IntQuantityBoxConfig","title":"IntQuantityBoxConfig
dataclass
","text":" Bases: QuantityBoxConfig
IntQuantityBox\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\quantitybox.py
@dataclasses.dataclass(frozen=True)\nclass IntQuantityBoxConfig(QuantityBoxConfig):\n \"\"\"IntQuantityBox\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n # (quantity, unit)\n default_value: Optional[IntQuantityType] = (0, None)\n \"\"\"\u9ed8\u8ba4\u503c\u3002\u683c\u5f0f\u4e3a `(quantity, unit)`\u3002quantity\u4ee3\u8868\u6570\u91cf\u3002unit\u4ee3\u8868\u5355\u4f4d\uff0c\u53ef\u4ee5\u4e3a None \u6216 str\uff0c\u5982\u679c\u4e3a None\uff0c\u5219\u8868\u793a\u4f7f\u7528\u9ed8\u8ba4\u5355\u4f4d\uff0c\u5373units\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u3002\"\"\"\n\n quantity_type = int\n\n units: Sequence[str] = ()\n \"\"\"\u53ef\u9009\u7684\u5355\u4f4d\u5217\u8868\u3002\"\"\"\n\n max_value: Optional[int] = 2147483647\n \"\"\"quantity\u7684\u6700\u5927\u503c\u3002\"\"\"\n\n min_value: Optional[int] = -2147483648\n \"\"\"quantity\u7684\u6700\u5c0f\u503c\u3002\"\"\"\n\n decimals: Optional[int] = None\n\n step: Optional[int] = 1\n \"\"\"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f\u3002\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"IntQuantityBox\"]:\n return IntQuantityBox\n
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.IntQuantityBoxConfig.default_value","title":"default_value: Optional[IntQuantityType] = (0, None)
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c\u3002\u683c\u5f0f\u4e3a (quantity, unit)
\u3002quantity\u4ee3\u8868\u6570\u91cf\u3002unit\u4ee3\u8868\u5355\u4f4d\uff0c\u53ef\u4ee5\u4e3a None \u6216 str\uff0c\u5982\u679c\u4e3a None\uff0c\u5219\u8868\u793a\u4f7f\u7528\u9ed8\u8ba4\u5355\u4f4d\uff0c\u5373units\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.IntQuantityBoxConfig.max_value","title":"max_value: Optional[int] = 2147483647
class-attribute
instance-attribute
","text":"quantity\u7684\u6700\u5927\u503c\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.IntQuantityBoxConfig.min_value","title":"min_value: Optional[int] = -2147483648
class-attribute
instance-attribute
","text":"quantity\u7684\u6700\u5c0f\u503c\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.IntQuantityBoxConfig.step","title":"step: Optional[int] = 1
class-attribute
instance-attribute
","text":"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.IntQuantityBoxConfig.units","title":"units: Sequence[str] = ()
class-attribute
instance-attribute
","text":"\u53ef\u9009\u7684\u5355\u4f4d\u5217\u8868\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.FloatQuantityBoxConfig","title":"FloatQuantityBoxConfig
dataclass
","text":" Bases: QuantityBoxConfig
FloatQuantityBox\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\quantitybox.py
@dataclasses.dataclass(frozen=True)\nclass FloatQuantityBoxConfig(QuantityBoxConfig):\n \"\"\"FloatQuantityBox\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n # (quantity, unit)\n default_value: Optional[FloatQuantityType] = (0.0, None)\n \"\"\"\u9ed8\u8ba4\u503c\u3002\u683c\u5f0f\u4e3a `(quantity, unit)`\u3002quantity\u4ee3\u8868\u6570\u91cf\u3002unit\u4ee3\u8868\u5355\u4f4d\uff0c\u53ef\u4ee5\u4e3a None \u6216 str\uff0c\u5982\u679c\u4e3a None\uff0c\u5219\u8868\u793a\u4f7f\u7528\u9ed8\u8ba4\u5355\u4f4d\uff0c\u5373units\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u3002\"\"\"\n\n quantity_type = float\n\n units: Sequence[str] = ()\n \"\"\"\u53ef\u9009\u7684\u5355\u4f4d\u5217\u8868\u3002\"\"\"\n\n max_value: Optional[float] = 2147483647.0\n \"\"\"quantity\u7684\u6700\u5927\u503c\u3002\"\"\"\n\n min_value: Optional[float] = -2147483648.0\n \"\"\"quantity\u7684\u6700\u5c0f\u503c\u3002\"\"\"\n\n decimals: Optional[int] = 2\n \"\"\"quantity\u7684\u5c0f\u6570\u4f4d\u6570\u3002\"\"\"\n\n step: Optional[float] = 0.01\n \"\"\"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f\u3002\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"FloatQuantityBox\"]:\n return FloatQuantityBox\n
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.FloatQuantityBoxConfig.decimals","title":"decimals: Optional[int] = 2
class-attribute
instance-attribute
","text":"quantity\u7684\u5c0f\u6570\u4f4d\u6570\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.FloatQuantityBoxConfig.default_value","title":"default_value: Optional[FloatQuantityType] = (0.0, None)
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c\u3002\u683c\u5f0f\u4e3a (quantity, unit)
\u3002quantity\u4ee3\u8868\u6570\u91cf\u3002unit\u4ee3\u8868\u5355\u4f4d\uff0c\u53ef\u4ee5\u4e3a None \u6216 str\uff0c\u5982\u679c\u4e3a None\uff0c\u5219\u8868\u793a\u4f7f\u7528\u9ed8\u8ba4\u5355\u4f4d\uff0c\u5373units\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.FloatQuantityBoxConfig.max_value","title":"max_value: Optional[float] = 2147483647.0
class-attribute
instance-attribute
","text":"quantity\u7684\u6700\u5927\u503c\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.FloatQuantityBoxConfig.min_value","title":"min_value: Optional[float] = -2147483648.0
class-attribute
instance-attribute
","text":"quantity\u7684\u6700\u5c0f\u503c\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.FloatQuantityBoxConfig.step","title":"step: Optional[float] = 0.01
class-attribute
instance-attribute
","text":"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.FloatQuantityBoxConfig.units","title":"units: Sequence[str] = ()
class-attribute
instance-attribute
","text":"\u53ef\u9009\u7684\u5355\u4f4d\u5217\u8868\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.IntQuantityBox","title":"IntQuantityBox
","text":" Bases: QuantityBox
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.FloatQuantityBox","title":"FloatQuantityBox
","text":" Bases: QuantityBox
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#_3","title":"\u7c7b\u578b\u522b\u540d","text":" int_quantity_t
-> Tuple[int, str | None]
float_quantity_t
-> Tuple[float, str | None]
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#_4","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" int_quantity_t
-> IntQuantityBox
float_quantity_t
-> FloatQuantityBox
"},{"location":"apis/pyguiadapter.widgets.setedit/","title":"pyguiadapter.widgets.setedit","text":""},{"location":"apis/pyguiadapter.widgets.setedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.SetEditConfig","title":"SetEditConfig
dataclass
","text":" Bases: PyLiteralEditConfig
SetEdit\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\setedit.py
@dataclasses.dataclass(frozen=True)\nclass SetEditConfig(PyLiteralEditConfig):\n \"\"\"SetEdit\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[set] = dataclasses.field(default_factory=set)\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n height: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6\"\"\"\n\n width: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6\"\"\"\n\n standalone_editor: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668\"\"\"\n\n standalone_editor_button_text: str = \"Edit Set\"\n \"\"\"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c\"\"\"\n\n standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(\n default_factory=StandaloneCodeEditorConfig\n )\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\"\"\"\n\n initial_text: str = \"{}\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"SetEdit\"]:\n return SetEdit\n
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.SetEditConfig.default_value","title":"default_value: Optional[set] = dataclasses.field(default_factory=set)
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.SetEditConfig.height","title":"height: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.SetEditConfig.standalone_editor","title":"standalone_editor: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.SetEditConfig.standalone_editor_button_text","title":"standalone_editor_button_text: str = 'Edit Set'
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.SetEditConfig.standalone_editor_config","title":"standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(default_factory=StandaloneCodeEditorConfig)
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u914d\u7f6e
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.SetEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig","title":"StandaloneCodeEditorConfig
dataclass
","text":" Bases: object
standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\base.py
@dataclasses.dataclass\nclass StandaloneCodeEditorConfig(object):\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b\"\"\"\n\n title: str = STANDALONE_EDITOR_TITLE\n \"\"\"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898\"\"\"\n\n text_font_family: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\"\"\"\n\n text_font_size: Optional[int] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f\"\"\"\n\n line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n line_wrap_width: int = LINE_WRAP_WIDTH\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6\"\"\"\n\n word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n file_filters: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668\"\"\"\n\n start_dir: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55\"\"\"\n\n use_default_menus: bool = True\n \"\"\"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f\"\"\"\n\n excluded_menus: Tuple[str] = ()\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\"\"\"\n\n excluded_menu_actions: Tuple[Tuple[str, str]] = (\n (MENU_FILE, ACTION_SAVE),\n (MENU_FILE, ACTION_SAVE_AS),\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879\"\"\"\n\n use_default_toolbar: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f\"\"\"\n\n excluded_toolbar_actions: Tuple[str] = (\n ACTION_SAVE,\n ACTION_SAVE_AS,\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879\"\"\"\n\n confirm_dialog: bool = True\n \"\"\"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n confirm_dialog_title: str = CONFIRM_DIALOG_TITLE\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_dialog_message: str = CONFIRM_MSG\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9\"\"\"\n
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog","title":"confirm_dialog: bool = True
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_message","title":"confirm_dialog_message: str = CONFIRM_MSG
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_title","title":"confirm_dialog_title: str = CONFIRM_DIALOG_TITLE
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menu_actions","title":"excluded_menu_actions: Tuple[Tuple[str, str]] = ((MENU_FILE, ACTION_SAVE), (MENU_FILE, ACTION_SAVE_AS))
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menus","title":"excluded_menus: Tuple[str] = ()
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_toolbar_actions","title":"excluded_toolbar_actions: Tuple[str] = (ACTION_SAVE, ACTION_SAVE_AS)
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.file_filters","title":"file_filters: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_mode","title":"line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_width","title":"line_wrap_width: int = LINE_WRAP_WIDTH
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.start_dir","title":"start_dir: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_family","title":"text_font_family: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_size","title":"text_font_size: Optional[int] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.title","title":"title: str = STANDALONE_EDITOR_TITLE
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_menus","title":"use_default_menus: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_toolbar","title":"use_default_toolbar: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.word_wrap_mode","title":"word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.setedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.SetEdit","title":"SetEdit
","text":" Bases: PyLiteralEdit
"},{"location":"apis/pyguiadapter.widgets.setedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" set
typing.Set
typing.MutableSet
"},{"location":"apis/pyguiadapter.widgets.slider/","title":"pyguiadapter.widgets.slider","text":""},{"location":"apis/pyguiadapter.widgets.slider/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig","title":"SliderConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
Slider\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\extend\\slider.py
@dataclasses.dataclass(frozen=True)\nclass SliderConfig(CommonParameterWidgetConfig):\n \"\"\"Slider\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[int] = 0\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n min_value: int = 0\n \"\"\"\u6700\u5c0f\u503c\"\"\"\n\n max_value: int = 100\n \"\"\"\u6700\u5927\u503c\"\"\"\n\n single_step: int = 1\n \"\"\"\u5355\u6b21\u6ed1\u52a8\u7684\u6b65\u957f\"\"\"\n\n page_step: Optional[int] = None\n \"\"\"PageUp/PageDown\u6309\u952e\u6309\u4e0b\u65f6\u8c03\u6574\u7684\u6b65\u957f\"\"\"\n\n tick_interval: Optional[int] = None\n \"\"\"\u523b\u5ea6\u95f4\u9694\"\"\"\n\n tick_position: TickPosition = TickPosition.TicksBothSides\n \"\"\"\u523b\u5ea6\u4f4d\u7f6e\"\"\"\n\n tracking: bool = True\n \"\"\"\u662f\u5426\u8ddf\u8e2a\u9f20\u6807\"\"\"\n\n inverted_controls: bool = False\n \"\"\"\u662f\u5426\u542f\u7528\u53cd\u8f6c\u63a7\u5236\"\"\"\n\n inverted_appearance: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u53cd\u8f6c\u5916\u89c2\"\"\"\n\n show_value_label: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u503c\u6807\u7b7e\"\"\"\n\n prefix: str = \"\"\n \"\"\"\u503c\u524d\u7f00\"\"\"\n\n suffix: str = \"\"\n \"\"\"\u503c\u540e\u7f00\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"Slider\"]:\n return Slider\n
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.default_value","title":"default_value: Optional[int] = 0
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.inverted_appearance","title":"inverted_appearance: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u53cd\u8f6c\u5916\u89c2
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.inverted_controls","title":"inverted_controls: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u53cd\u8f6c\u63a7\u5236
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.max_value","title":"max_value: int = 100
class-attribute
instance-attribute
","text":"\u6700\u5927\u503c
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.min_value","title":"min_value: int = 0
class-attribute
instance-attribute
","text":"\u6700\u5c0f\u503c
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.page_step","title":"page_step: Optional[int] = None
class-attribute
instance-attribute
","text":"PageUp/PageDown\u6309\u952e\u6309\u4e0b\u65f6\u8c03\u6574\u7684\u6b65\u957f
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.prefix","title":"prefix: str = ''
class-attribute
instance-attribute
","text":"\u503c\u524d\u7f00
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.show_value_label","title":"show_value_label: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u503c\u6807\u7b7e
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.single_step","title":"single_step: int = 1
class-attribute
instance-attribute
","text":"\u5355\u6b21\u6ed1\u52a8\u7684\u6b65\u957f
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.suffix","title":"suffix: str = ''
class-attribute
instance-attribute
","text":"\u503c\u540e\u7f00
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.tick_interval","title":"tick_interval: Optional[int] = None
class-attribute
instance-attribute
","text":"\u523b\u5ea6\u95f4\u9694
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.tick_position","title":"tick_position: TickPosition = TickPosition.TicksBothSides
class-attribute
instance-attribute
","text":"\u523b\u5ea6\u4f4d\u7f6e
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.tracking","title":"tracking: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u8ddf\u8e2a\u9f20\u6807
"},{"location":"apis/pyguiadapter.widgets.slider/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.Slider","title":"Slider
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.Slider.NoTicks","title":"NoTicks = TickPosition.NoTicks
class-attribute
instance-attribute
","text":"\u523b\u5ea6\u4f4d\u7f6e\uff1a\u4e0d\u663e\u793a\u523b\u5ea6
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.Slider.TickBothSides","title":"TickBothSides = TickPosition.TicksBothSides
class-attribute
instance-attribute
","text":"\u523b\u5ea6\u4f4d\u7f6e\uff1a\u4e24\u4fa7\u663e\u793a\u523b\u5ea6
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.Slider.TicksAbove","title":"TicksAbove = TickPosition.TicksAbove
class-attribute
instance-attribute
","text":"\u523b\u5ea6\u4f4d\u7f6e\uff1a\u4e0a\u65b9\u663e\u793a\u523b\u5ea6
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.Slider.TicksBelow","title":"TicksBelow = TickPosition.TicksBelow
class-attribute
instance-attribute
","text":"\u523b\u5ea6\u4f4d\u7f6e\uff1a\u4e0b\u65b9\u663e\u793a\u523b\u5ea6
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.Slider.TicksLeft","title":"TicksLeft = TickPosition.TicksLeft
class-attribute
instance-attribute
","text":"\u523b\u5ea6\u4f4d\u7f6e\uff1a\u5de6\u4fa7\u663e\u793a\u523b\u5ea6
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.Slider.TicksRight","title":"TicksRight = TickPosition.TicksRight
class-attribute
instance-attribute
","text":"\u523b\u5ea6\u4f4d\u7f6e\uff1a\u53f3\u4fa7\u663e\u793a\u523b\u5ea6
"},{"location":"apis/pyguiadapter.widgets.slider/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" int_slider_t
"},{"location":"apis/pyguiadapter.widgets.stringlist/","title":"pyguiadapter.widgets.stringlist","text":""},{"location":"apis/pyguiadapter.widgets.stringlist/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig","title":"StringListEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
StringListEdit\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\stringlist.py
@dataclasses.dataclass(frozen=True)\nclass StringListEditConfig(CommonParameterWidgetConfig):\n \"\"\"StringListEdit\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Optional[List[str]] = dataclasses.field(default_factory=list)\n \"\"\"\u9ed8\u8ba4\u503c\"\"\"\n\n empty_string_strategy: Literal[\"keep_all\", \"keep_one\", \"remove_all\"] = \"remove_all\"\n \"\"\"\u5bf9\u5f85\u5217\u8868\u4e2d\u7a7a\u5b57\u7b26\u4e32\u7684\u7b56\u7565\uff0ckeep_all\u8868\u793a\u4fdd\u7559\u6240\u6709\u7a7a\u5b57\u7b26\u4e32\uff0ckeep_one\u8868\u793a\u53ea\u4fdd\u7559\u7b2c\u4e00\u4e2a\u7a7a\u5b57\u7b26\u4e32\uff0cremove_all\u8868\u793a\u5220\u9664\u6240\u6709\u7a7a\u5b57\u7b26\u4e32\"\"\"\n\n add_file: bool = True\n \"\"\"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u529f\u80fd\"\"\"\n\n add_dir: bool = True\n \"\"\"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u5939\u8def\u5f84\u529f\u80fd\"\"\"\n\n file_filters: str = \"\"\n \"\"\"\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u7528\u4e8e\u6587\u4ef6\u5bf9\u8bdd\u6846\"\"\"\n\n start_dir: str = \"\"\n \"\"\"\u8d77\u59cb\u8def\u5f84\uff0c\u7528\u4e8e\u6587\u4ef6\u5bf9\u8bdd\u6846\"\"\"\n\n normalize_path: bool = True\n \"\"\"\u662f\u5426\u5c06\u8def\u5f84\u89c4\u8303\u5316\"\"\"\n\n add_button_text: str = \"Add\"\n \"\"\"\u6dfb\u52a0\u6309\u94ae\u6587\u672c\"\"\"\n\n remove_button_text: str = \"Remove\"\n \"\"\"\u79fb\u9664\u6309\u94ae\u6587\u672c\"\"\"\n\n clear_button_text: str = \"Clear\"\n \"\"\"\u6e05\u7a7a\u6309\u94ae\u6587\u672c\"\"\"\n\n add_string_hint: str = \"Add Text\"\n \"\"\"\u6dfb\u52a0\u5b57\u7b26\u4e32\u7684\u63d0\u793a\"\"\"\n\n add_file_hint: str = \"Add File\"\n \"\"\"\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u7684\u63d0\u793a\"\"\"\n\n add_dir_hint: str = \"Add Directory\"\n \"\"\"\u6dfb\u52a0\u6587\u4ef6\u5939\u8def\u5f84\u7684\u63d0\u793a\"\"\"\n\n file_dialog_title: str = \"Select File\"\n \"\"\"\u6dfb\u52a0\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n dir_dialog_title: str = \"Select Directory\"\n \"\"\"\u6dfb\u52a0\u6587\u4ef6\u5939\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_dialog_title: str = \"Confirm\"\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n warning_dialog_title: str = \"Warning\"\n \"\"\"\u8b66\u544a\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_remove: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u79fb\u9664\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n confirm_clear: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u6e05\u7a7a\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n remove_confirm_message: str = \"Are you sure to remove the selected item?\"\n \"\"\"\u79fb\u9664\u786e\u8ba4\u5bf9\u8bdd\u6846\u6d88\u606f\"\"\"\n\n clear_confirm_message: str = \"Are you sure to remove all items?\"\n \"\"\"\u6e05\u7a7a\u786e\u8ba4\u5bf9\u8bdd\u6846\u6d88\u606f\"\"\"\n\n no_selection_message: str = \"No items are selected!\"\n \"\"\"\u672a\u9009\u62e9\u4efb\u4f55\u9879\u7684\u63d0\u793a\"\"\"\n\n drag_enabled: bool = True\n \"\"\"\u662f\u5426\u5141\u8bb8\u62d6\u62fd\"\"\"\n\n wrapping: bool = False\n \"\"\"\u662f\u5426\u5141\u8bb8\u6362\u884c\"\"\"\n\n text_elide_mode: Optional[TextElideMode] = TextElideMode.ElideNone\n \"\"\"\u6587\u672c\u7701\u7565\u6a21\u5f0f\"\"\"\n\n alternating_row_colors: bool = True\n \"\"\"\u662f\u5426\u4f7f\u7528\u4ea4\u66ff\u884c\u989c\u8272\"\"\"\n\n width: Optional[int] = None\n \"\"\"\u8868\u683c\u7684\u6700\u5c0f\u5bbd\u5ea6\"\"\"\n\n height: Optional[int] = 230\n \"\"\"\u8868\u683c\u7684\u6700\u5c0f\u9ad8\u5ea6\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"StringListEdit\"]:\n return StringListEdit\n
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.add_button_text","title":"add_button_text: str = 'Add'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.add_dir","title":"add_dir: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u5939\u8def\u5f84\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.add_dir_hint","title":"add_dir_hint: str = 'Add Directory'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6587\u4ef6\u5939\u8def\u5f84\u7684\u63d0\u793a
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.add_file","title":"add_file: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.add_file_hint","title":"add_file_hint: str = 'Add File'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u7684\u63d0\u793a
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.add_string_hint","title":"add_string_hint: str = 'Add Text'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u5b57\u7b26\u4e32\u7684\u63d0\u793a
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.alternating_row_colors","title":"alternating_row_colors: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7f\u7528\u4ea4\u66ff\u884c\u989c\u8272
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.clear_button_text","title":"clear_button_text: str = 'Clear'
class-attribute
instance-attribute
","text":"\u6e05\u7a7a\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.clear_confirm_message","title":"clear_confirm_message: str = 'Are you sure to remove all items?'
class-attribute
instance-attribute
","text":"\u6e05\u7a7a\u786e\u8ba4\u5bf9\u8bdd\u6846\u6d88\u606f
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.confirm_clear","title":"confirm_clear: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u7a7a\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.confirm_dialog_title","title":"confirm_dialog_title: str = 'Confirm'
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.confirm_remove","title":"confirm_remove: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u79fb\u9664\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.default_value","title":"default_value: Optional[List[str]] = dataclasses.field(default_factory=list)
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.dir_dialog_title","title":"dir_dialog_title: str = 'Select Directory'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6587\u4ef6\u5939\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.drag_enabled","title":"drag_enabled: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5141\u8bb8\u62d6\u62fd
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.empty_string_strategy","title":"empty_string_strategy: Literal['keep_all', 'keep_one', 'remove_all'] = 'remove_all'
class-attribute
instance-attribute
","text":"\u5bf9\u5f85\u5217\u8868\u4e2d\u7a7a\u5b57\u7b26\u4e32\u7684\u7b56\u7565\uff0ckeep_all\u8868\u793a\u4fdd\u7559\u6240\u6709\u7a7a\u5b57\u7b26\u4e32\uff0ckeep_one\u8868\u793a\u53ea\u4fdd\u7559\u7b2c\u4e00\u4e2a\u7a7a\u5b57\u7b26\u4e32\uff0cremove_all\u8868\u793a\u5220\u9664\u6240\u6709\u7a7a\u5b57\u7b26\u4e32
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.file_dialog_title","title":"file_dialog_title: str = 'Select File'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.file_filters","title":"file_filters: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u7528\u4e8e\u6587\u4ef6\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.height","title":"height: Optional[int] = 230
class-attribute
instance-attribute
","text":"\u8868\u683c\u7684\u6700\u5c0f\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.no_selection_message","title":"no_selection_message: str = 'No items are selected!'
class-attribute
instance-attribute
","text":"\u672a\u9009\u62e9\u4efb\u4f55\u9879\u7684\u63d0\u793a
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.normalize_path","title":"normalize_path: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8def\u5f84\u89c4\u8303\u5316
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.remove_button_text","title":"remove_button_text: str = 'Remove'
class-attribute
instance-attribute
","text":"\u79fb\u9664\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.remove_confirm_message","title":"remove_confirm_message: str = 'Are you sure to remove the selected item?'
class-attribute
instance-attribute
","text":"\u79fb\u9664\u786e\u8ba4\u5bf9\u8bdd\u6846\u6d88\u606f
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.start_dir","title":"start_dir: str = ''
class-attribute
instance-attribute
","text":"\u8d77\u59cb\u8def\u5f84\uff0c\u7528\u4e8e\u6587\u4ef6\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.text_elide_mode","title":"text_elide_mode: Optional[TextElideMode] = TextElideMode.ElideNone
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.warning_dialog_title","title":"warning_dialog_title: str = 'Warning'
class-attribute
instance-attribute
","text":"\u8b66\u544a\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"\u8868\u683c\u7684\u6700\u5c0f\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.wrapping","title":"wrapping: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5141\u8bb8\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.stringlist/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEdit","title":"StringListEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEdit.ElideLeft","title":"ElideLeft = TextElideMode.ElideLeft
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u7701\u7565\u5de6\u8fb9
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEdit.ElideMiddle","title":"ElideMiddle = TextElideMode.ElideMiddle
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u7701\u7565\u4e2d\u95f4
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEdit.ElideNone","title":"ElideNone = TextElideMode.ElideNone
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u4e0d\u7701\u7565
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEdit.ElideRight","title":"ElideRight = TextElideMode.ElideRight
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u7701\u7565\u53f3\u8fb9
"},{"location":"apis/pyguiadapter.widgets.stringlist/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" string_list_t
"},{"location":"apis/pyguiadapter.widgets.textedit/","title":"pyguiadapter.widgets.textedit","text":""},{"location":"apis/pyguiadapter.widgets.textedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig","title":"TextEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
TextEdit\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\extend\\textedit.py
@dataclasses.dataclass(frozen=True)\nclass TextEditConfig(CommonParameterWidgetConfig):\n \"\"\"TextEdit\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[str] = \"\"\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n placeholder: str = \"\"\n \"\"\"\u63a7\u4ef6\u7684\u5360\u4f4d\u7b26\"\"\"\n\n accept_rich_text: bool = False\n \"\"\"\u662f\u5426\u63a5\u53d7\u5bcc\u6587\u672c\"\"\"\n\n auto_formatting: Optional[AutoFormatting] = None\n \"\"\"\u662f\u5426\u81ea\u52a8\u683c\u5f0f\u5316\"\"\"\n\n line_wrap_mode: LineWrapMode = LineWrapMode.WidgetWidth\n \"\"\"\u81ea\u52a8\u6362\u884c\u6a21\u5f0f\"\"\"\n\n line_wrap_width: int = 88\n \"\"\"\u81ea\u52a8\u6362\u884c\u5bbd\u5ea6\"\"\"\n\n word_wrap_mode: Optional[WrapMode] = None\n \"\"\"\u5355\u8bcd\u6362\u884c\u6a21\u5f0f\"\"\"\n\n height: Optional[int] = 200\n \"\"\"\u63a7\u4ef6\u9ad8\u5ea6\"\"\"\n\n width: Optional[int] = None\n \"\"\"\u63a7\u4ef6\u5bbd\u5ea6\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"TextEdit\"]:\n return TextEdit\n
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig.accept_rich_text","title":"accept_rich_text: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u63a5\u53d7\u5bcc\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig.auto_formatting","title":"auto_formatting: Optional[AutoFormatting] = None
class-attribute
instance-attribute
","text":"\u662f\u5426\u81ea\u52a8\u683c\u5f0f\u5316
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig.default_value","title":"default_value: Optional[str] = ''
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig.height","title":"height: Optional[int] = 200
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig.line_wrap_mode","title":"line_wrap_mode: LineWrapMode = LineWrapMode.WidgetWidth
class-attribute
instance-attribute
","text":"\u81ea\u52a8\u6362\u884c\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig.line_wrap_width","title":"line_wrap_width: int = 88
class-attribute
instance-attribute
","text":"\u81ea\u52a8\u6362\u884c\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig.placeholder","title":"placeholder: str = ''
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u5360\u4f4d\u7b26
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig.word_wrap_mode","title":"word_wrap_mode: Optional[WrapMode] = None
class-attribute
instance-attribute
","text":"\u5355\u8bcd\u6362\u884c\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.textedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit","title":"TextEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit.FixedColumnWidth","title":"FixedColumnWidth = LineWrapMode.FixedColumnWidth
class-attribute
instance-attribute
","text":"\u6362\u884c\u6a21\u5f0f\uff1a\u56fa\u5b9a\u5217\u5bbd\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit.FixedPixelWidth","title":"FixedPixelWidth = LineWrapMode.FixedPixelWidth
class-attribute
instance-attribute
","text":"\u6362\u884c\u6a21\u5f0f\uff1a\u56fa\u5b9a\u50cf\u7d20\u5bbd\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit.ManualWordWrap","title":"ManualWordWrap = WrapMode.ManualWrap
class-attribute
instance-attribute
","text":"\u5355\u8bcd\u6362\u884c\u6a21\u5f0f\uff1a\u624b\u52a8\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit.NoLineWrap","title":"NoLineWrap = LineWrapMode.NoWrap
class-attribute
instance-attribute
","text":"\u6362\u884c\u6a21\u5f0f\uff1a\u4e0d\u81ea\u52a8\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit.NoWordWrap","title":"NoWordWrap = WrapMode.NoWrap
class-attribute
instance-attribute
","text":"\u5355\u8bcd\u6362\u884c\u6a21\u5f0f\uff1a\u4e0d\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit.WidgetWidth","title":"WidgetWidth = LineWrapMode.WidgetWidth
class-attribute
instance-attribute
","text":"\u6362\u884c\u6a21\u5f0f\uff1a\u6839\u636e\u63a7\u4ef6\u5bbd\u5ea6\u81ea\u52a8\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit.WordWrap","title":"WordWrap = WrapMode.WordWrap
class-attribute
instance-attribute
","text":"\u5355\u8bcd\u6362\u884c\u6a21\u5f0f\uff1a\u6839\u636e\u5355\u8bcd\u81ea\u52a8\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit.WordWrapAnywhere","title":"WordWrapAnywhere = WrapMode.WrapAnywhere
class-attribute
instance-attribute
","text":"\u5355\u8bcd\u6362\u884c\u6a21\u5f0f\uff1a\u4efb\u610f\u4f4d\u7f6e\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit.WordWrapAtWordBoundaryOrAnywhere","title":"WordWrapAtWordBoundaryOrAnywhere = WrapMode.WrapAtWordBoundaryOrAnywhere
class-attribute
instance-attribute
","text":"\u5355\u8bcd\u6362\u884c\u6a21\u5f0f\uff1a\u5355\u8bcd\u8fb9\u754c\u6216\u4efb\u610f\u4f4d\u7f6e\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.textedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" text_t
"},{"location":"apis/pyguiadapter.widgets.timeedit/","title":"pyguiadapter.widgets.timeedit","text":""},{"location":"apis/pyguiadapter.widgets.timeedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEditConfig","title":"TimeEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
TimeEdit\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\timeedit.py
@dataclasses.dataclass(frozen=True)\nclass TimeEditConfig(CommonParameterWidgetConfig):\n \"\"\"TimeEdit\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Union[time, QTime, None] = datetime.now().time()\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n min_time: Union[time, QTime, None] = None\n \"\"\"\u63a7\u4ef6\u7684\u6700\u5c0f\u65f6\u95f4\u503c\"\"\"\n\n max_time: Union[time, QTime, None] = None\n \"\"\"\u63a7\u4ef6\u7684\u6700\u5927\u65f6\u95f4\u503c\"\"\"\n\n display_format: Optional[str] = None\n \"\"\"\u65e5\u671f\u7684\u663e\u793a\u683c\u5f0f\uff0c\u53ef\u4ee5\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863\uff1a\n [displayFormat](https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/QDateTimeEdit.html#PySide2.QtWidgets.PySide2.QtWidgets.QDateTimeEdit.displayFormat)\n \"\"\"\n\n time_spec: Optional[TimeSpec] = None\n \"\"\"\u65f6\u95f4\u65e5\u671f\u6807\u51c6\uff0c\u53ef\u4ee5\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863:\n [TimeSpec](https://doc.qt.io/qtforpython-5/PySide2/QtCore/Qt.html#PySide2.QtCore.PySide2.QtCore.Qt.TimeSpec)\n \"\"\"\n\n alignment: Alignment = Qt.AlignLeft | Qt.AlignVCenter\n \"\"\"\u5bf9\u9f50\u65b9\u5f0f\uff0c\u53ef\u9009\u503c\u6709\uff1aAlignLeft\u3001AlignRight\u3001AlignCenter\u3001AlignJustify\u7b49\u3002\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"TimeEdit\"]:\n return TimeEdit\n
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEditConfig.alignment","title":"alignment: Alignment = Qt.AlignLeft | Qt.AlignVCenter
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff0c\u53ef\u9009\u503c\u6709\uff1aAlignLeft\u3001AlignRight\u3001AlignCenter\u3001AlignJustify\u7b49\u3002
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEditConfig.default_value","title":"default_value: Union[time, QTime, None] = datetime.now().time()
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEditConfig.display_format","title":"display_format: Optional[str] = None
class-attribute
instance-attribute
","text":"\u65e5\u671f\u7684\u663e\u793a\u683c\u5f0f\uff0c\u53ef\u4ee5\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863\uff1a displayFormat
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEditConfig.max_time","title":"max_time: Union[time, QTime, None] = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u6700\u5927\u65f6\u95f4\u503c
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEditConfig.min_time","title":"min_time: Union[time, QTime, None] = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u6700\u5c0f\u65f6\u95f4\u503c
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEditConfig.time_spec","title":"time_spec: Optional[TimeSpec] = None
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u6807\u51c6\uff0c\u53ef\u4ee5\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863: TimeSpec
"},{"location":"apis/pyguiadapter.widgets.timeedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEdit","title":"TimeEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEdit.AlignCenter","title":"AlignCenter = Qt.AlignCenter
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u5c45\u4e2d\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEdit.AlignJustify","title":"AlignJustify = Qt.AlignJustify
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u4e24\u7aef\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEdit.AlignLeft","title":"AlignLeft = Qt.AlignLeft
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u5de6\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEdit.AlignRight","title":"AlignRight = Qt.AlignRight
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u53f3\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEdit.LocalTime","title":"LocalTime = Qt.LocalTime
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1a\u672c\u5730\u65f6\u95f4
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEdit.OffsetFromUTC","title":"OffsetFromUTC = Qt.OffsetFromUTC
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1aOffsetFromUTC
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEdit.TimeZone","title":"TimeZone = Qt.TimeZone
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1aTimeZone
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEdit.UTC","title":"UTC = Qt.UTC
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1aUTC
"},{"location":"apis/pyguiadapter.widgets.timeedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" datetime.time
"},{"location":"apis/pyguiadapter.widgets.tupleedit/","title":"pyguiadapter.widgets.tupleedit","text":""},{"location":"apis/pyguiadapter.widgets.tupleedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.TupleEditConfig","title":"TupleEditConfig
dataclass
","text":" Bases: PyLiteralEditConfig
TupleEdit\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\tupleedit.py
@dataclasses.dataclass(frozen=True)\nclass TupleEditConfig(PyLiteralEditConfig):\n \"\"\"TupleEdit\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[tuple] = ()\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n height: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6\"\"\"\n\n width: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6\"\"\"\n\n standalone_editor: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668\"\"\"\n\n standalone_editor_button_text: str = \"Edit Tuple\"\n \"\"\"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c\"\"\"\n\n standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(\n default_factory=StandaloneCodeEditorConfig\n )\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\"\"\"\n\n initial_text: str = \"()\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"TupleEdit\"]:\n return TupleEdit\n
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.TupleEditConfig.default_value","title":"default_value: Optional[tuple] = ()
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.TupleEditConfig.height","title":"height: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.TupleEditConfig.standalone_editor","title":"standalone_editor: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.TupleEditConfig.standalone_editor_button_text","title":"standalone_editor_button_text: str = 'Edit Tuple'
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.TupleEditConfig.standalone_editor_config","title":"standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(default_factory=StandaloneCodeEditorConfig)
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u914d\u7f6e
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.TupleEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig","title":"StandaloneCodeEditorConfig
dataclass
","text":" Bases: object
standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\base.py
@dataclasses.dataclass\nclass StandaloneCodeEditorConfig(object):\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b\"\"\"\n\n title: str = STANDALONE_EDITOR_TITLE\n \"\"\"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898\"\"\"\n\n text_font_family: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\"\"\"\n\n text_font_size: Optional[int] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f\"\"\"\n\n line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n line_wrap_width: int = LINE_WRAP_WIDTH\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6\"\"\"\n\n word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n file_filters: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668\"\"\"\n\n start_dir: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55\"\"\"\n\n use_default_menus: bool = True\n \"\"\"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f\"\"\"\n\n excluded_menus: Tuple[str] = ()\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\"\"\"\n\n excluded_menu_actions: Tuple[Tuple[str, str]] = (\n (MENU_FILE, ACTION_SAVE),\n (MENU_FILE, ACTION_SAVE_AS),\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879\"\"\"\n\n use_default_toolbar: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f\"\"\"\n\n excluded_toolbar_actions: Tuple[str] = (\n ACTION_SAVE,\n ACTION_SAVE_AS,\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879\"\"\"\n\n confirm_dialog: bool = True\n \"\"\"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n confirm_dialog_title: str = CONFIRM_DIALOG_TITLE\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_dialog_message: str = CONFIRM_MSG\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9\"\"\"\n
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog","title":"confirm_dialog: bool = True
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_message","title":"confirm_dialog_message: str = CONFIRM_MSG
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_title","title":"confirm_dialog_title: str = CONFIRM_DIALOG_TITLE
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menu_actions","title":"excluded_menu_actions: Tuple[Tuple[str, str]] = ((MENU_FILE, ACTION_SAVE), (MENU_FILE, ACTION_SAVE_AS))
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menus","title":"excluded_menus: Tuple[str] = ()
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_toolbar_actions","title":"excluded_toolbar_actions: Tuple[str] = (ACTION_SAVE, ACTION_SAVE_AS)
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.file_filters","title":"file_filters: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_mode","title":"line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_width","title":"line_wrap_width: int = LINE_WRAP_WIDTH
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.start_dir","title":"start_dir: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_family","title":"text_font_family: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_size","title":"text_font_size: Optional[int] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.title","title":"title: str = STANDALONE_EDITOR_TITLE
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_menus","title":"use_default_menus: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_toolbar","title":"use_default_toolbar: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.word_wrap_mode","title":"word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.TupleEdit","title":"TupleEdit
","text":" Bases: PyLiteralEdit
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" tuple
typing.Tuple
"},{"location":"apis/pyguiadapter.window/","title":"pyguiadapter.window","text":""},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig","title":"BaseWindowConfig
dataclass
","text":" Bases: object
Source code in pyguiadapter\\window.py
@dataclasses.dataclass(frozen=True)\nclass BaseWindowConfig(object):\n title: str = \"\"\n \"\"\"\u7a97\u53e3\u6807\u9898\"\"\"\n\n icon: IconType = None\n \"\"\"\u7a97\u53e3\u56fe\u6807\"\"\"\n\n size: Union[Tuple[int, int], QSize] = (800, 600)\n \"\"\"\u7a97\u53e3\u5927\u5c0f\"\"\"\n\n position: Optional[Tuple[int, int]] = None\n \"\"\"\u7a97\u53e3\u4f4d\u7f6e\"\"\"\n\n always_on_top: bool = False\n \"\"\"\u7a97\u53e3\u662f\u5426\u6c38\u8fdc\u7f6e\u9876\"\"\"\n\n font_family: Union[str, Sequence[str], None] = None\n \"\"\"\u7a97\u53e3\u4f7f\u7528\u7684\u5b57\u4f53\"\"\"\n\n font_size: Optional[int] = None\n \"\"\"\u7a97\u53e3\u5b57\u4f53\u7684\u5927\u5c0f\uff08px\uff09\"\"\"\n\n close_button: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u5173\u95ed\u6309\u94ae\"\"\"\n\n minimize_button: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u6700\u5c0f\u5316\u6309\u94ae\"\"\"\n\n maximize_button: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u6700\u5927\u5316\u6309\u94ae\"\"\"\n\n stylesheet: Optional[str] = None\n \"\"\"\u7a97\u53e3\u7684\u6837\u5f0f\u8868\uff08QSS\u683c\u5f0f\uff09\"\"\"\n
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.always_on_top","title":"always_on_top: bool = False
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u662f\u5426\u6c38\u8fdc\u7f6e\u9876
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.close_button","title":"close_button: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u5173\u95ed\u6309\u94ae
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.font_family","title":"font_family: Union[str, Sequence[str], None] = None
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u4f7f\u7528\u7684\u5b57\u4f53
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.font_size","title":"font_size: Optional[int] = None
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u5b57\u4f53\u7684\u5927\u5c0f\uff08px\uff09
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.icon","title":"icon: IconType = None
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u56fe\u6807
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.maximize_button","title":"maximize_button: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6700\u5927\u5316\u6309\u94ae
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.minimize_button","title":"minimize_button: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6700\u5c0f\u5316\u6309\u94ae
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.position","title":"position: Optional[Tuple[int, int]] = None
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u4f4d\u7f6e
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.size","title":"size: Union[Tuple[int, int], QSize] = (800, 600)
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u5927\u5c0f
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.stylesheet","title":"stylesheet: Optional[str] = None
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u7684\u6837\u5f0f\u8868\uff08QSS\u683c\u5f0f\uff09
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.title","title":"title: str = ''
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u6807\u9898
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowEventListener","title":"BaseWindowEventListener
","text":" Bases: object
\u8be5\u7c7b\u4e3a\u7a97\u53e3\u4e8b\u4ef6\u76d1\u542c\u5668\u57fa\u7c7b\uff0c\u7528\u4e8e\u76d1\u542cBaseWindow
\u7c7b\u7684\u7a97\u53e3\u4e8b\u4ef6\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u5b50\u7c7b\u4e2doverride\u7279\u5b9a\u7684\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u4ee5\u5b9e\u73b0\u5bf9\u7279\u5b9a\u4e8b\u4ef6\u7684\u76d1\u542c
Source code in pyguiadapter\\window.py
class BaseWindowEventListener(object):\n \"\"\"\u8be5\u7c7b\u4e3a\u7a97\u53e3\u4e8b\u4ef6\u76d1\u542c\u5668\u57fa\u7c7b\uff0c\u7528\u4e8e\u76d1\u542c`BaseWindow`\u7c7b\u7684\u7a97\u53e3\u4e8b\u4ef6\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u5b50\u7c7b\u4e2doverride\u7279\u5b9a\u7684\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u4ee5\u5b9e\u73b0\u5bf9\u7279\u5b9a\u4e8b\u4ef6\u7684\u76d1\u542c\"\"\"\n\n def on_create(self, window: \"BaseWindow\") -> None:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u521b\u5efa\u540e\u8c03\u7528\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u65e0\u8fd4\u56de\u503c\n \"\"\"\n pass\n\n # noinspection PyUnusedLocal\n def on_close(self, window: \"BaseWindow\") -> bool:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u5173\u95ed\u65f6\u8c03\u7528\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u8fd4\u56de\u4e00\u4e2a`bool`\u503c\uff0c\u7528\u4e8e\u6307\u793a\u662f\u5426\u8981\u5173\u95ed\u7a97\u53e3\u3002\u8fd4\u56de`True`\u8868\u793a\u786e\u5b9e\u8981\u5173\u95ed\u7a97\u53e3\uff0c\u8fd4\u56de`False`\u5c06\u963b\u6b62\u7a97\u53e3\u88ab\u5173\u95ed\u3002\u9ed8\u8ba4\u8fd4\u56de`True`\u3002\n \"\"\"\n return True\n\n def on_destroy(self, window: \"BaseWindow\") -> None:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u9500\u6bc1\u540e\u8c03\u7528\uff08\u6ce8\u610f\uff1a\u5728\u8be5\u51fd\u6570\u56de\u8c03\u540e\uff0c\u8fd8\u5c06\u56de\u8c03\u4e00\u6b21`on_hide()`\uff09\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u65e0\u8fd4\u56de\u503c\n \"\"\"\n pass\n\n def on_hide(self, window: \"BaseWindow\") -> None:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u88ab\u9690\u85cf\u540e\u8c03\u7528\uff08\u6ce8\u610f\uff1a\u5728`on_destroy()`\u88ab\u56de\u8c03\u540e\uff0c\u6b64\u51fd\u6570\u5c06\u88ab\u56de\u8c03\uff09\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u65e0\u8fd4\u56de\u503c\n \"\"\"\n pass\n\n def on_show(self, window: \"BaseWindow\") -> None:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u663e\u793a\u540e\u8c03\u7528\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u65e0\u8fd4\u56de\u503c\n \"\"\"\n pass\n
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowEventListener.on_close","title":"on_close(window: BaseWindow) -> bool
","text":"\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u5173\u95ed\u65f6\u8c03\u7528\u3002
Parameters:
Name Type Description Default window
BaseWindow
\u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3
required Returns:
Type Description bool
\u8fd4\u56de\u4e00\u4e2abool
\u503c\uff0c\u7528\u4e8e\u6307\u793a\u662f\u5426\u8981\u5173\u95ed\u7a97\u53e3\u3002\u8fd4\u56deTrue
\u8868\u793a\u786e\u5b9e\u8981\u5173\u95ed\u7a97\u53e3\uff0c\u8fd4\u56deFalse
\u5c06\u963b\u6b62\u7a97\u53e3\u88ab\u5173\u95ed\u3002\u9ed8\u8ba4\u8fd4\u56deTrue
\u3002
Source code in pyguiadapter\\window.py
def on_close(self, window: \"BaseWindow\") -> bool:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u5173\u95ed\u65f6\u8c03\u7528\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u8fd4\u56de\u4e00\u4e2a`bool`\u503c\uff0c\u7528\u4e8e\u6307\u793a\u662f\u5426\u8981\u5173\u95ed\u7a97\u53e3\u3002\u8fd4\u56de`True`\u8868\u793a\u786e\u5b9e\u8981\u5173\u95ed\u7a97\u53e3\uff0c\u8fd4\u56de`False`\u5c06\u963b\u6b62\u7a97\u53e3\u88ab\u5173\u95ed\u3002\u9ed8\u8ba4\u8fd4\u56de`True`\u3002\n \"\"\"\n return True\n
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowEventListener.on_create","title":"on_create(window: BaseWindow) -> None
","text":"\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u521b\u5efa\u540e\u8c03\u7528\u3002
Parameters:
Name Type Description Default window
BaseWindow
\u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Source code in pyguiadapter\\window.py
def on_create(self, window: \"BaseWindow\") -> None:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u521b\u5efa\u540e\u8c03\u7528\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u65e0\u8fd4\u56de\u503c\n \"\"\"\n pass\n
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowEventListener.on_destroy","title":"on_destroy(window: BaseWindow) -> None
","text":"\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u9500\u6bc1\u540e\u8c03\u7528\uff08\u6ce8\u610f\uff1a\u5728\u8be5\u51fd\u6570\u56de\u8c03\u540e\uff0c\u8fd8\u5c06\u56de\u8c03\u4e00\u6b21on_hide()
\uff09\u3002
Parameters:
Name Type Description Default window
BaseWindow
\u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Source code in pyguiadapter\\window.py
def on_destroy(self, window: \"BaseWindow\") -> None:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u9500\u6bc1\u540e\u8c03\u7528\uff08\u6ce8\u610f\uff1a\u5728\u8be5\u51fd\u6570\u56de\u8c03\u540e\uff0c\u8fd8\u5c06\u56de\u8c03\u4e00\u6b21`on_hide()`\uff09\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u65e0\u8fd4\u56de\u503c\n \"\"\"\n pass\n
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowEventListener.on_hide","title":"on_hide(window: BaseWindow) -> None
","text":"\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u88ab\u9690\u85cf\u540e\u8c03\u7528\uff08\u6ce8\u610f\uff1a\u5728on_destroy()
\u88ab\u56de\u8c03\u540e\uff0c\u6b64\u51fd\u6570\u5c06\u88ab\u56de\u8c03\uff09\u3002
Parameters:
Name Type Description Default window
BaseWindow
\u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Source code in pyguiadapter\\window.py
def on_hide(self, window: \"BaseWindow\") -> None:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u88ab\u9690\u85cf\u540e\u8c03\u7528\uff08\u6ce8\u610f\uff1a\u5728`on_destroy()`\u88ab\u56de\u8c03\u540e\uff0c\u6b64\u51fd\u6570\u5c06\u88ab\u56de\u8c03\uff09\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u65e0\u8fd4\u56de\u503c\n \"\"\"\n pass\n
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowEventListener.on_show","title":"on_show(window: BaseWindow) -> None
","text":"\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u663e\u793a\u540e\u8c03\u7528\u3002
Parameters:
Name Type Description Default window
BaseWindow
\u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Source code in pyguiadapter\\window.py
def on_show(self, window: \"BaseWindow\") -> None:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u663e\u793a\u540e\u8c03\u7528\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u65e0\u8fd4\u56de\u503c\n \"\"\"\n pass\n
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.SimpleWindowEventListener","title":"SimpleWindowEventListener
","text":" Bases: BaseWindowEventListener
\u8be5\u7c7b\u4e3aBaseWindowEventListener
\u5b50\u7c7b\uff0c\u7528\u4e8e\u5feb\u901f\u521b\u5efaBaseWindowEventListener
\u5b9e\u4f8b\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u76f4\u63a5\u5728\u6784\u9020\u51fd\u6570\u4e2d\u4f20\u5165\u8981\u76d1\u542c\u7684\u4e8b\u4ef6\u7684\u56de\u8c03\u51fd\u6570\uff0c \u800c\u4e0d\u5fc5\u624b\u52a8\u521b\u5efaBaseWindowEventListener
\u7684\u5b50\u7c7b\u3002
Source code in pyguiadapter\\window.py
class SimpleWindowEventListener(BaseWindowEventListener):\n \"\"\"\u8be5\u7c7b\u4e3a`BaseWindowEventListener`\u5b50\u7c7b\uff0c\u7528\u4e8e\u5feb\u901f\u521b\u5efa`BaseWindowEventListener`\u5b9e\u4f8b\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u76f4\u63a5\u5728\u6784\u9020\u51fd\u6570\u4e2d\u4f20\u5165\u8981\u76d1\u542c\u7684\u4e8b\u4ef6\u7684\u56de\u8c03\u51fd\u6570\uff0c\n \u800c\u4e0d\u5fc5\u624b\u52a8\u521b\u5efa`BaseWindowEventListener`\u7684\u5b50\u7c7b\u3002\n \"\"\"\n\n def __init__(\n self,\n on_create: Callable[[\"BaseWindow\"], None] = None,\n on_show: Callable[[\"BaseWindow\"], None] = None,\n on_hide: Callable[[\"BaseWindow\"], None] = None,\n on_close: Callable[[\"BaseWindow\"], bool] = None,\n on_destroy: Callable[[\"BaseWindow\"], None] = None,\n ):\n \"\"\"\n \u6784\u9020\u51fd\u6570\u3002\u7528\u4e8e\u521b\u5efa`SimpleWindowEventListener`\u7c7b\u5b9e\u4f8b\u3002\n\n Args:\n on_create: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u521b\u5efa\u540e\u8c03\u7528\u3002\n on_show: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u663e\u793a\u540e\u56de\u8c03\u3002\n on_hide: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u88ab\u9690\u85cf\u65f6\u56de\u8c03\u3002\n on_close: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u88ab\u5173\u95ed\u65f6\u56de\u8c03\u3002\n on_destroy: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u88ab\u9500\u6bc1\u540e\u56de\u8c03\u3002\n \"\"\"\n self._on_create_callback = on_create\n self._on_show_callback = on_show\n self._on_hide_callback = on_hide\n self._on_close_callback = on_close\n self._on_destroy_callback = on_destroy\n\n def on_create(self, window: \"BaseWindow\") -> None:\n if self._on_create_callback:\n return self._on_create_callback(window)\n return super().on_create(window)\n\n def on_close(self, window: \"BaseWindow\") -> bool:\n if self._on_close_callback:\n return self._on_close_callback(window)\n return super().on_close(window)\n\n def on_destroy(self, window: \"BaseWindow\") -> None:\n if self._on_destroy_callback:\n return self._on_destroy_callback(window)\n return super().on_destroy(window)\n\n def on_hide(self, window: \"BaseWindow\") -> None:\n if self._on_hide_callback:\n return self._on_hide_callback(window)\n return super().on_hide(window)\n\n def on_show(self, window: \"BaseWindow\") -> None:\n if self._on_show_callback:\n return self._on_show_callback(window)\n return super().on_show(window)\n
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.SimpleWindowEventListener.__init__","title":"__init__(on_create: Callable[[BaseWindow], None] = None, on_show: Callable[[BaseWindow], None] = None, on_hide: Callable[[BaseWindow], None] = None, on_close: Callable[[BaseWindow], bool] = None, on_destroy: Callable[[BaseWindow], None] = None)
","text":"\u6784\u9020\u51fd\u6570\u3002\u7528\u4e8e\u521b\u5efaSimpleWindowEventListener
\u7c7b\u5b9e\u4f8b\u3002
Parameters:
Name Type Description Default on_create
Callable[[BaseWindow], None]
\u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u521b\u5efa\u540e\u8c03\u7528\u3002
None
on_show
Callable[[BaseWindow], None]
\u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u663e\u793a\u540e\u56de\u8c03\u3002
None
on_hide
Callable[[BaseWindow], None]
\u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u88ab\u9690\u85cf\u65f6\u56de\u8c03\u3002
None
on_close
Callable[[BaseWindow], bool]
\u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u88ab\u5173\u95ed\u65f6\u56de\u8c03\u3002
None
on_destroy
Callable[[BaseWindow], None]
\u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u88ab\u9500\u6bc1\u540e\u56de\u8c03\u3002
None
Source code in pyguiadapter\\window.py
def __init__(\n self,\n on_create: Callable[[\"BaseWindow\"], None] = None,\n on_show: Callable[[\"BaseWindow\"], None] = None,\n on_hide: Callable[[\"BaseWindow\"], None] = None,\n on_close: Callable[[\"BaseWindow\"], bool] = None,\n on_destroy: Callable[[\"BaseWindow\"], None] = None,\n):\n \"\"\"\n \u6784\u9020\u51fd\u6570\u3002\u7528\u4e8e\u521b\u5efa`SimpleWindowEventListener`\u7c7b\u5b9e\u4f8b\u3002\n\n Args:\n on_create: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u521b\u5efa\u540e\u8c03\u7528\u3002\n on_show: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u663e\u793a\u540e\u56de\u8c03\u3002\n on_hide: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u88ab\u9690\u85cf\u65f6\u56de\u8c03\u3002\n on_close: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u88ab\u5173\u95ed\u65f6\u56de\u8c03\u3002\n on_destroy: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u88ab\u9500\u6bc1\u540e\u56de\u8c03\u3002\n \"\"\"\n self._on_create_callback = on_create\n self._on_show_callback = on_show\n self._on_hide_callback = on_hide\n self._on_close_callback = on_close\n self._on_destroy_callback = on_destroy\n
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow","title":"BaseWindow
","text":" Bases: QMainWindow
PyGUIAdapter
\u4e2d\u6240\u6709\u9876\u7ea7\u7a97\u53e3\u7684\u57fa\u7c7b\uff0c\u5b9a\u4e49\u4e86\u7a97\u53e3\u57fa\u672c\u7684\u5916\u89c2\u548c\u903b\u8f91\uff0c\u5e76\u4e14\u5b9e\u73b0\u4e86\u4e00\u4e9b\u516c\u5171\u7684\u65b9\u6cd5\u3002 \u8fd9\u4e9b\u65b9\u6cd5\u53ef\u4ee5\u5728\u7a97\u53e3\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u6216\u8005Action
\u7684\u56de\u8c03\u51fd\u6570\u4e2d\u8c03\u7528\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.clear_toasts","title":"clear_toasts() -> None
","text":"\u6e05\u9664\u4e4b\u524d\u53d1\u51fa\u7684toast\u6d88\u606f\u3002
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.get_action_state","title":"get_action_state(action: Action) -> Optional[bool]
","text":"\u68c0\u67e5\u76ee\u6807Action
\u7684\u5f53\u524d\u72b6\u6001
Parameters:
Name Type Description Default action
Action
\u76ee\u6807Action
required Returns:
Type Description Optional[bool]
\u8fd4\u56de\u76ee\u6807Action
\u7684\u5f53\u524d\u72b6\u6001\u3002\u82e5\u672a\u627e\u5230\u76ee\u6807Action
\uff0c\u5219\u8fd4\u56deNone
\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.get_clipboard_text","title":"get_clipboard_text() -> str
staticmethod
","text":"\u83b7\u53d6\u526a\u8d34\u677f\u5185\u5bb9\u3002
Returns:
Type Description str
\u8fd4\u56de\u5f53\u524d\u526a\u8d34\u677f\u6587\u672c\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.get_font_families","title":"get_font_families() -> Sequence[str]
","text":"\u83b7\u53d6\u5f53\u524d\u7a97\u53e3\u5b57\u4f53\u7cfb\u5217\u540d\u79f0\u3002
Returns:
Type Description Sequence[str]
\u8fd4\u56de\u5f53\u524d\u7a97\u53e3\u5b57\u4f53\u7cfb\u5217\u540d\u79f0\uff08\u4ee5\u5217\u8868\u5f62\u5f0f\uff09\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.get_font_family","title":"get_font_family() -> str
","text":"\u83b7\u53d6\u5f53\u524d\u7a97\u53e3\u5b57\u4f53\u7cfb\u5217\u540d\u79f0\u3002
Returns:
Type Description str
\u8fd4\u56de\u5f53\u524d\u7a97\u53e3\u5b57\u4f53\u7cfb\u5217\u540d\u79f0\uff08\u4ee5\u5b57\u7b26\u4e32\u5f62\u5f0f\uff09\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.get_font_size","title":"get_font_size() -> int
","text":"\u83b7\u53d6\u7a97\u53e3\u5b57\u4f53\u5927\u5c0f\uff08px\uff09\u3002
Returns:
Type Description int
\u8fd4\u56de\u5f53\u524d\u7a97\u53e3\u5b57\u4f53\u5927\u5c0f\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.get_position","title":"get_position() -> Tuple[int, int]
","text":"\u83b7\u53d6\u7a97\u53e3\u4f4d\u7f6e\u3002
Returns:
Type Description Tuple[int, int]
\u8fd4\u56de\u7a97\u53e3\u5f53\u524d\u5728\u5c4f\u5e55\u4e0a\u7684\u4f4d\u7f6e\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.get_size","title":"get_size() -> Tuple[int, int]
","text":"\u83b7\u53d6\u7a97\u53e3\u5f53\u524d\u5c3a\u5bf8\u3002
Returns:
Type Description Tuple[int, int]
\u8fd4\u56de\u7a97\u53e3\u5f53\u524d\u5c3a\u5bf8\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.get_stylesheet","title":"get_stylesheet() -> str
","text":"\u83b7\u53d6\u7a97\u53e3\u5f53\u524d\u6837\u5f0f\u8868\u3002
Returns:
Type Description str
\u8fd4\u56de\u7a97\u53e3\u5f53\u524d\u6837\u5f0f\u8868\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.get_title","title":"get_title() -> str
","text":"\u83b7\u53d6\u7a97\u53e3\u6807\u9898\u3002
Returns:
Type Description str
\u8fd4\u56de\u5f53\u524d\u7a97\u53e3\u6807\u9898
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.has_action","title":"has_action(action: Action) -> bool
","text":"\u68c0\u6d4b\u6307\u5b9aAction
\u662f\u5426\u88ab\u6dfb\u52a0\u5230\u5f53\u524d\u7a97\u53e3\u4e2d\u3002
Parameters:
Name Type Description Default action
Action
\u5f85\u68c0\u6d4b\u7684Action
required Returns:
Type Description bool
\u8fd4\u56deTrue
\u4ee3\u8868\u6307\u5b9aAction
\u5df2\u88ab\u6dfb\u52a0\u5230\u5f53\u524d\u7a97\u53e3\u4e2d\uff0c\u5426\u5219\u8fd4\u56deFalse
\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.is_action_checkable","title":"is_action_checkable(action: Action) -> Optional[bool]
","text":"\u68c0\u6d4b\u6307\u5b9aAction
\u662f\u5426\u4e3a\u201c\u53ef\u9009\u4e2d\u201d\u7684\u3002
Parameters:
Name Type Description Default action
Action
\u5f85\u68c0\u6d4b\u7684Action
required Returns:
Type Description Optional[bool]
\u8fd4\u56deTrue
\u4ee3\u8868\u6307\u5b9aAction
\u4e3a\u201c\u53ef\u9009\u4e2d\u201d\u7684\uff0c\u5426\u5219\u8fd4\u56deFalse
\u3002\u82e5\u672a\u627e\u5230\u6307\u5b9aAction
\uff0c\u5219\u8fd4\u56deNone
\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.is_action_checked","title":"is_action_checked(action: Action) -> Optional[bool]
","text":"\u68c0\u6d4b\u6307\u5b9aAction
\u662f\u5426\u5904\u4e8e\u201c\u9009\u4e2d\u201d\u72b6\u6001\u3002
Parameters:
Name Type Description Default action
Action
\u5f85\u68c0\u6d4b\u7684Action
required Returns:
Type Description Optional[bool]
\u8fd4\u56deTrue
\u4ee3\u8868\u6307\u5b9aAction
\u5f53\u524d\u4e3a\u201c\u9009\u4e2d\u201d\u72b6\u6001\u7684\uff0c\u5426\u5219\u8fd4\u56deFalse
\u3002\u82e5\u672a\u627e\u5230\u6307\u5b9aAction
\uff0c\u5219\u8fd4\u56deNone
\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.is_action_enabled","title":"is_action_enabled(action: Action) -> Optional[bool]
","text":"\u68c0\u67e5\u76ee\u6807Action
\u5f53\u524d\u7684\u542f\u7528\u72b6\u6001\u3002
Parameters:
Name Type Description Default action
Action
\u76ee\u6807Action
required Returns:
Type Description Optional[bool]
\u8fd4\u56de\u76ee\u6807Action
\u5f53\u524d\u7684\u542f\u7528\u72b6\u6001\u3002\u82e5\u672a\u627e\u5230\u76ee\u6807Action
\uff0c\u5219\u8fd4\u56deNone
\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.is_always_on_top","title":"is_always_on_top() -> bool
","text":"\u5224\u65ad\u7a97\u53e3\u662f\u5426\u603b\u662f\u7f6e\u9876\u3002
Returns:
Type Description bool
\u8fd4\u56deTrue
\u4ee3\u8868\u7a97\u53e3\u5f53\u524d\u5904\u4e8e\u603b\u662f\u7f6e\u9876\u72b6\u6001\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_action_enabled","title":"set_action_enabled(action: Action, enabled: bool) -> Optional[bool]
","text":"\u8bbe\u7f6e\u76ee\u6807Action
\u7684\u542f\u7528\u72b6\u6001\u3002
Parameters:
Name Type Description Default action
Action
\u76ee\u6807Action
required enabled
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description Optional[bool]
\u8fd4\u56de\u8bbe\u7f6e\u4e4b\u524d\u7684\u542f\u7528\u72b6\u6001\u3002\u82e5\u672a\u627e\u5230\u76ee\u6807Action
\uff0c\u5219\u8fd4\u56deNone
\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_action_state","title":"set_action_state(action: Action, checked: bool) -> Optional[bool]
","text":"\u8bbe\u7f6eAction
\u5f53\u524d\u72b6\u6001\u3002
Parameters:
Name Type Description Default action
Action
\u76ee\u6807Action
required checked
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description Optional[bool]
\u8fd4\u56de\u8bbe\u7f6e\u4e4b\u524d\u7684\u72b6\u6001\u3002\u82e5\u672a\u627e\u5230\u76ee\u6807Action
\uff0c\u5219\u8fd4\u56deNone
\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_always_on_top","title":"set_always_on_top(enabled: bool) -> None
","text":"\u8bbe\u7f6e\u7a97\u53e3\u662f\u5426\u603b\u662f\u7f6e\u9876\u3002
Parameters:
Name Type Description Default enabled
bool
\u662f\u5426\u603b\u662f\u7f6e\u9876
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_clipboard_text","title":"set_clipboard_text(text: str) -> None
staticmethod
","text":"\u8bbe\u7f6e\u526a\u8d34\u677f\u5185\u5bb9\u3002
Parameters:
Name Type Description Default text
str
\u8981\u8bbe\u7f6e\u5230\u526a\u8d34\u677f\u4e2d\u7684\u6587\u672c
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_font","title":"set_font(font_family: Union[str, Sequence[str]], font_size: int) -> None
","text":"\u8bbe\u7f6e\u7a97\u53e3\u5b57\u4f53\u3002
Parameters:
Name Type Description Default font_family
Union[str, Sequence[str]]
\u5b57\u4f53\u540d\u79f0
required font_size
int
\u5b57\u4f53\u5927\u5c0f\uff08px\uff09
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_icon","title":"set_icon(icon: IconType) -> None
","text":"\u8bbe\u7f6e\u7a97\u53e3\u56fe\u6807\u3002
Parameters:
Name Type Description Default icon
IconType
\u5f85\u8bbe\u7f6e\u7684\u56fe\u6807
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_position","title":"set_position(position: Optional[Tuple[int, int]]) -> None
","text":"\u8bbe\u7f6e\u7a97\u53e3\u5728\u5c4f\u5e55\u4e0a\u7684\u4f4d\u7f6e\u3002
Parameters:
Name Type Description Default position
Optional[Tuple[int, int]]
\u76ee\u6807\u4f4d\u7f6e\u3002
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_size","title":"set_size(size: Union[Tuple[int, int], QSize]) -> None
","text":"\u8bbe\u7f6e\u7a97\u53e3\u5c3a\u5bf8\u3002
Parameters:
Name Type Description Default size
Union[Tuple[int, int], QSize]
\u76ee\u6807\u5c3a\u5bf8\u3002
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_stylesheet","title":"set_stylesheet(stylesheet: Optional[str]) -> None
","text":"\u4e3a\u7a97\u53e3\u8bbe\u7f6e\u6837\u5f0f\u8868\uff08QSS\uff09\u683c\u5f0f\u3002
Parameters:
Name Type Description Default stylesheet
Optional[str]
\u6837\u5f0f\u8868
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_title","title":"set_title(title: str) -> None
","text":"\u8bbe\u7f6e\u7a97\u53e3\u6807\u9898\u3002
Parameters:
Name Type Description Default title
str
\u5f85\u8bbe\u7f6e\u7684\u6807\u9898
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.show_toast","title":"show_toast(message: str, duration: int = 2000, config: Optional[ToastConfig] = None, clear: bool = False) -> None
","text":"\u663e\u793a\u4e00\u6761toast\u6d88\u606f\u3002
Parameters:
Name Type Description Default message
str
\u5f85\u663e\u793a\u7684\u6d88\u606f
required duration
int
\u6d88\u606f\u663e\u793a\u7684\u65f6\u957f\uff0c\u5355\u4f4d\u6beb\u79d2
2000
config
Optional[ToastConfig]
toast\u7684\u914d\u7f6e
None
clear
bool
\u5728\u663e\u793a\u5f53\u524d\u6d88\u606f\u524d\uff0c\u662f\u5426\u6e05\u9664\u4e4b\u524d\u53d1\u51fa\u7684\u6d88\u606f
False
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.toggle_action_state","title":"toggle_action_state(action: Action) -> Optional[bool]
","text":"\u5207\u6362\u76ee\u6807Action
\u7684\u5f53\u524d\u72b6\u6001\u3002
Parameters:
Name Type Description Default action
Action
\u76ee\u6807Action
required Returns:
Type Description Optional[bool]
\u8fd4\u56de\u5207\u6362\u4e4b\u524d\u7684\u72b6\u6001\u3002\u82e5\u672a\u627e\u5230\u76ee\u6807Action
\uff0c\u5219\u8fd4\u56deNone
\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/","title":"pyguiadapter.windows.fnexec","text":""},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig","title":"FnExecuteWindowConfig
dataclass
","text":" Bases: BaseWindowConfig
Source code in pyguiadapter\\windows\\fnexec\\_base.py
@dataclasses.dataclass(frozen=True)\nclass FnExecuteWindowConfig(BaseWindowConfig):\n title: Optional[str] = None\n \"\"\"\u7a97\u53e3\u6807\u9898\u3002\"\"\"\n\n size: Union[Tuple[int, int], QSize] = (800, 600)\n \"\"\"\u7a97\u53e3\u5927\u5c0f\u3002\"\"\"\n\n execute_button_text: str = \"Execute\"\n \"\"\"\u6267\u884c\u6309\u94ae\u6587\u672c\u3002\"\"\"\n\n cancel_button_text: str = \"Cancel\"\n \"\"\"\u53d6\u6d88\u6309\u94ae\u6587\u672c\u3002\"\"\"\n\n clear_button_text: str = \"Clear\"\n \"\"\"\u6e05\u9664\u6309\u94ae\u6587\u672c\u3002\"\"\"\n\n clear_button_visible: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae\u3002\"\"\"\n\n clear_checkbox_text: str = \"clear output\"\n \"\"\"\u6e05\u9664\u9009\u9879\u6846\u6587\u672c\u3002\"\"\"\n\n clear_checkbox_visible: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u6e05\u9664\u9009\u9879\u6846\u3002\"\"\"\n\n clear_checkbox_checked: bool = True\n \"\"\"\u662f\u5426\u5c06\u6e05\u9664\u9009\u9879\u6846\u8bbe\u7f6e\u4e3a\u9009\u4e2d\u72b6\u6001\u3002\"\"\"\n\n statusbar_visible: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u7a97\u53e3\u72b6\u6001\u680f\"\"\"\n\n initial_docks_state: Literal[\"auto\", \"tabified\"] = \"auto\"\n \"\"\"\u505c\u9760\u7a97\u53e3\u7684\u521d\u59cb\u72b6\u6001\u3002\u53ef\u9009`auto`\u6216`tabified`\u3002\u5f53\u6307\u5b9a\u4e3a`tabified`\u65f6\uff0c\u505c\u9760\u7a97\u53e3\u5c06\u7ec4\u5408\u6210\u4e00\u4e2a`Tab`\u7ec4\u4ef6\uff0c\u6bcf\u4e2a\u505c\u9760\u7a97\u53e3\u90fd\u5c06\u4ee5`Tab\u9875`\u7684\u5f62\u5f0f\u51fa\u73b0\u3002\"\"\"\n\n output_dock_visible: bool = True\n \"\"\"\u662f\u5426\u663e\u793a`Output\u505c\u9760\u7a97\u53e3`\u3002\"\"\"\n\n output_dock_title: str = \"Output\"\n \"\"\"`Output\u505c\u9760\u7a97\u53e3`\u7684\u6807\u9898\u3002\"\"\"\n\n output_dock_floating: bool = False\n \"\"\"\u662f\u5426\u4f7f`Output\u505c\u9760\u7a97\u53e3`\u5904\u4e8e\u60ac\u6d6e\u72b6\u6001\u3002\"\"\"\n\n output_dock_initial_area: DockWidgetArea = BottomDockWidgetArea\n \"\"\"`Output\u505c\u9760\u7a97\u53e3`\u7684\u521d\u59cb\u505c\u9760\u533a\u57df\u3002\"\"\"\n\n output_dock_initial_size: Tuple[\n Union[int, float, None], Union[int, float, None]\n ] = (None, 0.25)\n \"\"\"`Output\u505c\u9760\u7a97\u53e3`\u7684\u521d\u59cb\u5927\u5c0f\uff0c\u683c\u5f0f\u4e3a`(width, height)`\uff0c\u53ef\u4ee5\u53ea\u8bbe\u7f6e\u5176\u4e2d\u4e00\u4e2a\u7ef4\u5ea6\uff0c\u53e6\u4e00\u4e2a\u4e0d\u9700\u8981\u8bbe\u7f6e\u7684\u7ef4\u5ea6\u7f6e\u4e3a`None`\u5373\u53ef\u3002\n width\u548cheight\u53ef\u4ee5\u4e3a`int`\u6216`float`, \u4e3a`int`\u65f6\u4ee3\u8868width\u6216height\u7684\u7edd\u5bf9\u503c\uff0c\u4e3a`float`\u65f6\u4ee3\u8868\u76f8\u5bf9\u4e8e\u7a97\u53e3\u5927\u5c0f\u7684\u767e\u5206\u6bd4\u3002\n \"\"\"\n\n document_dock_visible: bool = True\n \"\"\"\u662f\u5426\u663e\u793a`Document\u505c\u9760\u7a97\u53e3`\u3002\"\"\"\n\n document_dock_title: str = \"Document\"\n \"\"\"`Document\u505c\u9760\u7a97\u53e3`\u7684\u6807\u9898\u3002\"\"\"\n\n document_dock_floating: bool = False\n \"\"\"\u662f\u5426\u4f7f`Document\u505c\u9760\u7a97\u53e3`\u5904\u4e8e\u60ac\u6d6e\u72b6\u6001\u3002\"\"\"\n\n document_dock_initial_area: DockWidgetArea = RightDockWidgetArea\n \"\"\"`Document\u505c\u9760\u7a97\u53e3`\u7684\u521d\u59cb\u505c\u9760\u533a\u57df\u3002\"\"\"\n\n document_dock_initial_size: Tuple[\n Union[int, float, None], Union[int, float, None]\n ] = (0.56, None)\n \"\"\"`Document\u505c\u9760\u7a97\u53e3`\u7684\u521d\u59cb\u5927\u5c0f\uff0c\u683c\u5f0f\u4e3a`(width, height)`\uff0c\u53ef\u4ee5\u53ea\u8bbe\u7f6e\u5176\u4e2d\u4e00\u4e2a\u7ef4\u5ea6\uff0c\u53e6\u4e00\u4e2a\u4e0d\u9700\u8981\u8bbe\u7f6e\u7684\u7ef4\u5ea6\u7f6e\u4e3a`None`\u5373\u53ef\u3002\n width\u548cheight\u53ef\u4ee5\u4e3a`int`\u6216`float`, \u4e3a`int`\u65f6\u4ee3\u8868width\u6216height\u7684\u7edd\u5bf9\u503c\uff0c\u4e3a`float`\u65f6\u4ee3\u8868\u76f8\u5bf9\u4e8e\u7a97\u53e3\u5927\u5c0f\u7684\u767e\u5206\u6bd4\u3002\n \"\"\"\n\n output_browser_config: Optional[OutputBrowserConfig] = dataclasses.field(\n default_factory=OutputBrowserConfig\n )\n \"\"\"`\u8f93\u51fa\u6d4f\u89c8\u5668`\u7684\u914d\u7f6e\u3002\"\"\"\n\n document_browser_config: Optional[DocumentBrowserConfig] = dataclasses.field(\n default_factory=DocumentBrowserConfig\n )\n \"\"\"`\u6587\u6863\u6d4f\u89c8\u5668`\u7684\u914d\u7f6e\u3002\"\"\"\n\n default_parameter_group_name: str = \"Main Parameters\"\n \"\"\"\u9ed8\u8ba4\u51fd\u6570\u53c2\u6570\u5206\u7ec4\u7684\u540d\u79f0\u3002\"\"\"\n\n default_parameter_group_icon: IconType = None\n \"\"\"\u9ed8\u8ba4\u51fd\u6570\u53c2\u6570\u5206\u7ec4\u7684\u56fe\u6807\u3002\"\"\"\n\n parameter_group_icons: Dict[str, IconType] = dataclasses.field(default_factory=dict)\n \"\"\"\u9664\u9ed8\u8ba4\u51fd\u6570\u53c2\u6570\u5206\u7ec4\u5916\u5176\u4ed6\u51fd\u6570\u53c2\u6570\u5206\u7ec4\u7684\u56fe\u6807\"\"\"\n\n disable_widgets_on_execute: bool = False\n \"\"\"\u662f\u5426\u5728\u51fd\u6570\u6267\u884c\u671f\u95f4\u4f7f\u53c2\u6570\u63a7\u4ef6\u5904\u4e8e\u4e0d\u53ef\u8f93\u5165\u72b6\u6001\u3002\"\"\"\n\n print_function_result: bool = True\n \"\"\"\u662f\u5426\u5728`\u8f93\u51fa\u6d4f\u89c8\u5668`\u4e2d\u6253\u5370\u51fd\u6570\u8c03\u7528\u7ed3\u679c\u3002\"\"\"\n\n show_function_result: bool = False\n \"\"\"\u662f\u5426\u5f39\u7a97\u663e\u793a\u51fd\u6570\u8c03\u7528\u7ed3\u679c\u3002\"\"\"\n\n print_function_error: bool = True\n \"\"\"\u662f\u5426\u5728`\u8f93\u51fa\u6d4f\u89c8\u5668`\u4e2d\u6253\u5370\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u53d1\u751f\u7684\u5f02\u5e38\u548c\u9519\u8bef\u3002\"\"\"\n\n show_function_error: bool = True\n \"\"\"\u662f\u5426\u5f39\u7a97\u663e\u793a\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u53d1\u751f\u7684\u5f02\u5e38\u548c\u9519\u8bef\u3002\"\"\"\n\n function_error_traceback: bool = True\n \"\"\"\u5728\u6253\u5370\u6216\u5f39\u7a97\u663e\u793a\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u53d1\u751f\u7684\u5f02\u5e38\u65f6\uff0c\u662f\u5426\u663e\u793a\u5f02\u5e38\u7684\u56de\u6eaf\u4fe1\u606f\u3002\"\"\"\n\n error_dialog_title: str = \"Error\"\n \"\"\"\u9519\u8bef\u4fe1\u606f\u5f39\u7a97\u7684\u6807\u9898\u3002\"\"\"\n\n result_dialog_title: str = \"Result\"\n \"\"\"\u51fd\u6570\u8c03\u7528\u7ed3\u679c\u5f39\u7a97\u7684\u6807\u9898\u3002\"\"\"\n\n parameter_error_message: str = \"{}: {}\"\n \"\"\"`ParameterError`\u7c7b\u578b\u5f02\u5e38\u7684\u6d88\u606f\u6a21\u677f\uff0c\u6a21\u677f\u7b2c\u4e00\u4e2a\u53d8\u91cf\uff08`{}`\uff09\u4e3a`\u53c2\u6570\u540d\u79f0`\uff0c\u7b2c\u4e8c\u4e2a\u53d8\u91cf(`{}`)\u4e3a`\u5f02\u5e38\u7684\u6d88\u606f\uff08message\uff09`\u3002\"\"\"\n\n function_result_message: str = \"function result: {}\\n\"\n \"\"\"\u51fd\u6570\u8c03\u7528\u7ed3\u679c\u7684\u6d88\u606f\u6a21\u677f\uff0c\u6a21\u677f\u53d8\u91cf\uff08`{}`\uff09\u4e3a\u51fd\u6570\u7684\u8fd4\u56de\u503c\u3002\"\"\"\n\n function_error_message: str = \"{}: {}\\n\"\n \"\"\"\u51fd\u6570\u5f02\u5e38\u6216\u9519\u8bef\u7684\u6d88\u606f\u6a21\u677f\uff0c\u6a21\u677f\u7b2c\u4e00\u4e2a\u53d8\u91cf\uff08`{}`\uff09\u4e3a`\u5f02\u5e38\u7684\u7c7b\u578b`\uff0c\u7b2c\u4e8c\u4e2a\u53d8\u91cf(`{}`)\u4e3a`\u5f02\u5e38\u7684\u6d88\u606f\uff08message\uff09`\u3002\"\"\"\n\n function_executing_message: str = \"A function is executing now!\"\n \"\"\"\u63d0\u793a\u6d88\u606f\uff0c\u7528\u4ee5\u63d0\u793a\u201c\u51fd\u6570\u6b63\u5728\u6267\u884c\u201d\u3002\"\"\"\n\n uncancelable_function_message: str = \"The function is not cancelable!\"\n \"\"\"\u63d0\u793a\u6d88\u606f\uff0c\u7528\u4ee5\u63d0\u793a\u201c\u5f53\u524d\u51fd\u6570\u4e3a\u4e0d\u53ef\u53d6\u6d88\u7684\u51fd\u6570\u201d\u3002\"\"\"\n\n function_not_executing_message: str = \"No function is executing now!\"\n \"\"\"\u63d0\u793a\u6d88\u606f\uff0c\u7528\u4ee5\u63d0\u793a\u201c\u5f53\u524d\u51fd\u6570\u672a\u5904\u4e8e\u6267\u884c\u72b6\u6001\u201d\u3002\"\"\"\n
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.cancel_button_text","title":"cancel_button_text: str = 'Cancel'
class-attribute
instance-attribute
","text":"\u53d6\u6d88\u6309\u94ae\u6587\u672c\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.clear_button_text","title":"clear_button_text: str = 'Clear'
class-attribute
instance-attribute
","text":"\u6e05\u9664\u6309\u94ae\u6587\u672c\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.clear_button_visible","title":"clear_button_visible: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.clear_checkbox_checked","title":"clear_checkbox_checked: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u6e05\u9664\u9009\u9879\u6846\u8bbe\u7f6e\u4e3a\u9009\u4e2d\u72b6\u6001\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.clear_checkbox_text","title":"clear_checkbox_text: str = 'clear output'
class-attribute
instance-attribute
","text":"\u6e05\u9664\u9009\u9879\u6846\u6587\u672c\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.clear_checkbox_visible","title":"clear_checkbox_visible: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u9664\u9009\u9879\u6846\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.default_parameter_group_icon","title":"default_parameter_group_icon: IconType = None
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u51fd\u6570\u53c2\u6570\u5206\u7ec4\u7684\u56fe\u6807\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.default_parameter_group_name","title":"default_parameter_group_name: str = 'Main Parameters'
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u51fd\u6570\u53c2\u6570\u5206\u7ec4\u7684\u540d\u79f0\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.disable_widgets_on_execute","title":"disable_widgets_on_execute: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5728\u51fd\u6570\u6267\u884c\u671f\u95f4\u4f7f\u53c2\u6570\u63a7\u4ef6\u5904\u4e8e\u4e0d\u53ef\u8f93\u5165\u72b6\u6001\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.document_browser_config","title":"document_browser_config: Optional[DocumentBrowserConfig] = dataclasses.field(default_factory=DocumentBrowserConfig)
class-attribute
instance-attribute
","text":"\u6587\u6863\u6d4f\u89c8\u5668
\u7684\u914d\u7f6e\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.document_dock_floating","title":"document_dock_floating: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7fDocument\u505c\u9760\u7a97\u53e3
\u5904\u4e8e\u60ac\u6d6e\u72b6\u6001\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.document_dock_initial_area","title":"document_dock_initial_area: DockWidgetArea = RightDockWidgetArea
class-attribute
instance-attribute
","text":"Document\u505c\u9760\u7a97\u53e3
\u7684\u521d\u59cb\u505c\u9760\u533a\u57df\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.document_dock_initial_size","title":"document_dock_initial_size: Tuple[Union[int, float, None], Union[int, float, None]] = (0.56, None)
class-attribute
instance-attribute
","text":"Document\u505c\u9760\u7a97\u53e3
\u7684\u521d\u59cb\u5927\u5c0f\uff0c\u683c\u5f0f\u4e3a(width, height)
\uff0c\u53ef\u4ee5\u53ea\u8bbe\u7f6e\u5176\u4e2d\u4e00\u4e2a\u7ef4\u5ea6\uff0c\u53e6\u4e00\u4e2a\u4e0d\u9700\u8981\u8bbe\u7f6e\u7684\u7ef4\u5ea6\u7f6e\u4e3aNone
\u5373\u53ef\u3002 width\u548cheight\u53ef\u4ee5\u4e3aint
\u6216float
, \u4e3aint
\u65f6\u4ee3\u8868width\u6216height\u7684\u7edd\u5bf9\u503c\uff0c\u4e3afloat
\u65f6\u4ee3\u8868\u76f8\u5bf9\u4e8e\u7a97\u53e3\u5927\u5c0f\u7684\u767e\u5206\u6bd4\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.document_dock_title","title":"document_dock_title: str = 'Document'
class-attribute
instance-attribute
","text":"Document\u505c\u9760\u7a97\u53e3
\u7684\u6807\u9898\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.document_dock_visible","title":"document_dock_visible: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793aDocument\u505c\u9760\u7a97\u53e3
\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.error_dialog_title","title":"error_dialog_title: str = 'Error'
class-attribute
instance-attribute
","text":"\u9519\u8bef\u4fe1\u606f\u5f39\u7a97\u7684\u6807\u9898\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.execute_button_text","title":"execute_button_text: str = 'Execute'
class-attribute
instance-attribute
","text":"\u6267\u884c\u6309\u94ae\u6587\u672c\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.function_error_message","title":"function_error_message: str = '{}: {}\\n'
class-attribute
instance-attribute
","text":"\u51fd\u6570\u5f02\u5e38\u6216\u9519\u8bef\u7684\u6d88\u606f\u6a21\u677f\uff0c\u6a21\u677f\u7b2c\u4e00\u4e2a\u53d8\u91cf\uff08{}
\uff09\u4e3a\u5f02\u5e38\u7684\u7c7b\u578b
\uff0c\u7b2c\u4e8c\u4e2a\u53d8\u91cf({}
)\u4e3a\u5f02\u5e38\u7684\u6d88\u606f\uff08message\uff09
\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.function_error_traceback","title":"function_error_traceback: bool = True
class-attribute
instance-attribute
","text":"\u5728\u6253\u5370\u6216\u5f39\u7a97\u663e\u793a\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u53d1\u751f\u7684\u5f02\u5e38\u65f6\uff0c\u662f\u5426\u663e\u793a\u5f02\u5e38\u7684\u56de\u6eaf\u4fe1\u606f\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.function_executing_message","title":"function_executing_message: str = 'A function is executing now!'
class-attribute
instance-attribute
","text":"\u63d0\u793a\u6d88\u606f\uff0c\u7528\u4ee5\u63d0\u793a\u201c\u51fd\u6570\u6b63\u5728\u6267\u884c\u201d\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.function_not_executing_message","title":"function_not_executing_message: str = 'No function is executing now!'
class-attribute
instance-attribute
","text":"\u63d0\u793a\u6d88\u606f\uff0c\u7528\u4ee5\u63d0\u793a\u201c\u5f53\u524d\u51fd\u6570\u672a\u5904\u4e8e\u6267\u884c\u72b6\u6001\u201d\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.function_result_message","title":"function_result_message: str = 'function result: {}\\n'
class-attribute
instance-attribute
","text":"\u51fd\u6570\u8c03\u7528\u7ed3\u679c\u7684\u6d88\u606f\u6a21\u677f\uff0c\u6a21\u677f\u53d8\u91cf\uff08{}
\uff09\u4e3a\u51fd\u6570\u7684\u8fd4\u56de\u503c\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.initial_docks_state","title":"initial_docks_state: Literal['auto', 'tabified'] = 'auto'
class-attribute
instance-attribute
","text":"\u505c\u9760\u7a97\u53e3\u7684\u521d\u59cb\u72b6\u6001\u3002\u53ef\u9009auto
\u6216tabified
\u3002\u5f53\u6307\u5b9a\u4e3atabified
\u65f6\uff0c\u505c\u9760\u7a97\u53e3\u5c06\u7ec4\u5408\u6210\u4e00\u4e2aTab
\u7ec4\u4ef6\uff0c\u6bcf\u4e2a\u505c\u9760\u7a97\u53e3\u90fd\u5c06\u4ee5Tab\u9875
\u7684\u5f62\u5f0f\u51fa\u73b0\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.output_browser_config","title":"output_browser_config: Optional[OutputBrowserConfig] = dataclasses.field(default_factory=OutputBrowserConfig)
class-attribute
instance-attribute
","text":"\u8f93\u51fa\u6d4f\u89c8\u5668
\u7684\u914d\u7f6e\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.output_dock_floating","title":"output_dock_floating: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7fOutput\u505c\u9760\u7a97\u53e3
\u5904\u4e8e\u60ac\u6d6e\u72b6\u6001\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.output_dock_initial_area","title":"output_dock_initial_area: DockWidgetArea = BottomDockWidgetArea
class-attribute
instance-attribute
","text":"Output\u505c\u9760\u7a97\u53e3
\u7684\u521d\u59cb\u505c\u9760\u533a\u57df\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.output_dock_initial_size","title":"output_dock_initial_size: Tuple[Union[int, float, None], Union[int, float, None]] = (None, 0.25)
class-attribute
instance-attribute
","text":"Output\u505c\u9760\u7a97\u53e3
\u7684\u521d\u59cb\u5927\u5c0f\uff0c\u683c\u5f0f\u4e3a(width, height)
\uff0c\u53ef\u4ee5\u53ea\u8bbe\u7f6e\u5176\u4e2d\u4e00\u4e2a\u7ef4\u5ea6\uff0c\u53e6\u4e00\u4e2a\u4e0d\u9700\u8981\u8bbe\u7f6e\u7684\u7ef4\u5ea6\u7f6e\u4e3aNone
\u5373\u53ef\u3002 width\u548cheight\u53ef\u4ee5\u4e3aint
\u6216float
, \u4e3aint
\u65f6\u4ee3\u8868width\u6216height\u7684\u7edd\u5bf9\u503c\uff0c\u4e3afloat
\u65f6\u4ee3\u8868\u76f8\u5bf9\u4e8e\u7a97\u53e3\u5927\u5c0f\u7684\u767e\u5206\u6bd4\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.output_dock_title","title":"output_dock_title: str = 'Output'
class-attribute
instance-attribute
","text":"Output\u505c\u9760\u7a97\u53e3
\u7684\u6807\u9898\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.output_dock_visible","title":"output_dock_visible: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793aOutput\u505c\u9760\u7a97\u53e3
\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.parameter_error_message","title":"parameter_error_message: str = '{}: {}'
class-attribute
instance-attribute
","text":"ParameterError
\u7c7b\u578b\u5f02\u5e38\u7684\u6d88\u606f\u6a21\u677f\uff0c\u6a21\u677f\u7b2c\u4e00\u4e2a\u53d8\u91cf\uff08{}
\uff09\u4e3a\u53c2\u6570\u540d\u79f0
\uff0c\u7b2c\u4e8c\u4e2a\u53d8\u91cf({}
)\u4e3a\u5f02\u5e38\u7684\u6d88\u606f\uff08message\uff09
\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.parameter_group_icons","title":"parameter_group_icons: Dict[str, IconType] = dataclasses.field(default_factory=dict)
class-attribute
instance-attribute
","text":"\u9664\u9ed8\u8ba4\u51fd\u6570\u53c2\u6570\u5206\u7ec4\u5916\u5176\u4ed6\u51fd\u6570\u53c2\u6570\u5206\u7ec4\u7684\u56fe\u6807
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.print_function_error","title":"print_function_error: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5728\u8f93\u51fa\u6d4f\u89c8\u5668
\u4e2d\u6253\u5370\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u53d1\u751f\u7684\u5f02\u5e38\u548c\u9519\u8bef\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.print_function_result","title":"print_function_result: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5728\u8f93\u51fa\u6d4f\u89c8\u5668
\u4e2d\u6253\u5370\u51fd\u6570\u8c03\u7528\u7ed3\u679c\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.result_dialog_title","title":"result_dialog_title: str = 'Result'
class-attribute
instance-attribute
","text":"\u51fd\u6570\u8c03\u7528\u7ed3\u679c\u5f39\u7a97\u7684\u6807\u9898\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.show_function_error","title":"show_function_error: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f39\u7a97\u663e\u793a\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u53d1\u751f\u7684\u5f02\u5e38\u548c\u9519\u8bef\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.show_function_result","title":"show_function_result: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f39\u7a97\u663e\u793a\u51fd\u6570\u8c03\u7528\u7ed3\u679c\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.size","title":"size: Union[Tuple[int, int], QSize] = (800, 600)
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u5927\u5c0f\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.statusbar_visible","title":"statusbar_visible: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u7a97\u53e3\u72b6\u6001\u680f
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.title","title":"title: Optional[str] = None
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u6807\u9898\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.uncancelable_function_message","title":"uncancelable_function_message: str = 'The function is not cancelable!'
class-attribute
instance-attribute
","text":"\u63d0\u793a\u6d88\u606f\uff0c\u7528\u4ee5\u63d0\u793a\u201c\u5f53\u524d\u51fd\u6570\u4e3a\u4e0d\u53ef\u53d6\u6d88\u7684\u51fd\u6570\u201d\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.OutputBrowserConfig","title":"OutputBrowserConfig
dataclass
","text":" Bases: TextBrowserConfig
\u8f93\u51fa\u6d4f\u89c8\u5668\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\windows\\fnexec\\_output_area\\browser.py
@dataclasses.dataclass\nclass OutputBrowserConfig(TextBrowserConfig):\n \"\"\"\u8f93\u51fa\u6d4f\u89c8\u5668\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n text_color: str = COLOR_TERMINAL_TEXT_CLASSIC\n font_family: str = FONT_FAMILY\n background_color: str = COLOR_TERMINAL_BACKGROUND_CLASSIC\n
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowEventListener","title":"FnExecuteWindowEventListener
","text":" Bases: BaseWindowEventListener
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowEventListener.on_execute_error","title":"on_execute_error(window: BaseFnExecuteWindow, error: Exception) -> bool
","text":"\u5728\u51fd\u6570\u6267\u884c\u5931\u8d25\uff08\u51fd\u6570\u629b\u51fa\u5f02\u5e38\uff09\u65f6\u56de\u8c03\u3002
Parameters:
Name Type Description Default window
BaseFnExecuteWindow
\u5f53\u524d\u7a97\u53e3\u5b9e\u4f8b
required error
Exception
\u51fd\u6570\u629b\u51fa\u7684\u5f02\u5e38
required Returns:
Type Description bool
\u5982\u679c\u8fd4\u56deTrue
\uff0c\u5219\u5141\u8bb8PyGUIAdapter
\u6267\u884c\u9ed8\u8ba4\u7684\u540e\u7eed\u64cd\u4f5c\uff0c\u6bd4\u5982\u6253\u5370\u51fd\u6570\u5f02\u5e38\u6216\u5f39\u7a97\u663e\u793a\u51fd\u6570\u5f02\u5e38\u7b49\uff0c\u5426\u5219\u963b\u6b62\u6267\u884c\u9ed8\u8ba4\u64cd\u4f5c\u3002\u9ed8\u8ba4\u8fd4\u56deTrue
\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowEventListener.on_execute_finish","title":"on_execute_finish(window: BaseFnExecuteWindow) -> None
","text":"\u5728\u51fd\u6570\u6267\u884c\u7ed3\u675f\u65f6\u56de\u8c03\uff0c\u65e0\u8bba\u51fd\u6570\u6267\u884c\u662f\u5426\u6210\u529f\uff0c\u8be5\u56de\u8c03\u51fd\u6570\u90fd\u4f1a\u88ab\u8c03\u7528\u3002
Parameters:
Name Type Description Default window
BaseFnExecuteWindow
\u5f53\u524d\u7a97\u53e3\u5b9e\u4f8b
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowEventListener.on_execute_result","title":"on_execute_result(window: BaseFnExecuteWindow, result: Any) -> bool
","text":"\u5728\u51fd\u6570\u6267\u884c\u6210\u529f\uff08\u51fd\u6570\u8fd4\u56de\uff09\u65f6\u56de\u8c03\u3002
Parameters:
Name Type Description Default window
BaseFnExecuteWindow
\u5f53\u524d\u7a97\u53e3\u5b9e\u4f8b
required result
Any
\u51fd\u6570\u7684\u8fd4\u56de\u503c
required Returns:
Type Description bool
\u5982\u679c\u8fd4\u56deTrue
\uff0c\u5219\u5141\u8bb8PyGUIAdapter
\u6267\u884c\u9ed8\u8ba4\u7684\u540e\u7eed\u64cd\u4f5c\uff0c\u6bd4\u5982\u6253\u5370\u51fd\u6570\u7ed3\u679c\u6216\u5f39\u7a97\u663e\u793a\u51fd\u6570\u7ed3\u679c\u7b49\uff0c\u5426\u5219\u963b\u6b62\u6267\u884c\u9ed8\u8ba4\u64cd\u4f5c\u3002\u9ed8\u8ba4\u8fd4\u56deTrue
\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowEventListener.on_execute_start","title":"on_execute_start(window: BaseFnExecuteWindow) -> None
","text":"\u5728\u51fd\u6570\u6267\u884c\u5f00\u59cb\u65f6\u56de\u8c03\u3002
Parameters:
Name Type Description Default window
BaseFnExecuteWindow
\u5f53\u524d\u7a97\u53e3\u5b9e\u4f8b
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.SimpleFnExecuteWindowEventListener","title":"SimpleFnExecuteWindowEventListener
","text":" Bases: FnExecuteWindowEventListener
\u4e00\u4e2a\u7b80\u5355\u7684FnExecuteWindowEventListener
\u5b9e\u73b0\uff0c\u65b9\u4fbf\u4e0d\u559c\u6b22\u5b50\u7c7b\u5316\u65b9\u5f0f\u7684\u5f00\u53d1\u8005\u4f7f\u7528\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.SimpleFnExecuteWindowEventListener.__init__","title":"__init__(on_create: Callable[[BaseFnExecuteWindow], None] = None, on_show: Callable[[BaseFnExecuteWindow], None] = None, on_hide: Callable[[BaseFnExecuteWindow], None] = None, on_close: Callable[[BaseFnExecuteWindow], bool] = None, on_destroy: Callable[[BaseFnExecuteWindow], None] = None, on_execute_start: Callable[[BaseFnExecuteWindow], None] = None, on_execute_result: Callable[[BaseFnExecuteWindow, Any], bool] = None, on_execute_error: Callable[[BaseFnExecuteWindow, Exception], bool] = None, on_execute_finish: Callable[[BaseFnExecuteWindow], None] = None)
","text":"\u6784\u9020\u51fd\u6570\u3002
Parameters:
Name Type Description Default on_create
Callable[[BaseFnExecuteWindow], None]
on_create
\u56de\u8c03\u51fd\u6570
None
on_show
Callable[[BaseFnExecuteWindow], None]
on_show
\u56de\u8c03\u51fd\u6570
None
on_hide
Callable[[BaseFnExecuteWindow], None]
on_hide
\u56de\u8c03\u51fd\u6570
None
on_close
Callable[[BaseFnExecuteWindow], bool]
on_close
\u56de\u8c03\u51fd\u6570
None
on_destroy
Callable[[BaseFnExecuteWindow], None]
on_destroy
\u56de\u8c03\u51fd\u6570
None
on_execute_start
Callable[[BaseFnExecuteWindow], None]
on_execute_start
\u56de\u8c03\u51fd\u6570
None
on_execute_result
Callable[[BaseFnExecuteWindow, Any], bool]
on_execute_result
\u56de\u8c03\u51fd\u6570
None
on_execute_error
Callable[[BaseFnExecuteWindow, Exception], bool]
on_execute_error
\u56de\u8c03\u51fd\u6570
None
on_execute_finish
Callable[[BaseFnExecuteWindow], None]
on_execute_finish
\u56de\u8c03\u51fd\u6570
None
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow","title":"FnExecuteWindow
","text":" Bases: BaseFnExecuteWindow
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.activate_parameter_group","title":"activate_parameter_group(group_name: str) -> None
","text":"\u6fc0\u6d3b\u5c55\u5f00\u6307\u5b9a\u53c2\u6570\u5206\u7ec4\u3002
Parameters:
Name Type Description Default group_name
str
\u53c2\u6570\u5206\u7ec4\u540d\u79f0
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.add_parameter","title":"add_parameter(parameter_name: str, config: Tuple[Type[BaseParameterWidget], BaseParameterWidgetConfig]) -> None
","text":"\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u51fd\u6570\u53c2\u6570
Parameters:
Name Type Description Default parameter_name
str
\u8981\u589e\u52a0\u7684\u51fd\u6570\u53c2\u6570\u540d\u79f0
required config
Tuple[Type[BaseParameterWidget], BaseParameterWidgetConfig]
\u51fd\u6570\u53c2\u6570\u914d\u7f6e\uff0c\u683c\u5f0f\u4e3a: (\u53c2\u6570\u63a7\u4ef6\u7c7b, \u53c2\u6570\u63a7\u4ef6\u914d\u7f6e\u7c7b\u5b9e\u4f8b)
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Raises:
Type Description ParameterError
\u5f53\u53c2\u6570\u4e3a\u7a7a\u3001\u53c2\u6570\u540d\u79f0\u91cd\u590d\u65f6\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.add_parameters","title":"add_parameters(configs: Dict[str, Tuple[Type[BaseParameterWidget], BaseParameterWidgetConfig]]) -> None
","text":"\u589e\u52a0\u4e00\u7ec4\u65b0\u7684\u51fd\u6570\u53c2\u6570
Parameters:
Name Type Description Default configs
Dict[str, Tuple[Type[BaseParameterWidget], BaseParameterWidgetConfig]]
\u8981\u589e\u52a0\u7684\u51fd\u6570\u53c2\u6570\u540d\u79f0\u53ca\u5176\u914d\u7f6e
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Raises:
Type Description ParameterError
\u5f53\u53c2\u6570\u4e3a\u7a7a\u3001\u53c2\u6570\u540d\u79f0\u91cd\u590d\u65f6\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.append_output","title":"append_output(text: str, html: bool = False, scroll_to_bottom: bool = True) -> None
","text":"\u628a\u6587\u672c\u8ffd\u52a0\u5230\u8f93\u51fa\u6d4f\u89c8\u5668\u4e2d
Parameters:
Name Type Description Default text
str
\u5e26\u8f93\u51fa\u7684\u6587\u672c
required html
bool
\u662f\u5426\u4e3ahtml\u683c\u5f0f
False
scroll_to_bottom
bool
\u5b8c\u6210\u540e\u662f\u5426\u5c06\u8f93\u51fa\u6d4f\u89c8\u5668\u6eda\u52a8\u5230\u5e95\u90e8
True
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.clear_output","title":"clear_output() -> None
","text":"\u6e05\u9664\u8f93\u51fa\u6d4f\u89c8\u5668\u5185\u5bb9
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.clear_parameters","title":"clear_parameters() -> None
","text":"\u6e05\u9664\u6240\u6709\u53c2\u6570
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.clear_statusbar_message","title":"clear_statusbar_message() -> None
","text":"\u6e05\u9664\u72b6\u6001\u680f\u6d88\u606f
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.disable_parameter_widgets","title":"disable_parameter_widgets(disabled: bool) -> None
","text":"\u8bbe\u7f6e\u53c2\u6570\u63a7\u4ef6\u7981\u7528/\u542f\u7528\u72b6\u6001
Parameters:
Name Type Description Default disabled
bool
\u662f\u5426\u7981\u7528
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_document_dock_area","title":"get_document_dock_area() -> DockWidgetArea
","text":"\u83b7\u53d6Document Dock\u505c\u9760\u533a\u57df
Returns:
Type Description DockWidgetArea
\u8fd4\u56de\u5f53\u524d\u505c\u9760\u533a\u57df
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_document_dock_size","title":"get_document_dock_size() -> Tuple[int, int]
","text":"\u83b7\u53d6Document Dock\u5c3a\u5bf8
Returns:
Type Description Tuple[int, int]
\u8fd4\u56de\u5f53\u524d\u5c3a\u5bf8
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_document_dock_title","title":"get_document_dock_title() -> str
","text":"\u83b7\u53d6Document Dock\u6807\u9898
Returns:
Type Description str
\u8fd4\u56de\u5f53\u524d\u6807\u9898
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_output_dock_area","title":"get_output_dock_area() -> DockWidgetArea
","text":"\u83b7\u53d6Output Dock\u505c\u9760\u533a\u57df
Returns:
Type Description DockWidgetArea
\u8fd4\u56de\u5f53\u524d\u505c\u9760\u533a\u57df
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_output_dock_size","title":"get_output_dock_size() -> Tuple[int, int]
","text":"\u83b7\u53d6Output Dock\u5c3a\u5bf8
Returns:
Type Description Tuple[int, int]
\u8fd4\u56de\u5f53\u524d\u5c3a\u5bf8
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_output_dock_title","title":"get_output_dock_title() -> str
","text":"\u83b7\u53d6Output Dock\u6807\u9898
Returns:
Type Description str
\u8fd4\u56de\u5f53\u524d\u6807\u9898
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_parameter_names","title":"get_parameter_names() -> List[str]
","text":"\u83b7\u53d6\u6240\u6709\u53c2\u6570\u540d\u79f0
Returns:
Type Description List[str]
\u8fd4\u56de\u5f53\u524d\u6240\u6709\u53c2\u6570\u540d\u79f0
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_parameter_names_of","title":"get_parameter_names_of(group_name: str) -> List[str]
","text":"\u83b7\u53d6\u6307\u5b9a\u5206\u7ec4\u4e0b\u7684\u6240\u6709\u53c2\u6570\u540d\u79f0
Parameters:
Name Type Description Default group_name
str
\u5206\u7ec4\u540d\u79f0
required Returns:
Type Description List[str]
\u8fd4\u56de\u6307\u5b9a\u5206\u7ec4\u4e0b\u7684\u6240\u6709\u53c2\u6570\u540d\u79f0
Raises:
Type Description ParameterNotFoundError
\u5f53\u6307\u5b9a\u5206\u7ec4\u4e0d\u5b58\u5728\u65f6\uff0c\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_parameter_value","title":"get_parameter_value(parameter_name: str) -> Any
","text":"\u83b7\u53d6\u6307\u5b9a\u53c2\u6570\u5f53\u524d\u503c
Parameters:
Name Type Description Default parameter_name
str
\u53c2\u6570\u540d\u79f0
required Returns:
Type Description Any
\u8fd4\u56de\u5f53\u524d\u503c
Raises:
Type Description ParameterNotFoundError
\u6307\u5b9a\u53c2\u6570\u4e0d\u5b58\u5728\u65f6\uff0c\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
ParameterError
\u65e0\u6cd5\u4ece\u5bf9\u5e94\u63a7\u4ef6\u83b7\u53d6\u5f53\u524d\u503c\u65f6\uff0c\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_parameter_values","title":"get_parameter_values() -> Dict[str, Any]
","text":"\u83b7\u53d6\u6240\u6709\u53c2\u6570\u7684\u5f53\u524d\u503c
Returns:
Type Description Dict[str, Any]
\u4ee5\u5b57\u5178\u5f62\u5f0f\u8fd4\u56de\u5f53\u524d\u6240\u6709\u53c2\u6570\u7684\u503c
Raises:
Type Description ParameterError
\u65e0\u6cd5\u4ece\u5bf9\u5e94\u63a7\u4ef6\u83b7\u53d6\u67d0\u4e2a\u53c2\u6570\u7684\u5f53\u524d\u503c\u65f6\uff0c\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_parameter_values_of","title":"get_parameter_values_of(group_name: str) -> Dict[str, Any]
","text":"\u83b7\u53d6\u6307\u5b9a\u5206\u7ec4\u4e0b\u6240\u6709\u53c2\u6570\u5f53\u524d\u503c
Parameters:
Name Type Description Default group_name
str
\u6307\u5b9a\u5206\u7ec4\u7684\u540d\u79f0
required Returns:
Type Description Dict[str, Any]
\u8fd4\u56de\u6307\u5b9a\u5206\u7ec4\u4e0b\u6240\u6709\u53c2\u6570\u7684\u540d\u79f0\u548c\u503c
Raises:
Type Description ParameterNotFoundError
\u5f53\u6307\u5b9a\u5206\u7ec4\u4e0d\u5b58\u5728\u65f6\uff0c\u5f15\u53d1\u6b64\u5f02\u5e38
ParameterError
\u65e0\u6cd5\u4ece\u5bf9\u5e94\u63a7\u4ef6\u83b7\u53d6\u67d0\u4e2a\u53c2\u6570\u7684\u5f53\u524d\u503c\u65f6\uff0c\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.has_parameter","title":"has_parameter(parameter_name: str) -> bool
","text":"\u5224\u65ad\u662f\u5426\u5b58\u5728\u6307\u5b9a\u53c2\u6570\u540d\u79f0
Parameters:
Name Type Description Default parameter_name
str
\u5e26\u5224\u65ad\u7684\u53c2\u6570\u540d\u79f0
required Returns:
Type Description bool
\u5b58\u5728\u6307\u5b9a\u53c2\u6570\u65f6\u8fd4\u56deTrue
\uff0c\u5426\u5219\u8fd4\u56deFalse
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.hide_progressbar","title":"hide_progressbar() -> None
","text":"\u9690\u85cf\u8fdb\u5ea6\u6761
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.is_clear_checkbox_checked","title":"is_clear_checkbox_checked() -> bool
","text":"\u68c0\u67e5\u6e05\u9664\u9009\u9879\u6846\u662f\u5426\u9009\u4e2d
Returns:
Type Description bool
\u8fd4\u56de\u5f53\u524d\u72b6\u6001
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.is_document_dock_floating","title":"is_document_dock_floating() -> bool
","text":"\u68c0\u67e5Document Dock\u662f\u5426\u60ac\u6d6e
Returns:
Type Description bool
\u8fd4\u56de\u5f53\u524d\u60ac\u6d6e\u72b6\u6001
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.is_document_dock_visible","title":"is_document_dock_visible() -> bool
","text":"\u68c0\u67e5Document Dock\u662f\u5426\u663e\u793a
Returns:
Type Description bool
\u8fd4\u56de\u5f53\u524d\u663e\u793a\u72b6\u6001
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.is_function_cancelable","title":"is_function_cancelable() -> bool
","text":"\u68c0\u67e5\u51fd\u6570\u662f\u5426\u4e3a\u53ef\u53d6\u6d88\u51fd\u6570
Returns:
Type Description bool
\u8fd4\u56de\u51fd\u6570\u662f\u5426\u53ef\u53d6\u6d88
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.is_function_executing","title":"is_function_executing() -> bool
","text":"\u68c0\u67e5\u51fd\u6570\u662f\u5426\u6b63\u5728\u8fd0\u884c
Returns:
Type Description bool
\u8fd4\u56de\u51fd\u6570\u8fd0\u884c\u72b6\u6001
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.is_output_dock_floating","title":"is_output_dock_floating() -> bool
","text":"\u68c0\u67e5Output Dock\u662f\u5426\u60ac\u6d6e
Returns:
Type Description bool
\u8fd4\u56de\u5f53\u524d\u60ac\u6d6e\u72b6\u6001
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.is_output_dock_visible","title":"is_output_dock_visible() -> bool
","text":"\u68c0\u67e5Output Dock\u662f\u5426\u663e\u793a
Returns:
Type Description bool
\u8fd4\u56de\u5f53\u524d\u663e\u793a\u72b6\u6001
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.is_statusbar_visible","title":"is_statusbar_visible() -> bool
","text":"\u68c0\u67e5\u7a97\u53e3\u72b6\u6001\u680f\u662f\u5426\u53ef\u89c1
Returns:
Type Description bool
\u8fd4\u56de\u72b6\u6001\u680f\u5f53\u524d\u72b6\u6001
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.process_parameter_error","title":"process_parameter_error(e: ParameterError) -> None
","text":"\u4f7f\u7528\u5185\u7f6e\u903b\u8f91\u5904\u7406ParameterError\u7c7b\u578b\u7684\u5f02\u5e38
Parameters:
Name Type Description Default e
ParameterError
\u5f02\u5e38\u5bf9\u8c61
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.remove_parameter","title":"remove_parameter(parameter_name: str, ignore_unknown_parameter: bool = True) -> None
","text":"\u79fb\u9664\u6307\u5b9a\u53c2\u6570\u63a7\u4ef6
Parameters:
Name Type Description Default parameter_name
str
\u8981\u79fb\u9664\u7684\u6307\u5b9a\u53c2\u6570\u540d\u79f0
required ignore_unknown_parameter
bool
\u662f\u5426\u5ffd\u7565\u672a\u77e5\u53c2\u6570
True
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Raises:
Type Description ParameterNotFoundError
\u5f53\u53c2\u6570parameter_name
\u4e0d\u5b58\u5728\u4e14ignore_unknown_parameter
\u4e3aFalse
\u65f6\uff0c\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.resize_document_dock","title":"resize_document_dock(size: Tuple[Union[int, float, None], Union[int, float, None]]) -> None
","text":"\u8c03\u6574Document Dock\u5c3a\u5bf8
\u6ce8\u610f\uff1a\u505c\u9760\u7a97\u53e3\u7684\u5c3a\u5bf8\u53d7\u5230\u591a\u79cd\u56e0\u7d20\u7684\u5f71\u54cd\uff0c\u65e0\u6cd5\u4fdd\u8bc1\u5b9e\u9645\u7684\u5c3a\u5bf8\u4e0e\u5f00\u53d1\u8005\u8bbe\u7f6e\u7684\u5c3a\u5bf8\u4fdd\u6301\u4e00\u81f4\uff0c\u5c24\u5176\u65f6\u591a\u4e2a\u505c\u9760\u7a97\u53e3\u505c\u9760\u5728\u540c\u4e00\u533a\u57df\u65f6\u5177\u4f53\u800c\u8a00\uff1a
- \u5c3a\u5bf8\u7684\u8c03\u6574\u53d7\u6700\u5c0f\u548c\u6700\u5927\u5c3a\u5bf8\u7684\u7ea6\u675f\uff1b
- \u5c3a\u5bf8\u8c03\u6574\u4e0d\u4f1a\u5f71\u54cd\u4e3b\u7a97\u53e3\u7684\u5927\u5c0f\uff1b
- \u5728\u7a7a\u95f4\u6709\u9650\u7684\u60c5\u51b5\u4e0b\uff0c\u5c06\u6839\u636e\u5404\u4e2a\u505c\u9760\u7a97\u53e3\u7684\u76f8\u5bf9\u5927\u5c0f\u5360\u6bd4\u8fdb\u884c\u53ef\u4ee5\u5229\u7528\u7a7a\u95f4\u7684\u8c03\u6574
Parameters:
Name Type Description Default size
Tuple[Union[int, float, None], Union[int, float, None]]
\u76ee\u6807\u5c3a\u5bf8\u3002\u683c\u5f0f\u4e3a(width, height)
\uff0c\u53ef\u4ee5\u53ea\u8bbe\u7f6e\u5176\u4e2d\u4e00\u4e2a\u7ef4\u5ea6\uff0c\u53e6\u4e00\u4e2a\u4e0d\u9700\u8981\u8bbe\u7f6e\u7684\u7ef4\u5ea6\u7f6e\u4e3aNone
\u5373\u53ef\u3002width\u548cheight\u53ef\u4ee5\u4e3aint
\u6216float
, \u4e3aint
\u65f6\u4ee3\u8868width\u6216height\u7684\u7edd\u5bf9\u503c\uff0c\u4e3afloat
\u65f6\u4ee3\u8868\u76f8\u5bf9\u4e8e\u7a97\u53e3\u5927\u5c0f\u7684\u767e\u5206\u6bd4\u3002
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.resize_output_dock","title":"resize_output_dock(size: Tuple[Union[int, float, None], Union[int, float, None]]) -> None
","text":"\u8c03\u6574Output Dock\u5c3a\u5bf8
\u6ce8\u610f\uff1a\u505c\u9760\u7a97\u53e3\u7684\u5c3a\u5bf8\u53d7\u5230\u591a\u79cd\u56e0\u7d20\u7684\u5f71\u54cd\uff0c\u65e0\u6cd5\u4fdd\u8bc1\u5b9e\u9645\u7684\u5c3a\u5bf8\u4e0e\u5f00\u53d1\u8005\u8bbe\u7f6e\u7684\u5c3a\u5bf8\u4fdd\u6301\u4e00\u81f4\uff0c\u5c24\u5176\u65f6\u591a\u4e2a\u505c\u9760\u7a97\u53e3\u505c\u9760\u5728\u540c\u4e00\u533a\u57df\u65f6\u5177\u4f53\u800c\u8a00\uff1a
- \u5c3a\u5bf8\u7684\u8c03\u6574\u53d7\u6700\u5c0f\u548c\u6700\u5927\u5c3a\u5bf8\u7684\u7ea6\u675f\uff1b
- \u5c3a\u5bf8\u8c03\u6574\u4e0d\u4f1a\u5f71\u54cd\u4e3b\u7a97\u53e3\u7684\u5927\u5c0f\uff1b
- \u5728\u7a7a\u95f4\u6709\u9650\u7684\u60c5\u51b5\u4e0b\uff0c\u5c06\u6839\u636e\u5404\u4e2a\u505c\u9760\u7a97\u53e3\u7684\u76f8\u5bf9\u5927\u5c0f\u5360\u6bd4\u8fdb\u884c\u53ef\u4ee5\u5229\u7528\u7a7a\u95f4\u7684\u8c03\u6574
Parameters:
Name Type Description Default size
Tuple[Union[int, float, None], Union[int, float, None]]
\u76ee\u6807\u5c3a\u5bf8\u3002\u683c\u5f0f\u4e3a(width, height)
\uff0c\u53ef\u4ee5\u53ea\u8bbe\u7f6e\u5176\u4e2d\u4e00\u4e2a\u7ef4\u5ea6\uff0c\u53e6\u4e00\u4e2a\u4e0d\u9700\u8981\u8bbe\u7f6e\u7684\u7ef4\u5ea6\u7f6e\u4e3aNone
\u5373\u53ef\u3002width\u548cheight\u53ef\u4ee5\u4e3aint
\u6216float
, \u4e3aint
\u65f6\u4ee3\u8868width\u6216height\u7684\u7edd\u5bf9\u503c\uff0c\u4e3afloat
\u65f6\u4ee3\u8868\u76f8\u5bf9\u4e8e\u7a97\u53e3\u5927\u5c0f\u7684\u767e\u5206\u6bd4\u3002
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.scroll_to_parameter","title":"scroll_to_parameter(parameter_name: str, x: int = 50, y: int = 50, highlight_effect: bool = True)
","text":"\u6eda\u52a8\u5230\u6307\u5b9a\u53c2\u6570\u7684\u4f4d\u7f6e\u3002
Parameters:
Name Type Description Default parameter_name
str
\u53c2\u6570\u540d\u79f0
required x
int
\u6eda\u52a8\u7684X\u5750\u6807\u504f\u79fb\u503c
50
y
int
\u6eda\u52a8\u7684Y\u5750\u6807\u504f\u79fb\u503c
50
highlight_effect
bool
\u662f\u5426\u5bf9\u6307\u5b9a\u63a7\u4ef6\u663e\u793a\u9ad8\u4eae\u6548\u679c
True
Returns:
Type Description \u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_allowed_dock_areas","title":"set_allowed_dock_areas(areas: Optional[DockWidgetAreas]) -> None
","text":"\u8bbe\u7f6e\u505c\u9760\u7a97\u53e3\u5141\u8bb8\u505c\u9760\u7684\u533a\u57df
Parameters:
Name Type Description Default areas
Optional[DockWidgetAreas]
\u5141\u8bb8\u505c\u9760\u7684\u533a\u57df
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_cancel_button_text","title":"set_cancel_button_text(text: str) -> None
","text":"\u8bbe\u7f6e\u53d6\u6d88\u6309\u94ae\u6587\u672c
Parameters:
Name Type Description Default text
str
\u76ee\u6807\u6587\u672c
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_clear_button_text","title":"set_clear_button_text(text: str) -> None
","text":"\u8bbe\u7f6e\u6e05\u9664\u6309\u94ae\u6587\u672c
Parameters:
Name Type Description Default text
str
\u76ee\u6807\u6587\u672c
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_clear_button_visible","title":"set_clear_button_visible(visible: bool) -> None
","text":"\u8bbe\u7f6e\u6e05\u9664\u6309\u94ae\u662f\u5426\u53ef\u89c1
Parameters:
Name Type Description Default visible
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_clear_checkbox_checked","title":"set_clear_checkbox_checked(checked: bool) -> None
","text":"\u8bbe\u7f6e\u6e05\u9664\u9009\u9879\u6846\u662f\u5426\u9009\u4e2d
Parameters:
Name Type Description Default checked
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_clear_checkbox_text","title":"set_clear_checkbox_text(text: str) -> None
","text":"\u8bbe\u7f6e\u6e05\u9664\u9009\u9879\u6846\u6587\u672c
Parameters:
Name Type Description Default text
str
\u76ee\u6807\u6587\u672c
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_clear_checkbox_visible","title":"set_clear_checkbox_visible(visible: bool) -> None
","text":"\u8bbe\u7f6e\u6e05\u9664\u9009\u9879\u6846\u662f\u5426\u53ef\u89c1
Parameters:
Name Type Description Default visible
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_document","title":"set_document(document: str, document_format: Literal['markdown', 'html', 'plaintext']) -> None
","text":"\u8bbe\u7f6e\u51fd\u6570\u8bf4\u660e\u6587\u6863
Parameters:
Name Type Description Default document
str
\u6587\u6863\u5185\u5bb9
required document_format
Literal['markdown', 'html', 'plaintext']
\u6587\u6863\u683c\u5f0f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_document_dock_area","title":"set_document_dock_area(area: DockWidgetArea) -> None
","text":"\u8bbe\u7f6eDocument Dock\u505c\u9760\u533a\u57df
Parameters:
Name Type Description Default area
DockWidgetArea
\u76ee\u6807\u505c\u9760\u533a\u57df
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_document_dock_floating","title":"set_document_dock_floating(floating: bool) -> None
","text":"\u8bbe\u7f6eDocument Dock\u662f\u5426\u60ac\u6d6e
Parameters:
Name Type Description Default floating
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_document_dock_property","title":"set_document_dock_property(*, title: Optional[str] = None, visible: Optional[bool] = None, floating: Optional[bool] = None, area: Optional[DockWidgetArea] = None) -> None
","text":"\u8bbe\u7f6eDocument Dock\u7684\u5c5e\u6027
Parameters:
Name Type Description Default title
Optional[str]
\u6807\u9898
None
visible
Optional[bool]
\u662f\u5426\u663e\u793a
None
floating
Optional[bool]
\u662f\u5426\u60ac\u6d6e
None
area
Optional[DockWidgetArea]
\u521d\u59cb\u505c\u9760\u533a\u57df
None
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_document_dock_title","title":"set_document_dock_title(title: str) -> None
","text":"\u8bbe\u7f6eDocument Dock\u6807\u9898
Parameters:
Name Type Description Default title
str
\u6807\u9898
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_document_dock_visible","title":"set_document_dock_visible(visible: bool) -> None
","text":"\u8bbe\u7f6eDocument Dock\u662f\u5426\u663e\u793a
Parameters:
Name Type Description Default visible
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_execute_button_text","title":"set_execute_button_text(text: str) -> None
","text":"\u8bbe\u7f6e\u6267\u884c\u6309\u94ae\u6587\u672c
Parameters:
Name Type Description Default text
str
\u76ee\u6807\u6587\u672c
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_output_dock_area","title":"set_output_dock_area(area: DockWidgetArea) -> None
","text":"\u8bbe\u7f6eOutput Dock\u505c\u9760\u533a\u57df
Parameters:
Name Type Description Default area
DockWidgetArea
\u76ee\u6807\u505c\u9760\u533a\u57df
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_output_dock_floating","title":"set_output_dock_floating(floating: bool) -> None
","text":"\u8bbe\u7f6eOutput Dock\u662f\u5426\u60ac\u6d6e
Parameters:
Name Type Description Default floating
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_output_dock_property","title":"set_output_dock_property(*, title: Optional[str] = None, visible: Optional[bool] = None, floating: Optional[bool] = None, area: Optional[DockWidgetArea] = None) -> None
","text":"\u8bbe\u7f6eOutput Dock\u7684\u5c5e\u6027
Parameters:
Name Type Description Default title
Optional[str]
\u6807\u9898
None
visible
Optional[bool]
\u662f\u5426\u663e\u793a
None
floating
Optional[bool]
\u662f\u5426\u60ac\u6d6e
None
area
Optional[DockWidgetArea]
\u521d\u59cb\u505c\u9760\u533a\u57df
None
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_output_dock_title","title":"set_output_dock_title(title: str) -> None
","text":"\u8bbe\u7f6eOutput Dock\u6807\u9898
Parameters:
Name Type Description Default title
str
\u6807\u9898
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_output_dock_visible","title":"set_output_dock_visible(visible: bool) -> None
","text":"\u8bbe\u7f6eOutput Dock\u662f\u5426\u663e\u793a
Parameters:
Name Type Description Default visible
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_parameter_value","title":"set_parameter_value(parameter_name: str, value: Any) -> None
","text":"\u8bbe\u7f6e\u53c2\u6570\u5f53\u524d\u503c
Parameters:
Name Type Description Default parameter_name
str
\u53c2\u6570\u540d\u79f0
required value
Any
\u8981\u8bbe\u7f6e\u7684\u503c
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Raises:
Type Description ParameterNotFoundError
\u82e5\u6307\u5b9a\u53c2\u6570\u4e0d\u5b58\u5728\uff0c\u5219\u5f15\u53d1\u6b64\u5f02\u5e38
ParameterError
\u82e5\u65e0\u6cd5\u5c06\u503c\u8bbe\u7f6e\u5230\u5bf9\u5e94\u7684\u63a7\u4ef6\uff0c\u90a3\u4e48\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_parameter_values","title":"set_parameter_values(values: Dict[str, Any]) -> None
","text":"\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u7684\u5f53\u524d\u503c
Parameters:
Name Type Description Default values
Dict[str, Any]
\u8981\u8bbe\u7f6e\u7684\u53c2\u6570\u540d\u79f0\u548c\u503c
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Raises:
Type Description ParameterError
\u82e5\u65e0\u6cd5\u5c06\u503c\u8bbe\u7f6e\u5230\u5bf9\u5e94\u7684\u63a7\u4ef6\uff0c\u90a3\u4e48\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_statusbar_visible","title":"set_statusbar_visible(visible: bool) -> None
","text":"\u8bbe\u7f6e\u7a97\u53e3\u72b6\u6001\u680f\u662f\u5426\u53ef\u89c1
Parameters:
Name Type Description Default visible
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.show_progressbar","title":"show_progressbar() -> None
","text":"\u663e\u793a\u8fdb\u5ea6\u6761
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.show_statusbar_message","title":"show_statusbar_message(message: str, timeout: int = 3000) -> None
","text":"\u8bbe\u7f6e\u72b6\u6001\u680f\u6d88\u606f
Parameters:
Name Type Description Default message
str
\u6d88\u606f\u6587\u672c
required timeout
int
\u663e\u793a\u7684\u65f6\u957f
3000
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.tabify_docks","title":"tabify_docks() -> None
","text":"\u4f7f\u6240\u6709Dock\u7a97\u53e3\u9009\u9879\u5361\u5316
\u6ce8\u610f\uff1a\u5f53\u524d\u5df2\u60ac\u6d6e\u7684\u7a97\u53e3\u4e0d\u53d7\u5f71\u54cd
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.try_cancel_execution","title":"try_cancel_execution() -> None
","text":"\u5c1d\u8bd5\u53d6\u6d88\u51fd\u6570\u6267\u884c
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Raises:
Type Description FunctionNotCancellableError
\u51fd\u6570\u672a\u88ab\u8bbe\u7f6e\u4e3a\u53ef\u53d6\u6d88\u51fd\u6570\u65f6\uff0c\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
FunctionNotExecutingError
\u51fd\u6570\u672a\u5904\u4e8e\u6b63\u5728\u6267\u884c\u4e2d\u65f6\uff0c\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.update_progress","title":"update_progress(current_value: int, message: Optional[str] = None) -> None
","text":"\u66f4\u65b0\u8fdb\u5ea6\u6761\u8fdb\u5ea6
Parameters:
Name Type Description Default current_value
int
\u5f53\u524d\u8fdb\u5ea6
required message
Optional[str]
\u989d\u5916\u4fe1\u606f
None
Returns:
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.update_progressbar_config","title":"update_progressbar_config(config: Union[ProgressBarConfig, dict, None]) -> None
","text":"\u66f4\u65b0\u8fdb\u5ea6\u6761\u914d\u7f6e
Parameters:
Name Type Description Default config
Union[ProgressBarConfig, dict, None]
\u8fdb\u5ea6\u6761\u914d\u7f6e
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#_1","title":"\u7c7b\u578b\u4e0e\u5e38\u91cf","text":""},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.DockWidgetArea","title":"DockWidgetArea = Qt.DockWidgetArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.NoDockWidgetArea","title":"NoDockWidgetArea = Qt.DockWidgetArea.NoDockWidgetArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.BottomDockWidgetArea","title":"BottomDockWidgetArea = Qt.DockWidgetArea.BottomDockWidgetArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.TopDockWidgetArea","title":"TopDockWidgetArea = Qt.DockWidgetArea.TopDockWidgetArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.LeftDockWidgetArea","title":"LeftDockWidgetArea = Qt.DockWidgetArea.LeftDockWidgetArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.RightDockWidgetArea","title":"RightDockWidgetArea = Qt.DockWidgetArea.RightDockWidgetArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.DockWidgetAreas","title":"DockWidgetAreas = Union[DockWidgetArea, int]
module-attribute
","text":""},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.AllDockWidgetAreas","title":"AllDockWidgetAreas = Qt.AllDockWidgetAreas
module-attribute
","text":""},{"location":"apis/pyguiadapter.windows.fnselect/","title":"pyguiadapter.windows.fnselect","text":""},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig","title":"FnSelectWindowConfig
dataclass
","text":" Bases: BaseWindowConfig
Source code in pyguiadapter\\windows\\fnselect\\_window.py
@dataclasses.dataclass(frozen=True)\nclass FnSelectWindowConfig(BaseWindowConfig):\n title: str = \"Select Function\"\n \"\"\"\u7a97\u53e3\u6807\u9898\"\"\"\n\n size: Union[Tuple[int, int], QSize] = (800, 600)\n \"\"\"\u7a97\u53e3\u5c3a\u5bf8\"\"\"\n\n select_button_text: str = \"Select\"\n \"\"\"\u9009\u62e9\u6309\u94ae\u6587\u5b57\"\"\"\n\n icon_mode: bool = False\n \"\"\"\u51fd\u6570\u5217\u8868\u662f\u5426\u542f\u7528\u56fe\u6807\u6a21\u5f0f\"\"\"\n\n icon_size: Union[Tuple[int, int], int, QSize, None] = DEFAULT_FN_ICON_SIZE\n \"\"\"\u51fd\u6570\u56fe\u6807\u5927\u5c0f\"\"\"\n\n default_fn_group_name: str = \"Main Functions\"\n \"\"\"\u9ed8\u8ba4\u51fd\u6570\u5206\u7ec4\u540d\u79f0\"\"\"\n\n default_fn_group_icon: IconType = None\n \"\"\"\u9ed8\u8ba4\u51fd\u6570\u5206\u7ec4\u56fe\u6807\"\"\"\n\n fn_group_icons: Dict[str, IconType] = dataclasses.field(default_factory=dict)\n \"\"\"\u5176\u4ed6\u51fd\u6570\u5206\u7ec4\u56fe\u6807\"\"\"\n\n document_browser_config: Optional[DocumentBrowserConfig] = None\n \"\"\"\u6587\u6863\u6d4f\u89c8\u5668\u914d\u7f6e\"\"\"\n\n document_browser_width: int = 490\n \"\"\"\u6587\u6863\u6d4f\u89c8\u5668\u5bbd\u5ea6\"\"\"\n
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.default_fn_group_icon","title":"default_fn_group_icon: IconType = None
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u51fd\u6570\u5206\u7ec4\u56fe\u6807
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.default_fn_group_name","title":"default_fn_group_name: str = 'Main Functions'
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u51fd\u6570\u5206\u7ec4\u540d\u79f0
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.document_browser_config","title":"document_browser_config: Optional[DocumentBrowserConfig] = None
class-attribute
instance-attribute
","text":"\u6587\u6863\u6d4f\u89c8\u5668\u914d\u7f6e
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.document_browser_width","title":"document_browser_width: int = 490
class-attribute
instance-attribute
","text":"\u6587\u6863\u6d4f\u89c8\u5668\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.fn_group_icons","title":"fn_group_icons: Dict[str, IconType] = dataclasses.field(default_factory=dict)
class-attribute
instance-attribute
","text":"\u5176\u4ed6\u51fd\u6570\u5206\u7ec4\u56fe\u6807
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.icon_mode","title":"icon_mode: bool = False
class-attribute
instance-attribute
","text":"\u51fd\u6570\u5217\u8868\u662f\u5426\u542f\u7528\u56fe\u6807\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.icon_size","title":"icon_size: Union[Tuple[int, int], int, QSize, None] = DEFAULT_FN_ICON_SIZE
class-attribute
instance-attribute
","text":"\u51fd\u6570\u56fe\u6807\u5927\u5c0f
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.select_button_text","title":"select_button_text: str = 'Select'
class-attribute
instance-attribute
","text":"\u9009\u62e9\u6309\u94ae\u6587\u5b57
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.size","title":"size: Union[Tuple[int, int], QSize] = (800, 600)
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u5c3a\u5bf8
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.title","title":"title: str = 'Select Function'
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u6807\u9898
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindow","title":"FnSelectWindow
","text":" Bases: BaseWindow
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindow.get_group_names","title":"get_group_names() -> List[str]
","text":"\u83b7\u53d6\u6240\u6709\u51fd\u6570\u5206\u7ec4\u540d\u79f0\u3002
Returns:
Type Description List[str]
\u8fd4\u56de\u51fd\u6570\u5206\u7ec4\u540d\u79f0\u5217\u8868\u3002
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindow.get_select_button_text","title":"get_select_button_text() -> str
","text":"\u83b7\u53d6\u9009\u62e9\u6309\u94ae\u6587\u5b57\u3002
Returns:
Type Description str
\u8fd4\u56de\u5f53\u524d\u9009\u62e9\u6309\u94ae\u4e0a\u7684\u6587\u5b57\u3002
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindow.remove_group","title":"remove_group(group_name: Optional[str]) -> None
","text":"\u79fb\u9664\u6307\u5b9a\u51fd\u6570\u5206\u7ec4\u3002
Parameters:
Name Type Description Default group_name
Optional[str]
\u5f85\u79fb\u9664\u7684\u51fd\u6570\u5206\u7ec4\u540d\u79f0\u3002
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Raises:
Type Description ValueError
\u5f53\u6307\u5b9a\u51fd\u6570\u5206\u7ec4\u540d\u79f0\u4e0d\u5b58\u5728\u65f6\uff0c\u5c06\u629b\u51faValueError
\u3002
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindow.set_document_browser_width","title":"set_document_browser_width(width: int) -> None
","text":"\u8bbe\u7f6e\u6587\u6863\u6d4f\u89c8\u5668\u5bbd\u5ea6\u3002
Parameters:
Name Type Description Default width
int
\u76ee\u6807\u5bbd\u5ea6
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindow.set_select_button_text","title":"set_select_button_text(text: str) -> None
","text":"\u8bbe\u7f6e\u9009\u62e9\u6309\u94ae\u6587\u5b57\u3002
Parameters:
Name Type Description Default text
str
\u5e26\u8bbe\u7f6e\u7684\u6587\u5b57
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows/","title":"pyguiadapter.windows","text":""},{"location":"apis/pyguiadapter.windows/#pyguiadapter.windows.DocumentBrowserConfig","title":"DocumentBrowserConfig
dataclass
","text":" Bases: TextBrowserConfig
\u6587\u6863\u6d4f\u89c8\u5668\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\windows\\document_browser.py
@dataclasses.dataclass\nclass DocumentBrowserConfig(TextBrowserConfig):\n \"\"\"\u6587\u6863\u6d4f\u89c8\u5668\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n text_color: str = COLOR_PRIMARY_TEXT\n background_color: str = COLOR_PAGE_BACKGROUND\n line_wrap_mode: LineWrapMode = LineWrapMode.WidgetWidth\n\n parameter_anchor: bool = False\n \"\"\"\u662f\u5426\u542f\u7528\u53c2\u6570\u951a\u70b9\u3002\u5f53\u542f\u7528\u65f6\uff0c\u7528\u6237\u70b9\u51fb\u6587\u6863\u4e2d\u7684\u53c2\u6570\u951a\u70b9\uff0c\u4f1a\u81ea\u52a8\u8df3\u8f6c\u5230\u5bf9\u5e94\u7684\u53c2\u6570\u63a7\u4ef6\u5904\u3002\"\"\"\n\n parameter_anchor_pattern: str = r\"^#\\s*param\\s*=\\s*([\\w]+)\\s*$\"\n \"\"\"\u53c2\u6570\u951a\u70b9\u7684\u683c\u5f0f\u3002\u9ed8\u8ba4\u683c\u5f0f\u4e3a\uff1a#param=\u53c2\u6570\u540d\u3002\"\"\"\n\n group_anchor: bool = False\n \"\"\"\u662f\u5426\u542f\u7528\u53c2\u6570\u5206\u7ec4\u951a\u70b9\u3002\u5f53\u542f\u7528\u65f6\uff0c\u7528\u6237\u70b9\u51fb\u6587\u6863\u4e2d\u7684\u53c2\u6570\u5206\u7ec4\u951a\u70b9\uff0c\u4f1a\u81ea\u52a8\u5c55\u5f00\u5bf9\u5e94\u7684\u53c2\u6570\u5206\u7ec4\u3002\"\"\"\n\n group_anchor_pattern: str = r\"^#\\s*group\\s*=\\s*([\\w\\W\\s]*)\\s*$\"\n \"\"\"\u53c2\u6570\u5206\u7ec4\u951a\u70b9\u7684\u683c\u5f0f\u3002\u9ed8\u8ba4\u683c\u5f0f\u4e3a\uff1a#group=\u5206\u7ec4\u540d\u3002\"\"\"\n
"},{"location":"apis/pyguiadapter.windows/#pyguiadapter.windows.DocumentBrowserConfig.group_anchor","title":"group_anchor: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u53c2\u6570\u5206\u7ec4\u951a\u70b9\u3002\u5f53\u542f\u7528\u65f6\uff0c\u7528\u6237\u70b9\u51fb\u6587\u6863\u4e2d\u7684\u53c2\u6570\u5206\u7ec4\u951a\u70b9\uff0c\u4f1a\u81ea\u52a8\u5c55\u5f00\u5bf9\u5e94\u7684\u53c2\u6570\u5206\u7ec4\u3002
"},{"location":"apis/pyguiadapter.windows/#pyguiadapter.windows.DocumentBrowserConfig.group_anchor_pattern","title":"group_anchor_pattern: str = '^#\\\\s*group\\\\s*=\\\\s*([\\\\w\\\\W\\\\s]*)\\\\s*$'
class-attribute
instance-attribute
","text":"\u53c2\u6570\u5206\u7ec4\u951a\u70b9\u7684\u683c\u5f0f\u3002\u9ed8\u8ba4\u683c\u5f0f\u4e3a\uff1a#group=\u5206\u7ec4\u540d\u3002
"},{"location":"apis/pyguiadapter.windows/#pyguiadapter.windows.DocumentBrowserConfig.parameter_anchor","title":"parameter_anchor: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u53c2\u6570\u951a\u70b9\u3002\u5f53\u542f\u7528\u65f6\uff0c\u7528\u6237\u70b9\u51fb\u6587\u6863\u4e2d\u7684\u53c2\u6570\u951a\u70b9\uff0c\u4f1a\u81ea\u52a8\u8df3\u8f6c\u5230\u5bf9\u5e94\u7684\u53c2\u6570\u63a7\u4ef6\u5904\u3002
"},{"location":"apis/pyguiadapter.windows/#pyguiadapter.windows.DocumentBrowserConfig.parameter_anchor_pattern","title":"parameter_anchor_pattern: str = '^#\\\\s*param\\\\s*=\\\\s*([\\\\w]+)\\\\s*$'
class-attribute
instance-attribute
","text":"\u53c2\u6570\u951a\u70b9\u7684\u683c\u5f0f\u3002\u9ed8\u8ba4\u683c\u5f0f\u4e3a\uff1a#param=\u53c2\u6570\u540d\u3002
"}]}
\ No newline at end of file
+{"config":{"lang":["en","zh"],"separator":"[\\s\\u200b\\u3000\\-\u3001\u3002\uff0c\uff0e\uff1f\uff01\uff1b]+","pipeline":["stemmer"]},"docs":[{"location":"","title":"\u9996\u9875","text":""},{"location":"#_1","title":"\uff08\u4e00\uff09\u7b80\u4ecb","text":"PyGUIAdapter
\u662f\u4e00\u4e2a\u7528\u4e8e\u5feb\u901f\u6784\u5efa\u56fe\u5f62\u7528\u6237\u754c\u9762\u7684Python\u5e93\uff0c\u53ea\u9700\u6781\u5c11\u7684\u4ee3\u7801\uff0c\u5c31\u53ef\u4ee5\u5c06\u51e0\u4e4e\u4efb\u610fPython\u51fd\u6570\u65e0\u7f1d\u8f6c\u5316\u4e3a\u56fe\u5f62\u7528\u6237\u754c\u9762\uff0c\u5927\u5927\u7b80\u5316\u4e86GUI\u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u53d1\u8fc7\u7a0b\u3002
PyGUIAdapter
\u7684\u6838\u5fc3\u7406\u5ff5\u662f\uff0c\u4ee5\u5c3d\u53ef\u80fd\u201c\u65e0\u611f\u201d\u548c\u201c\u4f4e\u4fb5\u5165\u6027\u201d\u7684\u65b9\u5f0f\uff0c\u5e2e\u52a9\u5f00\u53d1\u8005\u521b\u5efa\u7528\u6237\u754c\u9762\uff0c\u4f7f\u5f00\u53d1\u8005\u80fd\u591f\u4e13\u6ce8\u4e8e\u6838\u5fc3\u529f\u80fd\u7684\u5b9e\u73b0\uff0c\u800c\u4e0d\u5fc5\u5c06\u7cbe\u529b\u5206\u6563\u5230\u590d\u6742\u3001\u7e41\u7410\u7684GUI\u7f16\u7a0b\u4e0a\uff0c\u4ece\u800c\u5c3d\u53ef\u80fd\u964d\u4f4e\u5f00\u53d1\u8005\u7684\u5b66\u4e60\u6210\u672c\u548c\u5fc3\u667a\u8d1f\u62c5\u3002
"},{"location":"#_2","title":"\uff08\u4e8c\uff09 \u9002\u7528\u573a\u666f","text":"PyGUIAdapter
\u4e0e\u201c\u8f93\u5165\uff08Input\uff09-\u5904\u7406\uff08Process\uff09-\u8f93\u51fa\uff08Output\uff09
\u201d\u7a0b\u5e8f\u8bbe\u8ba1\u6a21\u5f0f\u9ad8\u5ea6\u5951\u5408\uff0c\u56e0\u6b64\u5176\u7279\u522b\u9002\u7528\u4e8e\u4ee5\u4e0b\u51e0\u79cd\u5f00\u53d1\u573a\u666f\uff1a
- \u5de5\u5177\u7c7b\u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u53d1
- \u5c06\u73b0\u6709
CLI
\u7a0b\u5e8f\u5feb\u901f\u8fc1\u79fb\u5230\u56fe\u5f62\u754c\u9762
\u4e0b\u9762\u662fPython\u5b98\u65b9\u6587\u6863\u7ed9\u51fa\u7684\u4e00\u4e2a\u4f7f\u7528argparse
\u521b\u5efa\u547d\u4ee4\u884c\u7684\u4f8b\u5b50\uff1a
import argparse\nparser = argparse.ArgumentParser(description='Process some integers.')\nparser.add_argument('integers', metavar='N', type=int, nargs='+',\n help='an integer for the accumulator')\nparser.add_argument('--sum', dest='accumulate', action='store_const',\n const=sum, default=max,\n help='sum the integers (default: find the max)')\n\nargs = parser.parse_args()\nprint(args.accumulate(args.integers))\n
\u501f\u52a9PyGUIAdapter
\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u7528\u6781\u5c11\u7684\u4ee3\u7801\u5c06\u5176\u8f6c\u6362\u6210GUI\u7a0b\u5e8f\u3002\u800c\u4e14\u5f00\u53d1\u8005\u518d\u4e5f\u65e0\u9700\u5c06\u5927\u91cf\u7cbe\u529b\u82b1\u8d39\u5728\u547d\u4ee4\u884c\u53c2\u6570\u7684\u8bbe\u8ba1\u548c\u5904\u7406\u4e0a\uff1a
from typing import List, Literal\nfrom pyguiadapter.adapter import GUIAdapter\n\n\ndef process_integers(\n integers: List[int], operation: Literal[\"sum\", \"max\"] = \"max\"\n) -> int:\n \"\"\"\n Process some integers.\n\n @param integers: integers for the accumulator\n @param operation: sum the integers (default: find the max)\n \"\"\"\n func = max if operation == \"max\" else sum\n return func(integers)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(process_integers)\n adapter.run()\n
"},{"location":"#_3","title":"\uff08\u4e09\uff09\u7279\u6027","text":" - \u4f7f\u7528\u7b80\u5355\uff0c\u5f00\u53d1\u5feb\u901f\uff0c\u53ef\u4ee5\u7528\u6781\u5c11\u4ee3\u7801\u5b8c\u6210\u56fe\u5f62\u7528\u6237\u754c\u9762\u521b\u5efa\uff0c\u5b66\u4e60\u6210\u672c\u4f4e\uff0c\u5fc3\u667a\u8d1f\u62c5\u5c0f\u3002
- \u4e30\u5bcc\u7684\u5185\u7f6e\u63a7\u4ef6\u7c7b\u578b\uff0c\u5b9e\u73b0\u4e86\u8fd130\u79cd\u5185\u7f6e\u63a7\u4ef6\uff0c\u57fa\u672c\u5b9e\u73b0\u5f00\u7bb1\u5373\u7528\u3002
- \u6240\u6709Python\u7684\u57fa\u672c\u6570\u636e\u7c7b\u578b\u5747\u5b9e\u73b0\u4e86\u5bf9\u5e94\u8f93\u5165\u63a7\u4ef6\u3002
- \u6269\u5c55\u4e86\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff0c\u5b9a\u4e49\u4e86\u5927\u91cf\u8bed\u4e49\u5316\u7c7b\u578b\u5e76\u5b9e\u73b0\u4e86\u4e13\u7528\u63a7\u4ef6\uff0c\u65b9\u4fbf\u7528\u6237\u8f93\u5165\u65e5\u671f\u3001\u65f6\u95f4\u3001\u989c\u8272\u3001\u6587\u4ef6\u8def\u5f84\u7b49\u7279\u6b8a\u5bf9\u8c61\u3002
- \u5b9e\u73b0\u4e86\u901a\u7528\u5bf9\u8c61\u8f93\u5165\u63a7\u4ef6\uff0c\u652f\u6301\u8f93\u5165
Json\u5bf9\u8c61
\u548c\u4efb\u610fPython\u5b57\u9762\u91cf\u5bf9\u8c61
\uff08\u5305\u62ecint
\u3001float
\u3001bool
\u3001str
\u3001bytes
\u3001list
\u3001tuple
\u3001set
\u3001dict
\uff09\uff0c\u8d4b\u4e88\u4e86\u7528\u6237\u8f93\u5165\u4efb\u610f\u590d\u6742\u6570\u636e\u7684\u80fd\u529b\u3002
- \u9ad8\u53ef\u6269\u5c55\u6027\uff0c\u63d0\u4f9b\u4e86\u81ea\u5b9a\u4e49\u63a7\u4ef6\u63a5\u53e3\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u5f88\u65b9\u4fbf\u5730\u4e3a\u81ea\u5b9a\u4e49\u6570\u636e\u7c7b\u578b\u5b9e\u73b0\u4e13\u7528\u8f93\u5165\u63a7\u4ef6\u3002
- \u9ad8\u7075\u6d3b\u6027\u3002\u63a7\u4ef6\u4e0e\u7a97\u53e3\u5b9a\u4e49\u4e86\u5927\u91cf\u53ef\u914d\u7f6e\u5c5e\u6027\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u7075\u6d3b\u5730\u8c03\u6574\u63a7\u4ef6\u53ca\u7a97\u53e3\u7684\u5916\u89c2\u3001\u6837\u5f0f\u3001\u884c\u4e3a\uff0c\u63d0\u5347\u7528\u6237\u4f53\u9a8c\u3002
- \u652f\u6301\u4f7f\u7528\u4f7f\u7528\u6837\u5f0f\u8868\uff08
QSS
\uff09\u5b9a\u5236\u754c\u9762\u98ce\u683c\uff0c\u540c\u65f6\u63a5\u5165\u73b0\u6709\u7b2c\u4e09\u65b9\u754c\u9762\u7f8e\u5316\u5e93\u3002 - \u652f\u6301\u6dfb\u52a0\u7a97\u53e3\u83dc\u5355\u680f\u3001\u5de5\u5177\u680f\u3002
- \u652f\u6301\u76d1\u542c\u7a97\u53e3\u4e8b\u4ef6\u3002
- \u652f\u6301\u52a8\u6001\u4fee\u6539\u63a7\u4ef6\uff0c\u4e3a\u6784\u5efa\u590d\u6742\u5e94\u7528\u63d0\u4f9b\u4e86\u53ef\u80fd\u3002
- \u57fa\u4e8e
qtpy
\u62bd\u8c61\u5c42\uff0c\u4e0d\u4f9d\u8d56\u7279\u5b9aQt\u7ed1\u5b9a\u5e93\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u9700\u8981\u53ef\u81ea\u7531\u9009\u62e9PyQt5
\u3001PyQt6
\u3001PySide2
\u3001PySide2
\u3002 - \u754c\u9762\u5e95\u5c42\u4f7f\u7528
Qt
\uff0c\u517c\u5bb9\u6027\u597d\uff0c\u76f8\u6bd4webview\u7c7b
\u65b9\u6848\uff0c\u7cfb\u7edf\u8d44\u6e90\u5360\u7528\u66f4\u5c0f\u3002 - \u7eafPython\uff0c\u8de8\u5e73\u53f0\u7b80\u5355\u3002
"},{"location":"basic-types/","title":"\u57fa\u7840\u7c7b\u578b\u4e0e\u63a7\u4ef6","text":""},{"location":"basic-types/#int","title":"\uff08\u4e00\uff09int
\u7c7b\u578b","text":""},{"location":"basic-types/#1","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" IntSpinBox
- \u5916\u89c2
"},{"location":"basic-types/#2","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aIntSpinBoxConfig
"},{"location":"basic-types/#3","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import IntSpinBoxConfig\n\n\ndef int_example(arg1: int, arg2: int, arg3: int = 100) -> int:\n \"\"\"\n A simple example for **int** and **IntSpinBox**\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @return:\n\n @params\n # parameter widget config for arg1\n [arg1]\n default_value = -100\n min_value = -100\n max_value = 100\n\n # parameter widget config for arg2\n [arg2]\n default_value = 1000\n max_value = 999\n prefix = \"$\"\n\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n return arg1 + arg2 + arg3\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n int_example,\n widget_configs={\n # parameter config for arg3\n \"arg3\": IntSpinBoxConfig(\n default_value=100, min_value=0, max_value=1000, step=10, prefix=\"$\"\n )\n },\n )\n adapter.run()\n
"},{"location":"basic-types/#float","title":"\uff08\u4e8c\uff09float
\u7c7b\u578b","text":""},{"location":"basic-types/#1_1","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" FloatSpinBox
- \u5916\u89c2
"},{"location":"basic-types/#2_1","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aFloatSpinBoxConfig
"},{"location":"basic-types/#3_1","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import FloatSpinBoxConfig\n\n\ndef float_example(float_arg1: float, float_arg2: float, float_arg3: float = 3.14):\n \"\"\"\n example for **float** and **FloatSpinBox**\n\n @param float_arg1: this parameter is configured in docstring , see `@params ... @end` block below\n @param float_arg2: this parameter is configured with `run()` via a FloatSpinBoxConfig object\n @param float_arg3: this parameter is configured with `run()` via a dict instance\n @return:\n\n @params\n [float_arg1]\n default_value = 1.0\n max_value = 100.0\n step = 2.0\n decimals = 3\n prefix = \"r: \"\n suffix = \"%\"\n\n @end\n\n \"\"\"\n uprint(\"float_arg1\", float_arg1)\n uprint(\"float_arg2\", float_arg2)\n uprint(\"float_arg3\", float_arg3)\n return float_arg1 + float_arg2 + float_arg3\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n\n float_arg2_config = FloatSpinBoxConfig(\n default_value=-0.5, max_value=1.0, step=0.000005, decimals=5, prefix=\"R: \"\n )\n\n adapter.add(\n float_example,\n widget_configs={\n \"float_arg2\": float_arg2_config,\n \"float_arg3\": {\n # this will override the default_value in the function signature\n \"default_value\": 1,\n \"max_value\": 2.0,\n \"step\": 0.00001,\n \"decimals\": 5,\n },\n },\n )\n adapter.run()\n
"},{"location":"basic-types/#bool","title":"\uff08\u4e09\uff09bool
\u7c7b\u578b","text":""},{"location":"basic-types/#1_2","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" BoolBox
- \u5916\u89c2
"},{"location":"basic-types/#2_2","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aBoolBoxConfig
"},{"location":"basic-types/#3_2","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import BoolBoxConfig\n\n\ndef bool_example(\n bool_arg1: bool = False, bool_arg2: bool = True, bool_arg3: bool = False\n):\n \"\"\"\n example for type **bool** and **BoolBox** widget\n\n @param bool_arg1: this parameter will be configured in docstring\n @param bool_arg2: this parameter will be configured with **adapter.run()** via a BoolBoxConfig object\n @param bool_arg3: this parameter will be configured with **adapter.run()** via a dict\n @return:\n\n @params\n [bool_arg1]\n # this will override the default value defined in the function signature\n default_value = true\n true_text = \"On\"\n false_text = \"Off\"\n true_icon = \"fa.toggle-on\"\n false_icon = \"fa.toggle-off\"\n vertical = false\n @end\n \"\"\"\n uprint(bool_arg1, bool_arg2, bool_arg3)\n return bool_arg1, bool_arg2, bool_arg3\n\n\nif __name__ == \"__main__\":\n\n bool_arg2_conf = {\n # this will override the default value defined in the function signature\n \"default_value\": True,\n \"true_text\": \"Enable\",\n \"false_text\": \"Disable\",\n \"true_icon\": \"fa.toggle-on\",\n \"false_icon\": \"fa.toggle-off\",\n \"vertical\": True,\n }\n\n bool_arg3_conf = BoolBoxConfig(\n # this will override the default value defined in the function signature\n default_value=True,\n true_text=\"true\",\n false_text=\"false\",\n vertical=False,\n )\n\n adapter = GUIAdapter()\n adapter.add(\n bool_example,\n widget_configs={\"bool_arg2\": bool_arg2_conf, \"bool_arg3\": bool_arg3_conf},\n )\n adapter.run()\n
"},{"location":"basic-types/#str","title":"\uff08\u56db\uff09str
\u7c7b\u578b","text":""},{"location":"basic-types/#1_3","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" LineEdit
- \u5916\u89c2
"},{"location":"basic-types/#2_3","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aLineEditConfig
"},{"location":"basic-types/#3_3","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import LineEditConfig, LineEdit\n\n\ndef str_example(\n str_arg1: str = \"arg1\",\n str_arg2: str = \"arg2\",\n str_arg3: str = \"arg3\",\n str_arg4: str = \"arg4\",\n str_arg5: str = \"arg5\",\n):\n \"\"\"\n example for type **str** and **LineEdit** widget\n\n @param str_arg1: this parameter will be configured in docstring\n @param str_arg2: this parameter will be configured in docstring\n @param str_arg3: this parameter will be configured in docstring\n @param str_arg4: this parameter will be configured with adapter.run() via a LineEditConfig object\n @param str_arg5: this parameter will be configured with adapter.run() via a dict\n @return:\n\n @params\n [str_arg1]\n # override the default value of str_arg1 defined in the function signature\n default_value = \"123456\"\n clear_button = true\n max_length = 5\n frame = false\n\n [str_arg2]\n input_mask = \"000.000.000.000;_\"\n\n [str_arg3]\n default_value = \"\"\n placeholder = \"this is a placeholder text\"\n\n\n @end\n\n \"\"\"\n uprint(\"str_example\")\n uprint(\"str_arg1:\", str_arg1)\n uprint(\"str_arg2:\", str_arg2)\n uprint(\"str_arg3:\", str_arg3)\n uprint(\"str_arg4:\", str_arg4)\n uprint(\"str_arg5:\", str_arg5)\n return str_arg1 + str_arg2 + str_arg3 + str_arg4 + str_arg5\n\n\nif __name__ == \"__main__\":\n\n str_arg4_conf = LineEditConfig(\n # override the default value of str_arg4 defined in the function signature\n default_value=\"this is a readonly text\",\n readonly=False,\n echo_mode=LineEdit.PasswordEchoOnEditMode,\n )\n\n str_arg5_conf = {\n \"validator\": r\"^[a-zA-Z0-9]+$\",\n \"alignment\": LineEdit.AlignCenter,\n }\n\n adapter = GUIAdapter()\n adapter.add(\n str_example,\n widget_configs={\n \"str_arg4\": str_arg4_conf,\n \"str_arg5\": str_arg5_conf,\n },\n )\n adapter.run()\n
"},{"location":"basic-types/#list","title":"\uff08\u4e94\uff09list
\u7c7b\u578b","text":""},{"location":"basic-types/#1_4","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" ListEdit
- \u5916\u89c2
"},{"location":"basic-types/#2_4","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aListEditConfig
"},{"location":"basic-types/#3_4","title":"3\u3001\u793a\u4f8b","text":"from typing import List\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import ListEditConfig\n\n\ndef list_example(arg1: list, arg2: List, arg3: list):\n \"\"\"\n This is an example for **ListEdit** and list** types\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n arg3: description of arg3\n\n Returns:\n None\n\n @params\n [arg1]\n default_value = [1,2,3,4]\n\n [arg2]\n default_value = [\"a\", \"b\", 3, \"d\"]\n @end\n \"\"\"\n uprint(\"arg1: \", arg1)\n uprint(\"arg2: \", arg2)\n uprint(\"arg3: \", arg3)\n\n\nif __name__ == \"__main__\":\n arg3_conf = ListEditConfig(\n default_value=[1, 2, 3, 4, [\"a\", \"b\", 3, \"d\"]],\n # set editor_height or editor_width to 0 will hide the inplace editor\n editor_height=0,\n editor_width=0,\n )\n adapter = GUIAdapter()\n adapter.add(\n list_example,\n widget_configs={\"arg3\": arg3_conf},\n )\n adapter.run()\n
"},{"location":"basic-types/#tuple","title":"\uff08\u516d\uff09tuple
\u7c7b\u578b","text":""},{"location":"basic-types/#1_5","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" TupleEdit
- \u5916\u89c2
"},{"location":"basic-types/#2_5","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aTupleEditConfig
"},{"location":"basic-types/#3_5","title":"3\u3001\u793a\u4f8b","text":"from typing import Tuple\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import TupleEditConfig\n\n\ndef tuple_example(arg1: tuple, arg2: Tuple, arg3: tuple):\n \"\"\"\n This is an example for **TupleEdit** and **tuple** types\n\n Args:\n arg1: describes of arg1\n arg2: describes of arg2\n arg3: describes of arg3\n\n Returns:\n None\n \"\"\"\n uprint(\"arg1: \", arg1)\n uprint(\"arg2: \", arg2)\n uprint(\"arg3: \", arg3)\n\n\nif __name__ == \"__main__\":\n arg1_conf = TupleEditConfig(\n default_value=(1, 2, 3),\n )\n arg2_conf = {\n \"default_value\": (1, 2, 3, [1, 2, 3, 4]),\n }\n arg3_conf = TupleEditConfig(\n default_value=(1, 2, 3),\n label=\"Arg3\",\n # set editor_height or editor_width to 0 will hide the inplace editor\n editor_height=0,\n editor_width=0,\n )\n adapter = GUIAdapter()\n adapter.add(\n tuple_example,\n widget_configs={\n \"arg1\": arg1_conf,\n \"arg2\": arg2_conf,\n \"arg3\": arg3_conf,\n },\n )\n adapter.run()\n
"},{"location":"basic-types/#set","title":"\uff08\u4e03\uff09set
\u7c7b\u578b","text":""},{"location":"basic-types/#1_6","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" SetEdit
- \u5916\u89c2
"},{"location":"basic-types/#2_6","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aSetEditConfig
"},{"location":"basic-types/#3_6","title":"3\u3001\u793a\u4f8b","text":"from typing import Set, MutableSet\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import SetEditConfig\n\n\ndef set_example(arg1: set, arg2: Set, arg3: MutableSet):\n \"\"\"\n This is an example for **SetEdit** for **set** types.\n\n Args:\n arg1: description of arg1.\n arg2: description of arg2.\n arg3: description of arg3.\n\n Returns:\n None.\n \"\"\"\n uprint(\"arg1: \", arg1)\n uprint(\"arg2: \", arg2)\n uprint(\"arg3: \", arg3)\n\n\nif __name__ == \"__main__\":\n arg1_conf = SetEditConfig(\n default_value={1, 2, 3},\n )\n arg2_conf = SetEditConfig(\n default_value={\"a\", \"b\", 1, 2},\n )\n arg3_conf = {\n \"default_value\": {1, 2, 3, (1, 2, 3, 4)},\n }\n adapter = GUIAdapter()\n adapter.add(\n set_example,\n widget_configs={\n \"arg1\": arg1_conf,\n \"arg2\": arg2_conf,\n \"arg3\": arg3_conf,\n },\n )\n adapter.run()\n
"},{"location":"basic-types/#dict","title":"\uff08\u4e03\uff09dict
\u7c7b\u578b","text":""},{"location":"basic-types/#1_7","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" DictEdit
- \u5916\u89c2
"},{"location":"basic-types/#2_7","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aDictEditConfig
"},{"location":"basic-types/#3_7","title":"3\u3001\u793a\u4f8b","text":"from typing import Dict, Mapping, MutableMapping, TypedDict\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import DictEditConfig\n\n\nclass User(TypedDict):\n name: str\n age: int\n address: str\n email: str\n\n\ndef dict_example(\n arg1: dict, arg2: Dict, arg3: MutableMapping, arg4: Mapping, arg5: User\n):\n \"\"\"\n This is an example for **DictEdit** widget and **dict** types.\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n arg3: description of arg3\n arg4: description of arg4\n arg5: description of arg5\n\n Returns:\n None\n\n @params\n [arg1]\n default_value = {a=1,b=2,c=\"3\"}\n\n [arg2]\n default_value = {\"key1\"=\"value1\", \"key2\"=\"value2\"}\n\n @end\n \"\"\"\n uprint(\"arg1: \", arg1)\n uprint(\"arg2: \", arg2)\n uprint(\"arg3: \", arg3)\n uprint(\"arg4: \", arg4)\n uprint(\"arg5: \", arg5)\n\n\nif __name__ == \"__main__\":\n arg1_conf = DictEditConfig(\n default_value={\"a\": 1, \"b\": 2, \"c\": \"3\", \"d\": [1, 2, 3]},\n )\n arg3_conf = DictEditConfig(\n default_value={\"a\": \"A\", \"b\": \"B\"},\n )\n\n arg4_conf = DictEditConfig(\n default_value={\"c\": \"C\", \"d\": \"D\", \"e\": [1, 2, 3, 4]},\n )\n\n arg5_conf = DictEditConfig(\n default_value=User(\n name=\"John\", age=30, address=\"123 Main St\", email=\"john@example.com\"\n ),\n )\n\n adapter = GUIAdapter()\n adapter.add(\n dict_example,\n widget_configs={\n \"arg1\": arg1_conf,\n \"arg3\": arg3_conf,\n \"arg4\": arg4_conf,\n \"arg5\": arg5_conf,\n },\n )\n adapter.run()\n
"},{"location":"basic-types/#date","title":"\uff08\u516b\uff09date
\u7c7b\u578b","text":""},{"location":"basic-types/#1_8","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" DateEdit
- \u5916\u89c2
"},{"location":"basic-types/#2_8","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aDateEditConfig
"},{"location":"basic-types/#3_8","title":"3\u3001\u793a\u4f8b","text":"from datetime import date\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import DateEditConfig, DateEdit\n\n\ndef date_example(arg1: date, arg2: date, arg3: date):\n \"\"\"\n This is an example for **DateEdit** and **date** type.\n Args:\n arg1: description of arg1\n arg2: description of arg2\n arg3: description of arg3\n\n Returns:\n None\n\n @params\n [arg2]\n label = \"Argument 2\"\n display_format = \"yyyy-MM-dd\"\n @end\n\n \"\"\"\n uprint(\"arg1\", arg1)\n uprint(\"arg2\", arg2)\n uprint(\"arg3\", arg3)\n\n\nif __name__ == \"__main__\":\n arg1_conf = DateEditConfig(\n min_date=date(2023, 1, 1),\n max_date=date(2023, 12, 31),\n )\n arg3_conf = DateEditConfig(\n default_value=date(2023, 6, 1),\n min_date=date(2023, 1, 1),\n max_date=date(2023, 12, 31),\n calendar_popup=True,\n alignment=DateEdit.AlignCenter,\n time_spec=DateEdit.UTC,\n )\n adapter = GUIAdapter()\n adapter.add(\n date_example,\n widget_configs={\"arg1\": arg1_conf, \"arg3\": arg3_conf},\n )\n adapter.run()\n
"},{"location":"basic-types/#time","title":"\uff08\u4e5d\uff09time
\u7c7b\u578b","text":""},{"location":"basic-types/#1_9","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" TimeEdit
- \u5916\u89c2
"},{"location":"basic-types/#2_9","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aTimeEditConfig
"},{"location":"basic-types/#3_9","title":"3\u3001\u793a\u4f8b","text":"from datetime import time\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import TimeEditConfig, TimeEdit\nfrom pyguiadapter.widgets.basic.datetimeedit import TimeSpec\n\n\ndef time_example(arg1: time, arg2: time, arg3: time):\n \"\"\"\n This is an example for **TimeEdit** and **datetime.time** type.\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n arg3: description of arg3\n\n Returns:\n None\n\n @params\n [arg3]\n label = \"Argument 3\"\n display_format = \"HH\u5c0f\u65f6mm\u5206ss\u79d2\"\n\n @end\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n arg1_conf = TimeEditConfig(\n default_value=time(hour=12, minute=30),\n max_time=time(hour=23, minute=59),\n min_time=time(hour=0, minute=0),\n time_spec=TimeSpec.UTC,\n )\n arg2_conf = TimeEditConfig(\n default_value=time(hour=20, minute=30),\n max_time=time(hour=23, minute=59),\n min_time=time(hour=12, minute=0),\n alignment=TimeEdit.AlignCenter,\n )\n adapter = GUIAdapter()\n adapter.add(\n time_example,\n widget_configs={\"arg1\": arg1_conf, \"arg2\": arg2_conf},\n )\n adapter.run()\n
"},{"location":"basic-types/#datetime","title":"\uff08\u5341\uff09datetime
\u7c7b\u578b","text":""},{"location":"basic-types/#1_10","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" DateTimeEdit
- \u5916\u89c2
"},{"location":"basic-types/#2_10","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aDateTimeEditConfig
"},{"location":"basic-types/#3_10","title":"3\u3001\u793a\u4f8b","text":"from datetime import datetime\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import DateTimeEditConfig, DateTimeEdit\n\n\ndef datetime_example(arg1: datetime, arg2: datetime, arg3: datetime):\n \"\"\"\n This an example for **DateTimeEdit** widget and **datetime** type.\n\n Args:\n arg1: description of arg1.\n arg2: description of arg2.\n arg3: description of arg3.\n\n Returns:\n None.\n\n @params\n [arg2]\n label = \"Argument 2\"\n display_format = \"dd.MM.yyyy HH:mm:ss\"\n @end\n\n \"\"\"\n uprint(\"arg1\", arg1)\n uprint(\"arg2\", arg2)\n uprint(\"arg3\", arg3)\n\n\nif __name__ == \"__main__\":\n arg1_conf = DateTimeEditConfig(\n min_datetime=datetime(2023, 1, 1),\n max_datetime=datetime(2023, 12, 31),\n time_spec=DateTimeEdit.UTC,\n )\n arg3_conf = DateTimeEditConfig(\n default_value=datetime(2023, 6, 1, 12, 59, 59),\n min_datetime=datetime(2023, 1, 1),\n max_datetime=datetime(2023, 12, 31),\n alignment=DateTimeEdit.AlignCenter,\n calendar_popup=False,\n )\n adapter = GUIAdapter()\n adapter.add(\n datetime_example,\n widget_configs={\n \"arg1\": arg1_conf,\n \"arg3\": arg3_conf,\n },\n )\n adapter.run()\n
"},{"location":"basic-types/#typingliteral","title":"\uff08\u5341\u4e00\uff09typing.Literal
\u7c7b\u578b","text":""},{"location":"basic-types/#1_11","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" ExclusiveChoiceBox
- \u5916\u89c2
"},{"location":"basic-types/#2_11","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aExclusiveChoiceBoxConfig
"},{"location":"basic-types/#3_11","title":"3\u3001\u793a\u4f8b","text":"from typing import Literal\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import ExclusiveChoiceBoxConfig\n\n\nclass MyObj(object):\n def __init__(self, name: str):\n self._name = name\n\n def __str__(self):\n return self._name\n\n def __eq__(self, other):\n if isinstance(other, MyObj):\n return other._name == self._name\n return False\n\n def __hash__(self):\n return hash(self._name)\n\n\nmy_objects = [MyObj(\"obj1\"), MyObj(\"obj2\"), MyObj(\"obj3\")]\n\n\ndef literal_example(\n arg1: Literal[\"option1\", \"option2\", \"option3\"] = \"option2\",\n arg2: Literal[1, 2, 3, 4, 5] = 3,\n arg3: Literal[\"option1\", \"option2\", 1, 2, True, False] = 1,\n arg4: MyObj = my_objects[0],\n):\n \"\"\"\n This is an example for **ExclusiveChoiceBox** widget and **Literal** type hint.\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n arg3: description of arg3\n arg4: description of arg4\n\n Returns:\n None\n\n @params\n [arg3]\n columns = 2\n show_type_icon = true\n @end\n \"\"\"\n uprint(\"arg1: \", arg1)\n uprint(\"arg2: \", arg2)\n uprint(\"arg3: \", arg3)\n uprint(f\"arg4: {arg4}({type(arg4)})\")\n\n\nif __name__ == \"__main__\":\n arg4_conf = ExclusiveChoiceBoxConfig(\n default_value=my_objects[1],\n show_type_icon=True,\n choices=my_objects,\n object_icon=\"ei.asl\",\n )\n adapter = GUIAdapter()\n adapter.add(literal_example, widget_configs={\"arg4\": arg4_conf})\n adapter.run()\n
"},{"location":"basic-types/#enumenum","title":"\uff08\u5341\u4e8c\uff09enum.Enum
\u7c7b\u578b","text":""},{"location":"basic-types/#1_12","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" EnumSelect
- \u5916\u89c2
"},{"location":"basic-types/#2_12","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aEnumSelectConfig
"},{"location":"basic-types/#3_12","title":"3\u3001\u793a\u4f8b","text":"from enum import Enum\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.utils import qta_icon\nfrom pyguiadapter.widgets import EnumSelectConfig\n\n\nclass Weekday(Enum):\n MONDAY = 1\n TUESDAY = 2\n WEDNESDAY = 3\n THURSDAY = 4\n FRIDAY = 5\n SATURDAY = 6\n SUNDAY = 7\n\n\nclass Color(Enum):\n RED = 1\n GREEN = 2\n BLUE = 3\n\n\ndef enums_example(day_enums: Weekday, color_enums: Color = Color.GREEN):\n \"\"\"\n This is an example for type **enum** and **EnumSelect** widget.\n\n @param day_enums: Enums for week days\n @param color_enums: Enums for RGB colors\n @return:\n\n @params\n [day_enums]\n default_value = \"MONDAY\"\n icons = {\"MONDAY\"=\"mdi6.numeric-1-circle\", \"TUESDAY\"=\"mdi6.numeric-2-circle\"}\n\n @end\n\n \"\"\"\n uprint(day_enums)\n uprint(color_enums)\n\n\nif __name__ == \"__main__\":\n color_enums_conf = EnumSelectConfig(\n # this will override the default value defined in the function signature\n default_value=Color.BLUE,\n icons={\n # you can use the Enum value as the key to its icon\n \"RED\": qta_icon(\"mdi.invert-colors\", color=\"red\"),\n \"GREEN\": qta_icon(\"mdi.invert-colors\", color=\"green\"),\n \"BLUE\": qta_icon(\"mdi.invert-colors\", color=\"blue\"),\n # or you can use the Enum value itself as the key to its icon\n # Color.RED: qta_icon(\"mdi.invert-colors\", color=\"red\"),\n # Color.GREEN: qta_icon(\"mdi.invert-colors\", color=\"green\"),\n # Color.BLUE: qta_icon(\"mdi.invert-colors\", color=\"blue\"),\n },\n icon_size=(24, 24),\n )\n adapter = GUIAdapter()\n adapter.add(enums_example, widget_configs={\"color_enums\": color_enums_conf})\n adapter.run()\n
"},{"location":"basic-types/#typinganyobject","title":"\uff08\u5341\u4e09\uff09typing.Any
\u3001object
\u7c7b\u578b","text":""},{"location":"basic-types/#1_13","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" PyLiteralEdit
- \u5916\u89c2
"},{"location":"basic-types/#2_13","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aPyLiteralEditConfig
"},{"location":"basic-types/#3_13","title":"3\u3001\u793a\u4f8b","text":"from typing import Any, Union\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import PyLiteralEditConfig\n\n\ndef py_literal_example(arg1: Any, arg2: object, arg3: Union[int, str]):\n \"\"\"\n This is an example of **PyLiteralEdit** widget and **Any**, **object**, **Union** types\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n arg3: description of arg3\n\n Returns:\n None\n \"\"\"\n uprint(\"arg1: \", arg1, f\", type={type(arg1)}\")\n uprint(\"arg2: \", arg2, f\", type={type(arg2)}\")\n uprint(\"arg3: \", arg3, f\", type={type(arg3)}\")\n\n\nif __name__ == \"__main__\":\n # PyLiteralEdit support the PyLiteralType, which is a Union of:\n # bool, int, float, bytes, str, list, tuple, dict, set and NoneType.\n\n arg1_config = PyLiteralEditConfig(\n default_value=[1, 2, 3, 4],\n )\n arg2_config = PyLiteralEditConfig(\n default_value=(\"a\", \"b\", \"c\", \"d\"),\n )\n arg3_config = PyLiteralEditConfig(\n default_value={1, 2, 3},\n )\n adapter = GUIAdapter()\n adapter.add(\n py_literal_example,\n widget_configs={\n \"arg1\": arg1_config,\n \"arg2\": arg2_config,\n \"arg3\": arg3_config,\n },\n )\n adapter.run()\n
"},{"location":"cancel/","title":"\u53d6\u6d88\u51fd\u6570\u6267\u884c","text":""},{"location":"cancel/#_1","title":"\uff08\u4e00\uff09\u6982\u8ff0","text":"\u5728PyGUIAdapter
\u4e2d\uff0c\u5f00\u53d1\u8005\u7684\u51fd\u6570\u9ed8\u8ba4\u8fd0\u884c\u5728\u5355\u72ec\u7684\u4e00\u4e2a\u7ebf\u7a0b\u4e2d\uff08\u5f53\u524d\u7684\u5b9e\u73b0\uff09\uff0c\u8fd9\u6837\u7684\u8bbe\u8ba1\u4e3b\u8981\u662f\u4e3a\u4e86\u907f\u514d\u51fd\u6570\u957f\u65f6\u95f4\u6267\u884c\u963b\u585e\u4e3b\u7ebf\u7a0b\uff0c\u5bfc\u81f4\u754c\u9762\u5361\u6b7b\u3002\u5bf9\u4e8e\u957f\u65f6\u95f4\u8fd0\u884c\u7684\u51fd\u6570\uff0c\u5f00\u53d1\u8005\u53ef\u80fd\u5e0c\u671b\u8ba9\u7528\u6237\u5177\u5907\u53d6\u6d88\u771f\u6b63\u6267\u884c\u4e2d\u7684\u51fd\u6570\u7684\u80fd\u529b\u3002
\u4e3a\u4e86\u5b9e\u73b0\u53d6\u6d88\u51fd\u6570\u6267\u884c\u7684\u6548\u679c\uff0c\u4e00\u79cd\u7b80\u5355\u7c97\u66b4\u7684\u60f3\u6cd5\u662f\u76f4\u63a5\u7ec8\u7ed3\uff08terminate\uff09\u51fd\u6570\u8fd0\u884c\u7684\u90a3\u4e2a\u7ebf\u7a0b\uff0c\u4f46\u662f\u8fd9\u79cd\u505a\u6cd5\u5b58\u5728\u5f88\u5927\u7684\u9690\u60a3\uff0c\u8fd9\u79cd\u65b9\u6cd5\u65e0\u6cd5\u786e\u5b9a\u7ebf\u7a0b\u7ec8\u6b62\u65f6\u7684\u5177\u4f53\u72b6\u6001\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6570\u636e\u4e0d\u4e00\u81f4\u3001\u8d44\u6e90\u6cc4\u9732\u6216\u5176\u4ed6\u96be\u4ee5\u9884\u6d4b\u7684\u95ee\u9898\u3002\u6b63\u5e38\u7684\u505a\u6cd5\u662f\u901a\u8fc7\u8f6e\u8be2\u68c0\u67e5\u67d0\u4e2a\u6761\u4ef6\uff0c\u5728\u6ee1\u8db3\u6761\u4ef6\u65f6\u8ba9\u51fd\u6570\u8fd4\u56de\uff0c\u4ece\u800c\u8fbe\u5230\u7ebf\u7a0b\u6b63\u5e38\u7ed3\u675f\u7684\u6548\u679c\uff0cPyGUIAdapter
\u57fa\u4e8e\u8fd9\u4e00\u601d\u8def\uff0c\u5b9e\u73b0\u4e86\u4e00\u79cd\u79f0\u4e4b\u4e3a\u534f\u5546\u5f0f\u53d6\u6d88
\u7684\u51fd\u6570\u6267\u884c\u53d6\u6d88\u673a\u5236\u3002
\u6240\u8c13\u201c\u534f\u5546\u5f0f\u201d
\uff0c\u6307\u7684\u662f\u51fd\u6570\u7684\u53d6\u6d88\u5e76\u4e0d\u662f\u5fc5\u7136\u7684\uff0c\u7528\u6237\u53d6\u6d88\u51fd\u6570\u7684\u64cd\u4f5c\u88ab\u89c6\u4e3a\u4e00\u79cd\u201c\u8bf7\u6c42\u201d
\uff0c\u5f00\u53d1\u8005\u9700\u8981\u5728\u51fd\u6570\u4e2d\u624b\u52a8\u5904\u7406\u8fd9\u79cd\u8bf7\u6c42\uff0c\u5e76\u6839\u636e\u5177\u4f53\u7684\u60c5\u51b5\u505a\u51fa\u5904\u7406\u3002\u8fd9\u91cc\u8bf4\u7684\u5904\u7406\uff0c\u53ef\u4ee5\u662f\u201c\u540c\u610f\u8bf7\u6c42\uff0c\u7acb\u5373\u4ece\u51fd\u6570\u8fd4\u56de\u201d
\uff0c\u4e5f\u53ef\u4ee5\u662f\u201c\u540c\u610f\u8bf7\u6c42\uff0c\u6267\u884c\u67d0\u4e9b\u7279\u5b9a\u6b65\u9aa4\uff08\u6bd4\u5982\u8d44\u6e90\u6e05\u7406\uff09\u540e\u8fd4\u56de\u201d
\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u662f\u201c\u4e0d\u540c\u610f\u8bf7\u6c42\uff0c\u7ee7\u7eed\u6267\u884c\u51fd\u6570\u201d
\u3002\u6362\u8a00\u4e4b\uff0c\u7528\u6237\u5177\u6709\u53d6\u6d88\u51fd\u6570\u6267\u884c\u7684\u201c\u5efa\u8bae\u6743\u201d
\uff0c\u800c\u51fd\u6570\u662f\u5426\u53d6\u6d88\u7684\u201c\u51b3\u5b9a\u6743\u201d
\u4ecd\u7136\u5f52\u4e8e\u5f00\u53d1\u8005\u6216\u8005\u8bf4\u51fd\u6570\u672c\u8eab\u3002
"},{"location":"cancel/#_2","title":"\uff08\u4e8c\uff09\u65b9\u6cd5\u4e0e\u793a\u4f8b","text":"\u8981\u4f7f\u4e00\u4e2a\u51fd\u6570\u53ef\u4ee5\u88ab\u53d6\u6d88\uff0c\u9996\u5148\uff0c\u9700\u8981\u5728\u8c03\u7528GUIAdapter.add()
\u65f6\u4f20\u5165cancellable=True
\u3002\u6b64\u65f6\uff0c\u51fd\u6570\u6267\u884c\u7a97\u53e3\u7684\u64cd\u4f5c\u533a\u57df\u5c06\u663e\u793a\u4e00\u4e2a\u53d6\u6d88\u6309\u94ae\u3002\u7528\u6237\u901a\u8fc7\u6309\u4e0b\u6b64\u6309\u94ae\u6765\u5411\u51fd\u6570\u53d1\u51fa\u53d6\u6d88\u6267\u884c\u7684\u8bf7\u6c42\u3002
\u5728\u51fd\u6570\u4e2d\uff0c\u5f00\u53d1\u8005\u9700\u8981\u901a\u8fc7\u8c03\u7528ucontext.is_function_cancelled()
\u5b9a\u671f\u68c0\u67e5\u7528\u6237\u662f\u5426\u53d1\u51fa\u4e86\u53d6\u6d88\u51fd\u6570\u6267\u884c\u7684\u8bf7\u6c42\uff0c\u5e76\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u505a\u51fa\u5904\u7406\u3002
\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a
import time\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.ucontext import is_function_cancelled\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.windows.fnexec import FnExecuteWindowConfig\n\n\ndef cancel_function_example(target: int = 10, delay_per_iter: float = 0.5):\n \"\"\"\n @params\n [target]\n min_value = 1\n\n [delay_per_iter]\n min_value = 0.001\n step = 0.5\n decimals = 3\n\n @end\n \"\"\"\n for i in range(target):\n if is_function_cancelled():\n break\n uprint(\"process: \", i)\n time.sleep(delay_per_iter)\n uprint(\"done!\")\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n cancel_function_example,\n cancelable=True,\n window_config=FnExecuteWindowConfig(disable_widgets_on_execute=True),\n )\n adapter.run()\n
\u6548\u679c\u5982\u4e0b\uff1a
"},{"location":"custom-widget/","title":"WIP","text":""},{"location":"extend-types/","title":"\u6269\u5c55\u7c7b\u578b\u4e0e\u63a7\u4ef6","text":""},{"location":"extend-types/#text_t","title":"\uff08\u4e00\uff09text_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0","title":"0\u3001\u8bf4\u660e","text":"str
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u957f\u6587\u672c\uff08\u591a\u884c\u6587\u672c\uff09\u3002
"},{"location":"extend-types/#1","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" TextEdit
- \u5916\u89c2
"},{"location":"extend-types/#2","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aTextEditConfig
"},{"location":"extend-types/#3","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import text_t\nfrom pyguiadapter.widgets import TextEditConfig\n\n\ndef text_t_example(arg1: text_t, arg2: text_t, arg3: text_t = \"foo\") -> str:\n \"\"\"\n This is an example for **text_t** type hint and **TextEdit** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n @return:\n\n @params\n [arg1]\n default_value = \"Hello World\"\n\n [arg2]\n default_value = \"\u4f60\u597d\uff0c\u4e16\u754c\uff01\"\n\n @end\n \"\"\"\n assert isinstance(arg1, str)\n assert isinstance(arg2, str)\n assert isinstance(arg3, str)\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n return \"{};{};{}\".format(arg1, arg2, arg3)\n\n\nif __name__ == \"__main__\":\n\n arg3_conf = TextEditConfig(\n default_value=\"bar\",\n placeholder=\"Please input some text here!\",\n )\n\n adapter = GUIAdapter()\n adapter.add(\n text_t_example,\n widget_configs={\"arg3\": arg3_conf},\n )\n adapter.run()\n
"},{"location":"extend-types/#int_t","title":"\uff08\u4e8c\uff09int_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_1","title":"0\u3001\u8bf4\u660e","text":"int
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u7528\u4e8e\u63d0\u4f9bLineEdit
\u5f62\u5f0f\u7684\u8f93\u5165\u63a7\u4ef6\u3002
"},{"location":"extend-types/#1_1","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" IntLineEdit
- \u5916\u89c2
"},{"location":"extend-types/#2_1","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aIntLineEditConfig
"},{"location":"extend-types/#3_1","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import int_t\nfrom pyguiadapter.widgets import IntLineEditConfig\n\n\ndef int_t_example(arg1: int_t, arg2: int_t, arg3: int_t = 100) -> int:\n \"\"\"\n This is an example for **int_t** type hint and **IntLineEdit** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n @return:\n\n @params\n [arg1]\n default_value = -100\n min_value = -100\n max_value = 100\n\n [arg2]\n max_value = 999\n empty_value = -1\n\n @end\n \"\"\"\n assert isinstance(arg1, int)\n assert isinstance(arg2, int)\n assert isinstance(arg3, int)\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n return arg1 + arg2 + arg3\n\n\nif __name__ == \"__main__\":\n\n arg3_conf = IntLineEditConfig(\n default_value=-99,\n min_value=-100,\n max_value=100,\n empty_value=None,\n placeholder=\"Enter a number\",\n clear_button=True,\n )\n\n adapter = GUIAdapter()\n adapter.add(\n int_t_example,\n widget_configs={\"arg3\": arg3_conf},\n )\n adapter.run()\n
"},{"location":"extend-types/#float_t","title":"\uff08\u4e09\uff09float_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_2","title":"0\u3001\u8bf4\u660e","text":"float
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u7528\u4e8e\u63d0\u4f9bLineEdit
\u5f62\u5f0f\u7684\u8f93\u5165\u63a7\u4ef6\u3002
"},{"location":"extend-types/#1_2","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" FloatLineEdit
- \u5916\u89c2
"},{"location":"extend-types/#2_2","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aFloatLineEditConfig
"},{"location":"extend-types/#3_2","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import float_t\nfrom pyguiadapter.widgets import FloatLineEditConfig\n\n\ndef float_t_example(arg1: float_t, arg2: float_t, arg3: float_t = 100) -> float:\n \"\"\"\n This is an example for **float_t** type hint and **FloatLineEdit** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n @return:\n\n @params\n [arg1]\n default_value = -100.0\n min_value = -100.0\n max_value = 100.0\n\n [arg2]\n default_value = 99999999.0\n max_value = 99999999.0\n empty_value = -1.0\n decimals = 3\n scientific_notation = true\n\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n return arg1 + arg2 + arg3\n\n\nif __name__ == \"__main__\":\n\n arg3_conf = FloatLineEditConfig(\n default_value=-0.00005,\n min_value=-100.0,\n max_value=100.0,\n empty_value=None,\n decimals=5,\n scientific_notation=True,\n clear_button=True,\n placeholder=\"Enter a float value\",\n )\n\n adapter = GUIAdapter()\n adapter.add(\n float_t_example,\n widget_configs={\"arg3\": arg3_conf},\n )\n adapter.run()\n
"},{"location":"extend-types/#int_slider_t","title":"\uff08\u56db\uff09int_slider_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_3","title":"0\u3001\u8bf4\u660e","text":"int
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u7528\u4e8e\u63d0\u4f9bSlider\uff08\u6ed1\u52a8\u6761\uff09
\u5f62\u5f0f\u7684\u8f93\u5165\u63a7\u4ef6\u3002
"},{"location":"extend-types/#1_3","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" Slider
- \u5916\u89c2
"},{"location":"extend-types/#2_3","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aSliderConfig
"},{"location":"extend-types/#3_3","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import int_slider_t\nfrom pyguiadapter.widgets import SliderConfig\nfrom pyguiadapter.widgets.extend.slider import TickPosition\n\n\ndef int_slider_t_example(\n arg1: int_slider_t, arg2: int_slider_t, arg3: int_slider_t = 100\n) -> int:\n \"\"\"\n This is an example for **int_slider_t** type hint and **Slider** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n @return:\n\n @params\n [arg1]\n default_value = -100\n min_value = -100\n max_value = 100\n\n [arg2]\n max_value = 999\n single_step = 2\n tracking = false\n prefix = \"count: \"\n tick_interval = 10\n inverted_controls = true\n inverted_appearance = true\n\n @end\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n return arg1 + arg2 + arg3\n\n\nif __name__ == \"__main__\":\n\n arg3_conf = SliderConfig(\n default_value=-99,\n min_value=-100,\n max_value=100,\n tick_position=TickPosition.TicksAbove,\n tick_interval=2,\n single_step=1,\n page_step=10,\n suffix=\" mv\",\n )\n\n adapter = GUIAdapter()\n adapter.add(\n int_slider_t_example,\n widget_configs={\"arg3\": arg3_conf},\n )\n adapter.run()\n
"},{"location":"extend-types/#int_dial_t","title":"\uff08\u4e94\uff09int_dial_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_4","title":"0\u3001\u8bf4\u660e","text":"int
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u7528\u4e8e\u63d0\u4f9bDial\uff08\u62e8\u53f7\u76d8\uff09
\u5f62\u5f0f\u7684\u8f93\u5165\u63a7\u4ef6\u3002
"},{"location":"extend-types/#1_4","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" Dial
- \u5916\u89c2
"},{"location":"extend-types/#2_4","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aDialConfig
"},{"location":"extend-types/#3_4","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import int_dial_t\nfrom pyguiadapter.widgets import DialConfig\n\n\ndef int_dial_t_example(\n arg1: int_dial_t, arg2: int_dial_t, arg3: int_dial_t = 100\n) -> int:\n \"\"\"\n This is an example for **int_dial_t** type hint and **Dial** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n @return:\n\n @params\n [arg1]\n default_value = -100\n min_value = -100\n max_value = 100\n\n [arg2]\n max_value = 999\n single_step = 2\n tracking = false\n prefix = \"count: \"\n inverted_controls = true\n inverted_appearance = true\n\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n return arg1 + arg2 + arg3\n\n\nif __name__ == \"__main__\":\n\n arg3_conf = DialConfig(\n default_value=-99,\n min_value=-100,\n max_value=100,\n suffix=\" mv\",\n )\n\n adapter = GUIAdapter()\n adapter.add(int_dial_t_example, widget_configs={\"arg3\": arg3_conf})\n adapter.run()\n
"},{"location":"extend-types/#colot_hex_t","title":"\uff08\u516d\uff09colot_hex_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_5","title":"0\u3001\u8bf4\u660e","text":"str
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u989c\u8272\u503c\uff08\u5341\u516d\u8fdb\u5236\u5b57\u7b26\u4e32\uff09\u3002\u53ef\u4ee5\u8868\u793aRGB\u989c\u8272\u503c\uff0c\u5982#FFFFFF
\uff1b\u4e5f\u53ef\u4ee5\u8868\u793aRGBA\u989c\u8272\u503c\uff0c\u5982#FFFFFF80
\u3002
"},{"location":"extend-types/#1_5","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" ColorHexPicker
- \u5916\u89c2
"},{"location":"extend-types/#2_5","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aColorPickerConfig
"},{"location":"extend-types/#3_5","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import color_hex_t\nfrom pyguiadapter.widgets import ColorHexPickerConfig\n\n\ndef color_hex_t_example(\n arg1: color_hex_t,\n arg2: color_hex_t,\n arg3: color_hex_t = \"red\",\n):\n \"\"\"\n This is an example for type **color_hex_t** type hint and **ColorPicker** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg1]\n default_value = \"#aaffbb\"\n alpha_channel = false\n @end\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n arg2_conf = ColorHexPickerConfig(default_value=\"#effeedff\", alpha_channel=True)\n arg3_conf = ColorHexPickerConfig(display_color_name=False)\n adapter = GUIAdapter()\n adapter.add(\n color_hex_t_example, widget_configs={\"arg2\": arg2_conf, \"arg3\": arg3_conf}\n )\n adapter.run()\n
"},{"location":"extend-types/#colot_tuple_t","title":"\uff08\u4e03\uff09colot_tuple_t
\u7c7b\u578b","text":""},{"location":"extend-types/#1_6","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" ColorPicker
- \u5916\u89c2
"},{"location":"extend-types/#2_6","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aColorPickerConfig
"},{"location":"extend-types/#3_6","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import color_tuple_t\nfrom pyguiadapter.widgets import ColorTuplePickerConfig\n\n\ndef color_tuple_t_example(\n arg1: color_tuple_t,\n arg2: color_tuple_t,\n arg3: color_tuple_t = (125, 230, 156),\n):\n \"\"\"\n This is an example for type **color_tuple_t** type hint and **ColorPicker** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg1]\n default_value = [255,0, 126]\n alpha_channel = false\n @end\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n arg2_conf = ColorTuplePickerConfig(\n default_value=(25, 25, 25, 255), alpha_channel=True\n )\n arg3_conf = ColorTuplePickerConfig(display_color_name=False)\n adapter = GUIAdapter()\n adapter.add(\n color_tuple_t_example, widget_configs={\"arg2\": arg2_conf, \"arg3\": arg3_conf}\n )\n adapter.run()\n
"},{"location":"extend-types/#choice_t","title":"\uff08\u516b\uff09choice_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_6","title":"0\u3001\u8bf4\u660e","text":"object
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u7ec4\u786e\u5b9a\u5bf9\u8c61\u4e2d\u7684\u4e00\u4e2a\u5bf9\u8c61\uff0c\u63d0\u4f9bComboBox\uff08\u4e0b\u62c9\u5217\u8868\uff09
\u5f62\u5f0f\u7684\u8f93\u5165\u63a7\u4ef6\uff0c\u7528\u4e8e\u4ece\u4e00\u7ec4\u53ef\u9009\u9879\u4e2d\u9009\u62e9\u4efb\u610f\u4e00\u4e2a\u9009\u9879\u3002\u53ef\u9009\u9879\u53ef\u4ee5\u662f\u53ef\u4ee5\u5b9e\u73b0\u4e86__hash__
\u548c__eq__
\u65b9\u6cd5\u7684\u4efb\u4f55\u5bf9\u8c61\uff0c\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\u5b57\u7b26\u4e32\u3001\u6570\u5b57\u7b49\u3002
"},{"location":"extend-types/#1_7","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" ChoiceBox
- \u5916\u89c2
"},{"location":"extend-types/#2_7","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aChoiceBoxConfig
"},{"location":"extend-types/#3_7","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import choice_t\nfrom pyguiadapter.widgets import ChoiceBoxConfig\n\n\nclass MyObject(object):\n def __init__(self, name: str):\n self.name = name\n\n def __eq__(self, other):\n if not isinstance(other, MyObject):\n return False\n return self.name == other.name\n\n def __hash__(self):\n return hash(self.name)\n\n def __str__(self):\n # this method is very important\n # the return value will be displayed as the ChoiceBox's item\n return self.name\n\n\ndef choice_t_example(arg1: choice_t, arg2: choice_t, arg3: choice_t, arg4: choice_t):\n \"\"\"\n This is an example for type **choice_t** type hint and **ChoiceBox** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n @param arg4: description for arg4\n @return:\n\n @params\n [arg1]\n # choices can be a list of numbers\n choices = {\"A\"=1, \"B\"=2, \"C\"=3}\n\n @end\n \"\"\"\n uprint(\"arg1:\", arg1, f\", type: {type(arg1)}\")\n uprint(\"arg2:\", arg2, f\", type: {type(arg2)}\")\n uprint(\"arg3:\", arg3, f\", type: {type(arg3)}\")\n uprint(\"arg4:\", arg4, f\", type: {type(arg4)}\")\n\n\nif __name__ == \"__main__\":\n arg2_conf = ChoiceBoxConfig(\n default_value=\"opt2\",\n # choices can be a list of strings\n choices=[\"opt1\", \"opt2\", \"opt3\", \"opt4\"],\n editable=True,\n )\n\n obj1 = MyObject(\"apple\")\n obj2 = MyObject(\"banana\")\n obj3 = MyObject(\"orange\")\n\n arg3_conf = ChoiceBoxConfig(\n default_value=obj2,\n # choices can be a list of objects which have implemented __eq__ and __hash__ methods\n choices=[obj1, obj2, obj3],\n )\n\n arg4_conf = ChoiceBoxConfig(\n # choices can be a list of numbers\n choices={\"A\": 1, \"B\": 2, \"C\": 3},\n editable=True,\n add_user_input=False,\n )\n\n adapter = GUIAdapter()\n adapter.add(\n choice_t_example,\n widget_configs={\"arg2\": arg2_conf, \"arg3\": arg3_conf, \"arg4\": arg4_conf},\n )\n adapter.run()\n
"},{"location":"extend-types/#choices_t","title":"\uff08\u4e5d\uff09choices_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_7","title":"0\u3001\u8bf4\u660e","text":"list
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u7ec4\u53ef\u9009\u9879\u4e2d\u7684\u591a\u4e2a\u5bf9\u8c61\uff0c\u63d0\u4f9b\u4e00\u7ec4CheckBox\uff08\u590d\u9009\u6846\uff09
\u4f5c\u4e3a\u8f93\u5165\u63a7\u4ef6\uff0c\u7528\u4e8e\u4ece\u4e00\u7ec4\u53ef\u9009\u9879\u4e2d\u9009\u62e9\u591a\u4e2a\u9009\u9879\u3002\u53ef\u9009\u9879\u53ef\u4ee5\u662f\u53ef\u4ee5\u5b9e\u73b0\u4e86__hash__
\u548c__eq__
\u65b9\u6cd5\u7684\u4efb\u4f55\u5bf9\u8c61\uff0c\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\u5b57\u7b26\u4e32\u3001\u6570\u5b57\u7b49\u3002
"},{"location":"extend-types/#1_8","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" MultiChoiceBox
- \u5916\u89c2
"},{"location":"extend-types/#2_8","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aMultiChoiceBoxConfig
"},{"location":"extend-types/#3_8","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import choices_t\nfrom pyguiadapter.widgets import MultiChoiceBoxConfig\n\n\nclass MyObject(object):\n def __init__(self, name: str):\n self.name = name\n\n def __eq__(self, other):\n if not isinstance(other, MyObject):\n return False\n return self.name == other.name\n\n def __hash__(self):\n return hash(self.name)\n\n def __str__(self):\n # this method is very important\n # the return value will be displayed as the ChoiceBox's item\n return self.name\n\n\ndef choices_t_example(arg1: choices_t, arg2: choices_t, arg3: choices_t):\n \"\"\"\n This is an example for type **choices_t** type hint and **MultiChoiceBox** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg1]\n default_value = [\"opt1\", \"opt2\"]\n choices = [\"opt1\", \"opt2\", \"opt3\", \"opt4\", \"opt5\"]\n @end\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n arg2_conf = MultiChoiceBoxConfig(\n choices=[MyObject(\"foo\"), MyObject(\"bar\"), MyObject(\"baz\")]\n )\n arg3_conf = MultiChoiceBoxConfig(\n default_value=(1, 2, 3),\n choices={\n \"Option 1\": 1,\n \"Option 2\": 2,\n \"Option 3\": 3,\n \"Option 4\": 4,\n \"Option 5\": 5,\n },\n columns=2,\n )\n adapter = GUIAdapter()\n adapter.add(\n choices_t_example, widget_configs={\"arg2\": arg2_conf, \"arg3\": arg3_conf}\n )\n adapter.run()\n
"},{"location":"extend-types/#key_sequence_t","title":"\uff08\u5341\uff09key_sequence_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_8","title":"0\u3001\u8bf4\u660e","text":"str
\u6216List[str]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff08\u4ece\u63a7\u4ef6\u83b7\u53d6\u7684\u503c\u662fstr
\u7c7b\u578b\u8fd8\u662fList[str]
\u7c7b\u578b\uff0c\u7531KeySequenceEditConfig
\u7684return_type
\u5c5e\u6027\u51b3\u5b9a\uff09\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u6309\u952e\u5e8f\u5217\u3002
"},{"location":"extend-types/#1_9","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" KeySequenceEdit
- \u5916\u89c2
"},{"location":"extend-types/#2_9","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aKeySequenceEditConfig
"},{"location":"extend-types/#3_9","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import key_sequence_t\nfrom pyguiadapter.widgets import KeySequenceEditConfig, KeySequenceEdit\n\n\ndef key_sequence_t_example(\n arg1: key_sequence_t,\n arg2: key_sequence_t,\n arg3: key_sequence_t,\n):\n \"\"\"\n This is an example for type **key_sequence_t** type hint and **KeySequenceEdit** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg1]\n default_value = \"Ctrl+Shift+V\"\n\n @end\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n arg2_conf = KeySequenceEditConfig(default_value=\"Ctrl+Alt+D\")\n\n arg3_conf = KeySequenceEditConfig(\n default_value=\"Ctrl+Shift+T\",\n key_sequence_format=KeySequenceEdit.PortableText,\n return_type=\"list\",\n )\n adapter = GUIAdapter()\n adapter.add(\n key_sequence_t_example, widget_configs={\"arg2\": arg2_conf, \"arg3\": arg3_conf}\n )\n adapter.run()\n
"},{"location":"extend-types/#plain_dict_t","title":"\uff08\u5341\u4e00\uff09plain_dict_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_9","title":"0\u3001\u8bf4\u660e","text":"dict
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u666e\u901a\u5b57\u5178\uff0c\u6240\u8c13\u666e\u901a\u5b57\u5178\u662f\u6307\u952e\u503c\u5bf9\u7c7b\u578b\u6ee1\u8db3\uff1akey:str -> value: Union[str,int,float,bool,list,dict,None]\u7684\u5b57\u5178\u3002
"},{"location":"extend-types/#1_10","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" PlainDictEdit
- \u5916\u89c2
"},{"location":"extend-types/#2_10","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aPlainDictEditConfig
"},{"location":"extend-types/#3_10","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import PlainDictEditConfig\nfrom pyguiadapter.extend_types import plain_dict_t\n\n\ndef plain_dict_t_example(arg1: plain_dict_t, arg2: plain_dict_t, arg3: plain_dict_t):\n \"\"\"\n This is an example for type **plain_dict_t** type hint and **PlainDictEdit** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg3]\n default_value = {key1=1,key2=\"value\",key3=true,key4=[1,2,3.0]}\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1, \"type: \", type(arg1))\n uprint(\"arg2:\", arg2, \"type: \", type(arg2))\n uprint(\"arg3:\", arg3, \"type: \", type(arg3))\n\n\nif __name__ == \"__main__\":\n arg1_conf = PlainDictEditConfig(\n default_value={\n \"key1\": 1,\n \"key2\": \"value\",\n \"key3\": True,\n \"key4\": [1, 2, 3.0],\n \"key5\": None,\n \"key6\": {\"key7\": 1},\n }\n )\n arg2_conf = PlainDictEditConfig(\n default_value={\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer token123\",\n },\n key_header=\"Header\",\n value_header=\"Value\",\n vertical_header_visible=True,\n )\n adapter = GUIAdapter()\n adapter.add(\n plain_dict_t_example, widget_configs={\"arg1\": arg1_conf, \"arg2\": arg2_conf}\n )\n adapter.run()\n
"},{"location":"extend-types/#string_list_t","title":"\uff08\u5341\u4e8c\uff09string_list_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_10","title":"0\u3001\u8bf4\u660e","text":"List[str]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u5b57\u7b26\u4e32\u5217\u8868\u3002
"},{"location":"extend-types/#1_11","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" StringListEdit
- \u5916\u89c2
"},{"location":"extend-types/#2_11","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aStringListEditConfig
"},{"location":"extend-types/#3_11","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import StringListEditConfig\nfrom pyguiadapter.extend_types import string_list_t\n\n\ndef string_list_t_example(\n arg1: string_list_t,\n arg2: string_list_t,\n arg3: string_list_t,\n):\n \"\"\"\n This is an example for type **string_list_t** type hint and **StringListEdit** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg1]\n default_value = [\"a\", \"b\", \"c\", \"d\"]\n add_file = true\n add_dir = false\n file_filters = \"Python files(*.py);;Text files(*.txt)\"\n\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n arg2_conf = StringListEditConfig(add_file=False, add_dir=True)\n arg3_conf = StringListEditConfig(add_file=False, add_dir=False)\n adapter = GUIAdapter()\n adapter.add(\n string_list_t_example, widget_configs={\"arg2\": arg2_conf, \"arg3\": arg3_conf}\n )\n adapter.run()\n
"},{"location":"extend-types/#json_obj_t","title":"\uff08\u5341\u4e09\uff09json_obj_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_11","title":"0\u3001\u8bf4\u660e","text":"Union[str,int,float,bool,list,dict,None]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2aJSON\u5bf9\u8c61\u3002
"},{"location":"extend-types/#1_12","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" JsonEdit
- \u5916\u89c2
"},{"location":"extend-types/#2_12","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aJsonEditConfig
"},{"location":"extend-types/#3_12","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import JsonEditConfig\nfrom pyguiadapter.extend_types import json_obj_t\n\n\ndef json_obj_t_example(arg1: json_obj_t, arg2: json_obj_t, arg3: json_obj_t):\n \"\"\"\n This is an example for type **json_obj_t** type hint and **JsonEdit** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg3]\n default_value = true\n\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1, \"type: \", type(arg1))\n uprint(\"arg2:\", arg2, \"type: \", type(arg2))\n uprint(\"arg3:\", arg3, \"type: \", type(arg3))\n\n\nif __name__ == \"__main__\":\n arg1_conf = JsonEditConfig(default_value=[1, 2, 3, \"a\", \"b\", {\"a\": 1, \"b\": 2}])\n arg2_conf = JsonEditConfig(\n default_value={\"a\": 1, \"b\": 2},\n # height=0 or width=0 will make the inplace editor hidden.\n height=0,\n width=0,\n )\n adapter = GUIAdapter()\n adapter.add(\n json_obj_t_example, widget_configs={\"arg1\": arg1_conf, \"arg2\": arg2_conf}\n )\n adapter.run()\n
"},{"location":"extend-types/#directory_tdir_t","title":"\uff08\u5341\u56db\uff09directory_t
\u3001dir_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_12","title":"0\u3001\u8bf4\u660e","text":"str
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u76ee\u5f55\u8def\u5f84\u3002
"},{"location":"extend-types/#1_13","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" DirSelect
- \u5916\u89c2
"},{"location":"extend-types/#2_13","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aDirSelectConfig
"},{"location":"extend-types/#3_13","title":"3\u3001\u793a\u4f8b","text":"import os.path\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import directory_t, dir_t\nfrom pyguiadapter.widgets import DirSelectConfig\n\n\ndef directory_t_example(arg1: directory_t, arg2: directory_t, arg3: dir_t):\n \"\"\"\n This is an example for type **directory_t**(**dir_t**) type hint and **DirSelect** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg3]\n placeholder = \"select path\"\n dialog_title = \"Select Dir\"\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n arg1_conf = DirSelectConfig(\n placeholder=\"select save path\",\n dialog_title=\"Select Save Path\",\n )\n arg2_conf = DirSelectConfig(\n default_value=os.path.dirname(os.path.abspath(__file__)),\n start_dir=os.path.expanduser(\"~\"),\n clear_button=True,\n )\n adapter = GUIAdapter()\n adapter.add(\n directory_t_example, widget_configs={\"arg1\": arg1_conf, \"arg2\": arg2_conf}\n )\n adapter.run()\n
"},{"location":"extend-types/#file_t","title":"\uff08\u5341\u4e94\uff09file_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_13","title":"0\u3001\u8bf4\u660e","text":"str
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u6587\u4ef6\u8def\u5f84\u3002
"},{"location":"extend-types/#1_14","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" FileSelect
- \u5916\u89c2
"},{"location":"extend-types/#2_14","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aFileSelectConfig
"},{"location":"extend-types/#3_14","title":"3\u3001\u793a\u4f8b","text":"import os.path\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import FileSelectConfig\nfrom pyguiadapter.extend_types import file_t\n\n\ndef file_t_example(arg1: file_t, arg2: file_t, arg3: file_t):\n \"\"\"\n This is an example for type **file_t** type hint and **FileSelect** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg3]\n placeholder = \"input save path here\"\n save_file = true\n dialog_title = \"Save File\"\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n arg1_conf = FileSelectConfig(\n placeholder=\"input file path here\",\n filters=\"Text files(*.txt);;All files(*.*)\",\n dialog_title=\"Open File\",\n )\n arg2_conf = FileSelectConfig(\n default_value=os.path.abspath(__file__),\n start_dir=os.path.expanduser(\"~\"),\n clear_button=True,\n )\n adapter = GUIAdapter()\n adapter.add(file_t_example, widget_configs={\"arg1\": arg1_conf, \"arg2\": arg2_conf})\n adapter.run()\n
"},{"location":"extend-types/#files_t","title":"\uff08\u5341\u516d\uff09files_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_14","title":"0\u3001\u8bf4\u660e","text":"List[str]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u6587\u4ef6\u8def\u5f84\u5217\u8868\u3002
"},{"location":"extend-types/#1_15","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" MultiFileSelect
- \u5916\u89c2
"},{"location":"extend-types/#2_15","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aMultiFileSelectConfig
"},{"location":"extend-types/#3_15","title":"3\u3001\u793a\u4f8b","text":"import os.path\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.widgets import MultiFileSelectConfig\nfrom pyguiadapter.extend_types import files_t\n\n\ndef files_t_example(arg1: files_t, arg2: files_t, arg3: files_t):\n \"\"\"\n This is an example for type **files_t** type hint and **MultiFileSelect** widget.\n\n @param arg1: description for arg1\n @param arg2: description for arg2\n @param arg3: description for arg3\n\n @params\n [arg3]\n placeholder = \"select files\"\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n arg1_conf = MultiFileSelectConfig(\n default_value=(\"a\", \"b\"),\n placeholder=\"input files here\",\n filters=\"Text files(*.txt);;All files(*.*)\",\n dialog_title=\"Open Files\",\n )\n arg2_conf = MultiFileSelectConfig(\n default_value=[os.path.abspath(__file__)],\n start_dir=os.path.expanduser(\"~\"),\n clear_button=True,\n )\n adapter = GUIAdapter()\n adapter.add(files_t_example, widget_configs={\"arg1\": arg1_conf, \"arg2\": arg2_conf})\n adapter.run()\n
"},{"location":"extend-types/#path_list_t","title":"\uff08\u5341\u4e03\uff09path_list_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_15","title":"0\u3001\u8bf4\u660e","text":"List[str]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u8def\u5f84\u5217\u8868\uff0c\u652f\u6301\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u548c\u6587\u4ef6\u5939\u8def\u5f84\u3002
"},{"location":"extend-types/#1_16","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" PathListEdit
- \u5916\u89c2
"},{"location":"extend-types/#2_16","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aPathListEditConfig
"},{"location":"extend-types/#3_16","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import path_list_t\nfrom pyguiadapter.widgets import PathListEdit, PathListEditConfig\n\n\ndef path_list_t_example(arg1: path_list_t, arg2: path_list_t, arg3: path_list_t):\n \"\"\"\n This is an example for **path_list_t** type hint and **PathListEdit** widget.\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n arg3: description of arg3\n\n Returns:\n \"\"\"\n uprint(arg1)\n uprint(arg2)\n uprint(arg3)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n path_list_t_example,\n widget_configs={\n \"arg1\": PathListEditConfig(\n add_files=True,\n add_dirs=True,\n file_filters=\"Python Files (*.py);;Json Files (*.json)\",\n text_elide_mode=PathListEdit.ElideNone,\n drag_n_drop=True,\n ),\n \"arg2\": PathListEditConfig(\n add_files=True,\n add_dirs=False,\n file_filters=\"Python Files (*.py);;Json Files (*.json)\",\n text_elide_mode=PathListEdit.ElideRight,\n drag_n_drop=True,\n ),\n \"arg3\": PathListEditConfig(\n add_files=False,\n add_dirs=True,\n text_elide_mode=PathListEdit.ElideLeft,\n drag_n_drop=True,\n ),\n },\n )\n adapter.run()\n
"},{"location":"extend-types/#file_list_t","title":"\uff08\u5341\u516b\uff09file_list_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_16","title":"0\u3001\u8bf4\u660e","text":"List[str]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u8def\u5f84\u5217\u8868\uff0c\u652f\u6301\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u3002
"},{"location":"extend-types/#1_17","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" FileListEdit
- \u5916\u89c2
"},{"location":"extend-types/#2_17","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aFileListEditConfig
"},{"location":"extend-types/#3_17","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import file_list_t\nfrom pyguiadapter.widgets import FileListEditConfig, FileListEdit\n\n\ndef file_list_t_example(arg1: file_list_t, arg2: file_list_t, arg3: file_list_t):\n \"\"\"\n This is an example for **file_list_t** type hint and **FileListEdit** widget.\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n arg3: description of arg3\n\n Returns:\n \"\"\"\n uprint(arg1)\n uprint(arg2)\n uprint(arg3)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n file_list_t_example,\n widget_configs={\n \"arg1\": FileListEditConfig(\n file_filters=\"Python Files (*.py);;Json Files (*.json)\",\n text_elide_mode=FileListEdit.ElideNone,\n drag_n_drop=True,\n ),\n \"arg2\": FileListEditConfig(\n file_filters=\"Python Files (*.py);;Json Files (*.json)\",\n text_elide_mode=FileListEdit.ElideRight,\n drag_n_drop=True,\n ),\n \"arg3\": FileListEditConfig(\n text_elide_mode=FileListEdit.ElideLeft,\n drag_n_drop=True,\n ),\n },\n )\n adapter.run()\n
"},{"location":"extend-types/#dir_list_t","title":"\uff08\u5341\u4e5d\uff09dir_list_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_17","title":"0\u3001\u8bf4\u660e","text":"List[str]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u8def\u5f84\u5217\u8868\uff0c\u652f\u6301\u6dfb\u52a0\u6587\u4ef6\u5939\u8def\u5f84\u3002
"},{"location":"extend-types/#1_18","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" DirectoryListEdit
- \u5916\u89c2
"},{"location":"extend-types/#2_18","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aDirectoryListEditConfig
"},{"location":"extend-types/#3_18","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import dir_list_t\nfrom pyguiadapter.widgets import DirectoryListEditConfig, DirectoryListEdit\n\n\ndef dir_list_t_example(arg1: dir_list_t, arg2: dir_list_t, arg3: dir_list_t):\n \"\"\"\n This is an example for **dir_list_t** type hint and **DirectoryListEdit** widget.\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n arg3: description of arg3\n\n Returns:\n \"\"\"\n uprint(arg1)\n uprint(arg2)\n uprint(arg3)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n dir_list_t_example,\n widget_configs={\n \"arg1\": DirectoryListEditConfig(\n text_elide_mode=DirectoryListEdit.ElideNone,\n drag_n_drop=True,\n ),\n \"arg2\": DirectoryListEditConfig(\n text_elide_mode=DirectoryListEdit.ElideRight,\n drag_n_drop=True,\n ),\n \"arg3\": DirectoryListEditConfig(\n text_elide_mode=DirectoryListEdit.ElideLeft,\n drag_n_drop=True,\n ),\n },\n )\n adapter.run()\n
"},{"location":"extend-types/#font_t","title":"\uff08\u4e8c\u5341\uff09font_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_18","title":"0\u3001\u8bf4\u660e","text":"str
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u5b57\u4f53\u540d\u79f0\uff0c\u63d0\u4f9b\u4e0b\u62c9\u6846\u4f9b\u7528\u6237\u9009\u62e9\u5f53\u524d\u7cfb\u7edf\u5df2\u5b89\u88c5\u5b57\u4f53\u3002
"},{"location":"extend-types/#1_19","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" FontSelect
- \u5916\u89c2
"},{"location":"extend-types/#2_19","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aFontSelectConfig
"},{"location":"extend-types/#3_19","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import font_t\nfrom pyguiadapter.widgets import FontSelectConfig, FontSelect\n\n\ndef font_t_example(arg1: font_t, arg2: font_t, arg3: font_t):\n \"\"\"\n This is an example for **font_t** type hint and **FontSelect** widget.\n\n Args:\n arg1: description of arg1.\n arg2: description of arg2.\n arg3: description of arg3.\n \"\"\"\n uprint(\"arg1: \", arg1)\n uprint(\"arg2: \", arg2)\n uprint(\"arg3: \", arg3)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n font_t_example,\n widget_configs={\n \"arg1\": FontSelectConfig(\n default_value=\"Arial\",\n font_filters=FontSelect.MonospacedFonts,\n ),\n \"arg2\": FontSelectConfig(\n font_filters=FontSelect.ProportionalFonts,\n ),\n \"arg3\": FontSelectConfig(\n font_filters=FontSelect.MonospacedFonts | FontSelect.ProportionalFonts,\n ),\n },\n )\n adapter.run()\n
"},{"location":"extend-types/#int_quantity_t","title":"\uff08\u4e8c\u5341\u4e00\uff09int_quantity_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_19","title":"0\u3001\u8bf4\u660e","text":"tuple
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u5177\u4f53\u4e3a\u4e00\u4e2a\u4e8c\u5143\u7d20\u5143\u7ec4Tuple[int, str | None]
\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u6574\u6570\u578b\u7684\u6570\u91cf
\uff08\u6240\u8c13\u6570\u91cf\u5373\u5e26\u5355\u4f4d\u7684\u91cf\uff09\uff0c\u7b2c\u4e00\u4e2a\u5143\u7d20\u4e3a\u6570\u91cf\u7684\u503c\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20\u4e3a\u6570\u91cf\u7684\u5355\u4f4d\u3002\u5b9e\u73b0\u4e86\u4e13\u95e8\u7684\u8f93\u5165\u63a7\u4ef6\uff0c\u5141\u8bb8\u7528\u6237\u8f93\u5165\u6570\u91cf\u7684\u503c\u548c\u9009\u62e9\u6570\u91cf\u7684\u5355\u4f4d\u3002
"},{"location":"extend-types/#1_20","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" IntQuantityBox
- \u5916\u89c2
"},{"location":"extend-types/#2_20","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aIntQuantityBoxConfig
"},{"location":"extend-types/#3_20","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import int_quantity_t, float_quantity_t\nfrom pyguiadapter.widgets import IntQuantityBoxConfig, FloatQuantityBoxConfig\n\n\ndef quantity_t_example(arg1: int_quantity_t, arg2: float_quantity_t):\n \"\"\"\n This is an example about **xxx_quantity_t** type hint and **XXXQuantityBox** widget.\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n \"\"\"\n uprint(\"arg1: \", arg1)\n uprint(\"arg2: \", arg2)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n quantity_t_example,\n widget_configs={\n \"arg1\": IntQuantityBoxConfig(\n default_value=(1, \"kg\"),\n units=[\"kg\", \"g\", \"mg\", \"\u00b5g\", \"ng\", \"pg\"],\n min_value=0,\n step=1,\n ),\n \"arg2\": FloatQuantityBoxConfig(\n default_value=(1.0, \"m\"),\n units=[\"m\", \"cm\", \"mm\", \"\u00b5m\", \"nm\", \"pm\"],\n min_value=0.0,\n max_value=1000.0,\n decimals=5,\n step=0.00001,\n ),\n },\n )\n adapter.run()\n
"},{"location":"extend-types/#float_quantity_t","title":"\uff08\u4e8c\u5341\u4e8c\uff09float_quantity_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_20","title":"0\u3001\u8bf4\u660e","text":"tuple
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u5177\u4f53\u4e3a\u4e00\u4e2a\u4e8c\u5143\u7d20\u5143\u7ec4Tuple[float, str | None]
\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u6d6e\u70b9\u578b\u7684\u6570\u91cf
\uff08\u6240\u8c13\u6570\u91cf\u5373\u5e26\u5355\u4f4d\u7684\u91cf\uff09\uff0c\u7b2c\u4e00\u4e2a\u5143\u7d20\u4e3a\u6570\u91cf\u7684\u503c\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20\u4e3a\u6570\u91cf\u7684\u5355\u4f4d\u3002\u5b9e\u73b0\u4e86\u4e13\u95e8\u7684\u8f93\u5165\u63a7\u4ef6\uff0c\u5141\u8bb8\u7528\u6237\u8f93\u5165\u6570\u91cf\u7684\u503c\u548c\u9009\u62e9\u6570\u91cf\u7684\u5355\u4f4d\u3002
"},{"location":"extend-types/#1_21","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" FloatQuantityBox
- \u5916\u89c2
"},{"location":"extend-types/#2_21","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aFloatQuantityBoxConfig
"},{"location":"extend-types/#3_21","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import int_quantity_t, float_quantity_t\nfrom pyguiadapter.widgets import IntQuantityBoxConfig, FloatQuantityBoxConfig\n\n\ndef quantity_t_example(arg1: int_quantity_t, arg2: float_quantity_t):\n \"\"\"\n This is an example about **xxx_quantity_t** type hint and **XXXQuantityBox** widget.\n\n Args:\n arg1: description of arg1\n arg2: description of arg2\n \"\"\"\n uprint(\"arg1: \", arg1)\n uprint(\"arg2: \", arg2)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n quantity_t_example,\n widget_configs={\n \"arg1\": IntQuantityBoxConfig(\n default_value=(1, \"kg\"),\n units=[\"kg\", \"g\", \"mg\", \"\u00b5g\", \"ng\", \"pg\"],\n min_value=0,\n step=1,\n ),\n \"arg2\": FloatQuantityBoxConfig(\n default_value=(1.0, \"m\"),\n units=[\"m\", \"cm\", \"mm\", \"\u00b5m\", \"nm\", \"pm\"],\n min_value=0.0,\n max_value=1000.0,\n decimals=5,\n step=0.00001,\n ),\n },\n )\n adapter.run()\n
"},{"location":"extend-types/#paths_t","title":"\uff08\u4e8c\u5341\u4e09\uff09paths_t
\u7c7b\u578b","text":""},{"location":"extend-types/#0_21","title":"0\u3001\u8bf4\u660e","text":"List[str]
\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u8868\u793a\u4e00\u7ec4\u8def\u5f84\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u529f\u80fd\u4e30\u5bcc\u7684\u5916\u7f6e\u8def\u5f84\u7f16\u8f91\u5668\uff0c\u901a\u8fc7\u8be5\u7f16\u8f91\u5668\uff0c\u7528\u6237\u53ef\u4ee5\u65b9\u4fbf\u5730\u7ba1\u7406\u4e00\u7ec4\u8def\u5f84\uff0c\u5305\u62ec\u6dfb\u52a0\u3001\u5220\u9664\u4ee5\u53ca\u6539\u53d8\u8def\u5f84\u7684\u987a\u5e8f\u3002
\u5728\u529f\u80fd\u4e0a\uff0cpaths_t
\u5728\u8bed\u4e49\u4e0a\u4e0epath_list_t
\u7c7b\u578b\u76f8\u540c\u3002\u4e8c\u8005\u7684\u533a\u522b\u4e3b\u8981\u5728\u4e8e\u53c2\u6570\u63a7\u4ef6\u3002paths_t
\u5bf9\u5e94\u7684\u53c2\u6570\u63a7\u4ef6\u4e3aPathsEditor
\uff0c \u800cpath_list_t
\u5bf9\u5e94\u7684\u53c2\u6570\u63a7\u4ef6\u4e3aPathListEdit
\u3002
\u4e4b\u6240\u4ee5\u8981\u5b9e\u73b0PathsEditor
\uff0c\u4e3b\u8981\u662f\u4e3a\u4e86\u5f25\u8865PathListEdit
\u5360\u7528\u7a7a\u95f4\u8fc7\u5927\u3001\u957f\u8def\u5f84\u663e\u793a\u4e0d\u5168\uff08\u9700\u8981\u6eda\u52a8\u6761\uff09\u4ee5\u53ca\u8def\u5f84\u64cd\u4f5c\u4e0d\u591f\u7075\u6d3b\uff08\u5982\u6392\u5e8f\u4e0d\u65b9\u4fbf\uff09\u7b49\u4e0d\u8db3\u3002 PathsEditor
\u662f\u4e00\u4e2a\u5916\u7f6e\u7684\u8def\u5f84\u7f16\u8f91\u5668\uff0c\u5b83\u5728\u63a7\u4ef6\u53c2\u6570\u63a7\u4ef6\u533a\u57df\u4ec5\u663e\u793a\u4e3a\u4e00\u4e2a\u6309\u94ae\uff0c\u56e0\u6b64\u5360\u7528\u7684\u7a7a\u95f4\u66f4\u5c0f\u3002\u540c\u65f6\uff0c\u5bf9\u4e8e\u8def\u5f84\u7684\u6dfb\u52a0\u3001\u5220\u9664\u3001\u4fee\u6539\u3001\u6392\u5e8f\u7b49\u64cd\u4f5c\uff0c PathsEditor
\u4e5f\u63d0\u4f9b\u4e86\u66f4\u52a0\u53cb\u597d\u548c\u76f4\u89c2\u7684\u64cd\u4f5c\u903b\u8f91\u3002
\u4e0b\u9762\u662f\u4e00\u7ec4\u76f4\u89c2\u7684\u5bf9\u6bd4\uff1a
"},{"location":"extend-types/#1_22","title":"1\u3001\u9ed8\u8ba4\u63a7\u4ef6","text":" PathsEditor
- \u5916\u89c2
"},{"location":"extend-types/#2_22","title":"2\u3001\u53ef\u914d\u7f6e\u5c5e\u6027","text":"\u53c2\u89c1\u914d\u7f6e\u7c7b\uff1aPathsEditorConfig
"},{"location":"extend-types/#3_22","title":"3\u3001\u793a\u4f8b","text":"from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import paths_t\n\n\ndef paths_t_example(arg1: paths_t, arg2: paths_t, arg3: paths_t):\n \"\"\"\n This is an example for **PathsEditor** for **paths_t** types.\n\n Args:\n arg1: description of arg1.\n arg2: description of arg2.\n arg3: description of arg3.\n\n Returns:\n None.\n\n @params\n [arg1]\n default_value = [\"/path/to/file1.txt\", \"/path/to/file2.txt\"]\n\n [arg2]\n add_dir = false\n\n [arg3]\n add_file = false\n\n @end\n\n \"\"\"\n uprint(\"arg1:\", arg1)\n uprint(\"arg2:\", arg2)\n uprint(\"arg3:\", arg3)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(paths_t_example)\n adapter.run()\n
"},{"location":"icon_type/","title":"\u5173\u4e8e\u56fe\u6807","text":"\u5728PyGUIAdapter
\u4e2d\uff0c\u7edd\u5927\u591a\u6570\u9700\u8981\u5f00\u53d1\u8005\u63d0\u4f9b\u56fe\u6807\u7684\u5730\u65b9\uff0c\u90fd\u4f1a\u8981\u6c42\u5f00\u53d1\u8005\u4f20\u5165\u4e00\u4e2a\u7c7b\u578b\u4e3autils.IconType
\u7c7b\u578b\u7684\u5bf9\u8c61\u3002
\u5b9e\u9645\u4e0a\uff0cutils.IconType
\u662f\u4e00\u4e2a\u8054\u5408\u7c7b\u578b\u6216\u7c7b\u578b\u522b\u540d\uff0c\u5b83\u7b49\u4ef7\u4e8eUnion[str, Tuple[str, Union[list, dict]], QIcon, QPixmap, type(None)]
\u3002
PyGUIAdapter
\u5185\u90e8\u5c06\u901a\u8fc7utils.get_icon()
\u51fd\u6570\u5c06\u5f00\u53d1\u8005\u4f20\u5165\u8f6c\u5316\u4e3a\u5b9e\u9645\u7684QIcon
\u5bf9\u8c61\u3002
\u4e3a\u4e86\u65b9\u4fbf\u5f00\u53d1\u8005\u5feb\u901f\u5229\u7528\u73b0\u6709\u7684\u5b57\u4f53\u56fe\u6807\uff0c\u5982FontAwesome
\u3001Material Design Icons
\u7b49\uff0cPyGUIAdapter
\u96c6\u6210\u4e86qtawesome
\u5e93\u3002\u56e0\u6b64\u5728\u9700\u8981utils.IconType
\u7684\u573a\u5408\uff0c\u53ef\u4ee5\u4f20\u5165\u4e00\u4e2aqtawesome
\u652f\u6301\u7684\u56fe\u6807\u540d\u79f0\u5b57\u7b26\u4e32\u3002
\u53ef\u4ee5\u901a\u8fc7qtawesome
\u63d0\u4f9b\u7684\u56fe\u6807\u6d4f\u89c8\u5de5\u5177qta-browser
\u6765\u6d4f\u89c8\u548c\u590d\u5236\u5176\u6240\u652f\u6301\u7684\u56fe\u6807\u3002\u53ef\u4ee5\u901a\u8fc7\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u542f\u52a8qta-browser
\u5de5\u5177
qta-browser\n
\u5176\u754c\u9762\u5982\u4e0b\uff1a
\u5f00\u53d1\u8005\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4f20\u5165\u56fe\u6807\u6587\u4ef6\u7684\u8def\u5f84\uff0c\u5982\"/path/to/icon/icon.png\"
\uff0c\u6216\u8005Qt\u8d44\u6e90\u6587\u4ef6\uff08qrc
\uff09\u6587\u4ef6\u4e2d\u56fe\u6807\u7684\u8def\u5f84\uff0c\u5982\uff1a\":/path/to/icon/icon.png\"
\u3002
\u5f53\u4f20\u5165\u503c\u4e3aTuple[str, list|tuple]
\u7c7b\u578b\u65f6\uff0c\u60c5\u51b5\u66f4\u52a0\u590d\u6742\u4e00\u4e9b\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u7b2c\u4e00\u4e2a\u5143\u7d20\u5e94\u5f53\u662fqtawesome
\u652f\u6301\u7684\u56fe\u6807\u540d\u79f0\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20\u5219\u662fqtawesome.icon()
\u51fd\u6570\u7b2c\u4e00\u4e2a\u53c2\u6570\u4e4b\u540e\u7684\u5269\u4f59\u53c2\u6570\u3002\u4f8b\u5982\u5bf9\u4e8e\u4e0b\u9762\u793a\u4f8b\u4e2d\u7684my_icon
icon_options = {\n \"color\": \"blue\",\n \"color_active\": \"orange\"\n}\nmy_icon = (\"fa5s.music\", icon_options)\n
utils.get_icon()
\u5c06\u6309\u7167\u5982\u4e0b\u65b9\u5f0f\u8fdb\u884c\u5904\u7406\uff1a
import qtawesome as qta\n\ndef get_icon(src: IconType, *args, **kwargs) -> QIcon | None:\n ...\n if isinstance(src, tuple):\n assert len(src) >= 2\n assert isinstance(src[0], str) and isinstance(src[1], (dict, list))\n if isinstance(src[1], dict):\n return qta.icon(src[0], **src[1])\n else:\n return qta.icon(src[0], *src[1])\n else:\n raise ValueError(f\"invalid icon type: {type(src)}\")\n
utils.get_icon()
\u51fd\u6570\u7684\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a
def get_icon(src: IconType, *args, **kwargs) -> Optional[QIcon]:\n if src is None:\n return None\n if isinstance(src, QIcon):\n return src\n if isinstance(src, QPixmap):\n return QIcon(src)\n if isinstance(src, str):\n if os.path.isfile(src) or src.startswith(\":/\"):\n return QIcon(src)\n return qta.icon(src, *args, **kwargs)\n if isinstance(src, tuple):\n assert len(src) >= 2\n assert isinstance(src[0], str) and isinstance(src[1], (dict, list))\n if isinstance(src[1], dict):\n return qta.icon(src[0], **src[1])\n else:\n return qta.icon(src[0], *src[1])\n else:\n raise ValueError(f\"invalid icon type: {type(src)}\")\n
"},{"location":"license/","title":"\u5f00\u6e90\u8bb8\u53ef","text":"PyGUIAdapter
\u4f7f\u7528MIT
\u8bb8\u53ef\u534f\u8bae\u53d1\u5e03\u3002\u5f97\u76ca\u4e8eqtpy
\u7684\u62bd\u8c61\u80fd\u529b\uff0cPyGUIAdapter
\u672c\u8eab\u5e76\u4e0d\u4f9d\u8d56\u7279\u5b9aQt\u7ed1\u5b9a\u5e93\u3002 \u5f00\u53d1\u8005\u5728\u4f7f\u7528PyGUIAdapter
\u5f00\u53d1\u5e94\u7528\u7a0b\u5e8f\u65f6\uff0c\u82e5\u4f9d\u8d56\u7279\u5b9a\u7684Qt\u7ed1\u5b9a\u5e93\uff0c\u8fd8\u9700\u9075\u5b88\u6240\u9009\u7ed1\u5b9a\u5e93\u7684\u8bb8\u53ef\u534f\u8bae\u3002\u4f8b\u5982\uff1a
- \u82e5\u5f00\u53d1\u8005\u9009\u62e9\u4f7f\u7528
PySide2
\uff0c\u5219\u5176\u987b\u9075\u5b88LGPL
\uff08\u5177\u4f53\u4ee5\u968f\u9644\u7684\u8bb8\u53ef\u534f\u8bae\u4e3a\u51c6\uff09\u3002 - \u82e5\u5f00\u53d1\u8005\u9009\u62e9\u4f7f\u7528
PyQt5
\uff0c\u5219\u5176\u987b\u9075\u5b88GPL
\uff08\u5177\u4f53\u4ee5\u968f\u9644\u7684\u8bb8\u53ef\u534f\u8bae\u4e3a\u51c6\uff09\u3002
\u534f\u8bae\u94fe\u63a5\uff1aMIT\u3002
"},{"location":"menu/","title":"\u7a97\u53e3\u83dc\u5355\u680f","text":""},{"location":"menu/#_1","title":"\uff08\u4e00\uff09\u6982\u8ff0","text":"\u83dc\u5355\u680f\u7531\u4e00\u7ec4\u83dc\u5355\uff08Menu
\uff09\u7ec4\u6210\uff0c\u6bcf\u4e2a\u83dc\u5355\u4e0b\u53ef\u4ee5\u6dfb\u52a0\u82e5\u5e72\u83dc\u5355\u9879\uff08Action
\uff09\u6216\u5b50\u83dc\u5355\uff08Menu
\uff09\uff0c\u4e2d\u95f4\u53ef\u4ee5\u6dfb\u52a0\u5206\u9694\u7b26\uff08Separator
\uff09\u52a0\u4ee5\u5206\u9694\u3002
\u83dc\u5355\u680f\u7684\u5178\u578b\u5916\u89c2\u5982\u4e0b\u56fe\u6240\u793a\uff1a
\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7Menu\u7c7b\u5bf9\u8c61\u6765\u5b9a\u4e49\u83dc\u5355\u7684\u5c5e\u6027\uff0c\u5305\u62ec\u6307\u5b9a\u83dc\u5355\u7684\u6807\u9898\u3001\u662f\u5426\u5408\u5e76\u8fde\u7eed\u7684\u5206\u9694\u7b26\u3001\u83dc\u5355\u662f\u5426\u53ef\u88ab\"tear-off\"\u4ee5\u53ca\u8be5\u83dc\u5355\u4e0b\u5305\u542b\u7684\u83dc\u5355\u9879\uff08Action
\uff09\u6216\u5b50\u83dc\u5355\uff08Menu
\uff09\u3002\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u65b9\u5f0f\u5bfc\u5165Menu
\u7c7b
from pyguiadapter.menu import Menu\n
\u5173\u4e8eMenu
\u5bf9\u8c61\u7684\u8be6\u7ec6\u8bf4\u660e\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.menu.Menu
"},{"location":"menu/#_2","title":"\uff08\u4e8c\uff09\u4e3b\u8981\u5c5e\u6027","text":"\u5728\u83dc\u5355\u680f\u4e0a\uff0c\u83dc\u5355\u9879\u4f7f\u7528\u52a8\u4f5c\uff08Action\uff09
\u5b9a\u4e49\uff0c\u52a8\u4f5c\uff08Action\uff09
\u53ef\u4ee5\u8bbe\u7f6e\u56fe\u6807\uff08icon
\uff09\u3001\u6587\u5b57\uff08text
\uff09\u3001\u5feb\u6377\u952e\uff08shortcut
\uff09\u7b49\u5c5e\u6027\uff0c\u4e5f\u53ef\u4ee5\u8bbe\u7f6eon_triggered
\u3001on_toggled
\u7b49\u4e8b\u4ef6\u76d1\u542c\u5668\u3002\u5173\u4e8eAction
\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.action.Action
\u5728\u83dc\u5355\u680f\u4e0a\uff0c\u5b50\u83dc\u5355\u4f7f\u7528Menu
\u7c7b\u672c\u8eab\u8fdb\u884c\u5b9a\u4e49\u3002
\u83dc\u5355\u9879\u4e92\u65a5\u7684\u6548\u679c\u5982\u4e0b\u56fe\u6240\u793a\uff1a
"},{"location":"menu/#pyguiadapter.menu.Menu.title","title":"title: str
instance-attribute
","text":"\u83dc\u5355\u7684\u6807\u9898\u3002
"},{"location":"menu/#pyguiadapter.menu.Menu.actions","title":"actions: List[Union[Action, Separator, Menu]]
instance-attribute
","text":"\u83dc\u5355\u4e0b\u7684\u83dc\u5355\u9879\uff08Action
\uff09\u3001\u5206\u9694\u7b26\uff08Separator
\uff09\u6216\u5b50\u83dc\u5355\uff08Menu
\uff09
"},{"location":"menu/#pyguiadapter.menu.Menu.separators_collapsible","title":"separators_collapsible: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8fde\u7eed\u7684\u5206\u9694\u7b26\u5408\u5e76\u3002\u4e3aTrue
\u65f6\u8fde\u7eed\u5206\u9694\u7b26\u5c06\u88ab\u5408\u5e76\u4e3a\u4e00\u4e2a\uff0c\u540c\u65f6\uff0c\u4f4d\u4e8e\u83dc\u5355\u5f00\u5934\u6216\u7ed3\u5c3e\u7684\u5206\u9694\u7b26\u4e5f\u4f1a\u88ab\u9690\u85cf\u3002
"},{"location":"menu/#pyguiadapter.menu.Menu.tear_off_enabled","title":"tear_off_enabled: bool = True
class-attribute
instance-attribute
","text":"\u83dc\u5355\u53ef\u4ee5\u88ab\u201c\u6495\u4e0b\u201d\u3002\u4e3aTrue
\u65f6\uff0c\u83dc\u5355\u5c06\u5305\u542b\u4e00\u4e2a\u7279\u6b8a\u7684\u201c\u6495\u4e0b\u201d\u9879\uff08\u901a\u5e38\u663e\u793a\u4e3a\u83dc\u5355\u9876\u90e8\u7684\u865a\u7ebf\uff09\uff0c\u5f53\u89e6\u53d1\u5b83\u65f6\uff0c\u4f1a\u521b\u5efa\u4e00\u4e2a\u83dc\u5355\u7684\u526f\u672c\u3002\u8fd9\u4e2a\u201c\u6495\u4e0b\u201d\u7684\u526f\u672c \u4f1a\u5b58\u5728\u4e8e\u4e00\u4e2a\u5355\u72ec\u7684\u7a97\u53e3\u4e2d\uff0c\u5e76\u4e14\u5305\u542b\u4e0e\u539f\u59cb\u83dc\u5355\u76f8\u540c\u7684\u83dc\u5355\u9879\u3002
"},{"location":"menu/#pyguiadapter.menu.Menu.exclusive","title":"exclusive: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u83dc\u5355\u4e0b\u7684\u83dc\u5355\u9879\uff08Action
\uff09\u6dfb\u52a0\u5230\u4e00\u4e2a\u4e92\u65a5\u7ec4\u4e2d\u3002\u53ea\u6709\u5f53\u524d\u83dc\u5355\u4e0bcheckable
\u5c5e\u6027\u4e3aTrue
\u7684\u83dc\u5355\u9879\uff08Action
\uff09\u624d\u4f1a\u88ab\u6dfb\u52a0\u7684\u4e92\u65a5\u7ec4\u4e2d\u3002
"},{"location":"menu/#_3","title":"\uff08\u4e09\uff09\u793a\u4f8b","text":""},{"location":"menu/#11","title":"1\u3001\u793a\u4f8b1","text":"import json\n\nfrom pyguiadapter.action import Action, Separator\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.menu import Menu\nfrom pyguiadapter.utils import filedialog, inputdialog, messagebox\nfrom pyguiadapter.window import SimpleWindowEventListener\nfrom pyguiadapter.windows.fnselect import FnSelectWindow\n\n\ndef menu_example():\n pass\n\n\n############Action Callbacks##########\ndef on_action_open(window: FnSelectWindow, _: Action):\n print(\"on_action_open()\")\n ret = filedialog.get_open_file(\n parent=window,\n title=\"Open File\",\n start_dir=\"./\",\n filters=\"JSON files(*.json);;All files(*.*)\",\n )\n if ret:\n messagebox.show_info_message(window, f\"File will be opened: {ret}\")\n\n\ndef on_action_save(window: FnSelectWindow, _: Action):\n print(\"on_action_save()\")\n ret = filedialog.get_save_file(\n parent=window,\n title=\"Save File\",\n start_dir=\"./\",\n filters=\"JSON files(*.json);;All files(*.*)\",\n )\n if ret:\n messagebox.show_info_message(window, f\"File will be saved to: {ret}\")\n\n\ndef on_action_settings(window: FnSelectWindow, _: Action):\n default_settings = {\n \"opt1\": 1,\n \"opt2\": \"2\",\n \"opt3\": True,\n }\n new_settings = inputdialog.input_json_object(\n parent=window,\n title=\"Settings\",\n icon=\"fa.cog\",\n size=(600, 400),\n ok_button_text=\"Save\",\n cancel_button_text=\"Cancel\",\n initial_text=json.dumps(default_settings, indent=4, ensure_ascii=False),\n auto_indent=True,\n indent_size=4,\n auto_parentheses=True,\n line_wrap_mode=inputdialog.LineWrapMode.WidgetWidth,\n line_wrap_width=88,\n )\n if isinstance(new_settings, dict):\n messagebox.show_info_message(window, f\"new settings: {new_settings}\")\n\n\ndef on_action_confirm_quit(window: FnSelectWindow, action: Action, checked: bool):\n print(\"on_action_confirm_close(): \", checked)\n\n\ndef on_action_close(window: FnSelectWindow, _: Action):\n print(\"on_action_close()\")\n window.close()\n\n\ndef on_action_about(window: FnSelectWindow, _: Action):\n print(\"on_action_about()\")\n\n\n###############################\n\n\nif __name__ == \"__main__\":\n action_open = Action(\n text=\"Open\",\n icon=\"fa.folder-open\",\n on_triggered=on_action_open,\n shortcut=\"Ctrl+O\",\n )\n action_save = Action(\n text=\"Save\",\n icon=\"fa.save\",\n on_triggered=on_action_save,\n shortcut=\"Ctrl+S\",\n )\n\n action_settings = Action(\n text=\"Settings\",\n icon=\"fa.cog\",\n on_triggered=on_action_settings,\n shortcut=\"Ctrl+,\",\n )\n\n action_quit = Action(\n text=\"Quit\",\n icon=\"fa.power-off\",\n on_triggered=on_action_close,\n shortcut=\"Ctrl+Q\",\n )\n action_confirm_quit = Action(\n text=\"Confirm Quit\",\n checkable=True,\n checked=False,\n on_toggled=on_action_confirm_quit,\n )\n\n def on_window_create(window: FnSelectWindow):\n print(\"on_window_create()\")\n # make action_confirm_quit checked after the select window is created\n window.set_action_state(action_confirm_quit, True)\n\n def on_window_close(window: FnSelectWindow) -> bool:\n # get the state of action_confirm_quit\n # if it is checked, show a question message box to ask if the user really wants to close the window\n # if it is not checked, return True to close the window directly.\n state = window.get_action_state(action_confirm_quit)\n if state:\n # access the\n ret = messagebox.show_question_message(\n window,\n message=\"Do you really want to close the window?\",\n title=\"Quit\",\n buttons=messagebox.Yes | messagebox.No,\n )\n return ret == messagebox.Yes\n return True\n\n window_listener = SimpleWindowEventListener(\n on_create=on_window_create, on_close=on_window_close\n )\n\n menus = [\n Menu(\n title=\"File\",\n actions=[\n action_open,\n action_save,\n Separator(),\n action_confirm_quit,\n action_quit,\n ],\n ),\n Menu(title=\"Help\", actions=[action_settings]),\n ]\n\n adapter = GUIAdapter()\n adapter.add(menu_example, window_menus=menus, window_listener=window_listener)\n adapter.run()\n
"},{"location":"menu/#22","title":"2\u3001\u793a\u4f8b2\uff1a\u901a\u8fc7\u4e92\u65a5\u83dc\u5355\u9879\u5b9e\u73b0\u4e3b\u9898\u5207\u6362\u6548\u679c","text":"\u4ee5\u4e0b\u793a\u4f8b\u7528\u5230\u4e86\u7b2c\u4e09\u65b9\u5e93PyQtDarkTheme
\uff0c\u8fd0\u884c\u8be5\u793a\u4f8b\u9700\u5148\u5b89\u88c5\u8be5\u5e93\uff0c\u53ef\u4ee5\u53c2\u8003\u8fd9\u7bc7\u6587\u6863\uff1a\u754c\u9762\u7f8e\u5316\u3002
import qdarktheme\n\nfrom pyguiadapter.action import Action\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.menu import Menu\nfrom pyguiadapter.windows.fnselect import FnSelectWindow\n\n\ndef exclusive_action_example():\n pass\n\n\ndef on_app_start(app):\n qdarktheme.setup_theme(\"auto\")\n\n\ndef on_action_auto(win: FnSelectWindow, action: Action, checked: bool):\n if checked:\n qdarktheme.setup_theme(\"auto\")\n\n\ndef on_action_light(win: FnSelectWindow, action: Action, checked: bool):\n if checked:\n qdarktheme.setup_theme(\"light\")\n\n\ndef on_action_dark(win: FnSelectWindow, action: Action, checked: bool):\n if checked:\n qdarktheme.setup_theme(\"dark\")\n\n\naction_auto = Action(\n text=\"auto\",\n on_toggled=on_action_auto,\n checkable=True,\n checked=True,\n)\n\naction_light = Action(\n text=\"light\",\n on_toggled=on_action_light,\n checkable=True,\n)\n\naction_dark = Action(\n text=\"dark\",\n on_toggled=on_action_dark,\n checkable=True,\n)\n\nmenu_theme = Menu(\n title=\"Theme\",\n actions=[action_auto, action_light, action_dark],\n exclusive=True,\n)\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter(on_app_start=on_app_start)\n adapter.add(exclusive_action_example)\n adapter.run(show_select_window=True, select_window_menus=[menu_theme])\n
"},{"location":"multiple-functions/","title":"\u6dfb\u52a0\u591a\u4e2a\u51fd\u6570","text":""},{"location":"multiple-functions/#_1","title":"\uff08\u4e00\uff09\u6982\u8ff0","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u5411 GUIAdapter
\u5b9e\u4f8b\u4e2d\u6dfb\u52a0\u591a\u4e2a\u51fd\u6570\uff0c\u5728\u6b64\u60c5\u51b5\u4e0b\uff0cPyGUIAdapter
\u5c06\u663e\u793a\u4e00\u4e2a\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\uff0c\u5e76\u4ee5\u5217\u8868\u7684\u5f62\u5f0f\u5c55\u73b0\u6240\u6709\u5df2\u6dfb\u52a0\u7684\u51fd\u6570\uff0c\u4f9b\u7528\u6237\u9009\u62e9\u3002\u5728\u51fd\u6570\u5217\u8868\u4e2d\uff0c\u5c06\u663e\u793a\u51fd\u6570\u56fe\u6807\u4e0e\u540d\u79f0\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5bf9\u56fe\u6807\u4e0e\u51fd\u6570\u7684\u663e\u793a\u540d\u79f0\u8fdb\u884c\u81ea\u5b9a\u4e49\u3002\u540c\u65f6\uff0c\u5728\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\u7684\u53f3\u4fa7\uff0c\u5c06\u901a\u8fc7\u6587\u6863\u6d4f\u89c8\u5668\uff08Document Browser\uff09
\u663e\u793a\u5f53\u524d\u9009\u4e2d\u51fd\u6570\u7684\u8bf4\u660e\u6587\u6863\u3002
\u7528\u6237\u53ef\u901a\u8fc7\u53cc\u51fb\u51fd\u6570\u5217\u8868\u4e2d\u7684\u6761\u76ee\u6216\u8005\u70b9\u51fb\u9009\u62e9\u6309\u94ae\uff08Select\uff09
\u6253\u5f00\u76ee\u6807\u51fd\u6570\u7684\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow
\uff09\u3002
\u540c\u65f6\uff0cPyGUIAdapter
\u652f\u6301\u51fd\u6570\u5206\u7ec4\u529f\u80fd\uff0c\u5728\u51fd\u6570\u8f83\u591a\u65f6\uff0c\u4f7f\u7528\u8be5\u529f\u80fd\u53ef\u4ee5\u4f7f\u754c\u9762\u66f4\u52a0\u7b80\u6d01\u3001\u76f4\u89c2\u3002
\u4e0b\u9762\uff0c\u56f4\u7ed5GUIAdapter.add()
\u51fd\u6570\u5bf9\u4e0a\u9762\u63d0\u5230\u7684\u529f\u80fd\u8fdb\u884c\u8be6\u7ec6\u8bf4\u660e\u3002
"},{"location":"multiple-functions/#_2","title":"\uff08\u4e8c\uff09\u6dfb\u52a0\u591a\u4e2a\u51fd\u6570","text":"\u5728\u8c03\u7528GUIAdapter.run()
\u51fd\u6570\u524d\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7\u591a\u6b21\u8c03\u7528GUIAdapter.add()
\u5c06\u591a\u4e2a\u51fd\u6570\u6dfb\u52a0\u5230GUIAdapter
\u5b9e\u4f8b\u4e2d\uff1a
examples/multiple_function_example.py
from pyguiadapter.adapter import GUIAdapter\n\n\ndef function_1(arg: int):\n \"\"\"\n description of function_1\n \"\"\"\n pass\n\n\ndef function_2(arg: int):\n \"\"\"\n description of function_2\n \"\"\"\n pass\n\n\ndef function_3(arg: int):\n \"\"\"\n description of function_3\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(function_1)\n adapter.add(function_2)\n adapter.add(function_3)\n adapter.run()\n
\u6240\u6709\u6dfb\u52a0\u5230GUIAdapter
\u5b9e\u4f8b\u4e2d\u7684\u51fd\u6570\u90fd\u4f1a\u663e\u793a\u5728\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\u5de6\u4fa7\u7684\u51fd\u6570\u5217\u8868\u4e2d\u3002\u51fd\u6570\u5217\u8868\u5c06\u540c\u65f6\u663e\u793a\u51fd\u6570\u7684\u540d\u79f0\u53ca\u56fe\u6807\uff0c\u5982\u679c\u6ca1\u6709\u663e\u5f0f\u5730\u6307\u5b9a\u51fd\u6570\u7684\u56fe\u6807\u548c\u540d\u79f0\uff0cPyGUIAadpter
\u5c06\u4f7f\u7528\u9ed8\u8ba4\u7684\u56fe\u6807\uff0c\u663e\u793a\u7684\u540d\u79f0\u5219\u4e3a\u51fd\u6570\u540d\u3002
\u5f53\u7528\u6237\u9009\u4e2d\u51fd\u6570\u5217\u8868\u4e2d\u7684\u67d0\u4e2a\u6761\u76ee\uff0c\u53cc\u51fb\u5b83\u6216\u8005\u70b9\u51fb\u53f3\u4e0b\u65b9\u7684Select
\u6309\u94ae\uff0c\u5373\u53ef\u8fdb\u5165\u5bf9\u5e94\u7684\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow\uff09
\u3002\u5f53\u7528\u6237\u5173\u95ed\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnSelectWindow\uff09
\uff0c\u5c06\u56de\u5230\u51fd\u6570\u9009\u62e9\u754c\u9762\u3002
"},{"location":"multiple-functions/#icondisplay_name","title":"\uff08\u4e09\uff09\u81ea\u5b9a\u4e49\u51fd\u6570\u56fe\u6807\uff08icon
\uff09\u53ca\u540d\u79f0\uff08display_name
\uff09","text":"PyGUIAdapter
\u5141\u8bb8\u5f00\u53d1\u8005\u5bf9\u51fd\u6570\u7684\u56fe\u6807\uff08icon
\uff09\u53ca\u5176\u663e\u793a\u540d\u79f0\uff08display_name
\uff09\u8fdb\u884c\u81ea\u5b9a\u4e49\u3002\u4e3a\u51fd\u6570\u8bbe\u7f6e\u72ec\u7279\u7684\u56fe\u6807\uff0c\u8d4b\u4e88\u51fd\u6570\u4e00\u4e2a\u66f4\u5177\u53ef\u8bfb\u6027\u7684\u540d\u79f0\uff0c\u5c06\u6709\u52a9\u4e8e\u63d0\u9ad8\u754c\u9762\u7684\u89c2\u611f\u5e76\u589e\u5f3a\u7528\u6237\u7684\u4f53\u9a8c\u3002
examples/custom_icon_and_name_example.py
from pyguiadapter.adapter import GUIAdapter\n\n\ndef function_1(arg: int):\n \"\"\"\n description of function_1\n \"\"\"\n pass\n\n\ndef function_2(arg: int):\n \"\"\"\n description of function_2\n \"\"\"\n pass\n\n\ndef function_3(arg: int):\n \"\"\"\n description of function_3\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(function_1, display_name=\"Barcode Generator\", icon=\"ei.barcode\")\n adapter.add(function_2, display_name=\"QRCode Generator\", icon=\"ei.qrcode\")\n adapter.add(function_3, display_name=\"Generator Service\", icon=\"mdi.web\")\n adapter.run()\n
\u5728\u672c\u4f8b\u4e2d\uff0c\u4f7f\u7528\u4e86\u5b57\u4f53\u56fe\u6807\u540d\u79f0\u4f5c\u4e3a\u51fd\u6570\u7684icon
\uff0c\u5f00\u53d1\u8005\u4e5f\u53ef\u4ee5\u4f20\u5165\u56fe\u6807\u6587\u4ef6\u8def\u5f84\u3002\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\u53ef\u4ee5\u53c2\u8003\uff1a\u5173\u4e8e\u56fe\u6807\u3002
"},{"location":"multiple-functions/#_3","title":"\uff08\u56db\uff09\u8bbe\u7f6e\u51fd\u6570\u8bf4\u660e\u6587\u6863","text":"\u5728\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\u548c\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow\uff09
\u4e2d\u5747\u6709\u4e13\u95e8\u7684\u533a\u57df\u7528\u4e8e\u663e\u793a\u51fd\u6570\u7684\u8bf4\u660e\u6587\u6863\uff0c\u7528\u4e8e\u663e\u793a\u51fd\u6570\u6587\u6863\u7684\u7ec4\u4ef6\u88ab\u79f0\u4e3a\u6587\u6863\u6d4f\u89c8\u5668\uff08DocumentBrowser\uff09
\u3002
"},{"location":"multiple-functions/#1docstring","title":"1\u3001docstring
\u4f5c\u4e3a\u8bf4\u660e\u6587\u6863","text":"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cPyGUIAdapter
\u4f1a\u81ea\u52a8\u63d0\u53d6\u51fd\u6570\u6587\u6863\u5b57\u7b26\u4e32\uff08docstring
\uff09\u4e2d\u5bf9\u4e8e\u51fd\u6570\u7684\u63cf\u8ff0\uff08\u5305\u62eclong description
\u548cshort description
\uff0c\u4f46\u4e00\u822c\u4e0d\u5305\u62ec\u53c2\u6570\u7684\u63cf\u8ff0\u90e8\u5206\u548c@params...@end
\u5757\uff09\u4f5c\u4e3a\u8bf4\u660e\u6587\u6863\uff0c\u683c\u5f0f\u9ed8\u8ba4\u4e3aMarkdown
\u3002\u6bd4\u5982\uff1a
examples/html_docstring_document_example.py
from pyguiadapter.adapter import GUIAdapter\n\n\ndef function_1(arg1: int, arg2: str, arg3: bool):\n \"\"\"\n ### Description\n This is the document of the **function_1**. And by default this document will automatically\n appear in the `document area`.\n\n The format of the document is **Markdown** by default. The **plaintext** and **html** formats are also\n supported.\n\n ---\n\n ### Arguments\n This function needs 3 arguments:\n - **arg1**: Balabala....\n - **arg2**: Balabala....\n - **arg3**: Balabala....\n\n @param arg1:\n @param arg2:\n @param arg3:\n @return:\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(function_1)\n adapter.run()\n
\u9664\u4e86markdown
\uff0c\u4e5f\u53ef\u4ee5\u5c06\u6587\u6863\u7684\u683c\u5f0f\u6307\u5b9a\u4e3ahtml
\u6216plaintext
\u3002\u6bd4\u5982\uff1a
from pyguiadapter.adapter import GUIAdapter\n\n\ndef function_2(arg1: int, arg2: str, arg3: bool):\n \"\"\"\n <h3>Description</h3>\n <p>\n This is the document of the <b>function_2</b>. And by default this document will automatically\n appear in the <strong>document area</strong>.\n </p>\n <p>\n The format of the document is <b>Markdown</b> by default.\n The <b>plaintext</b> and <b>html</b> formats are also supported.\n </p>\n <hr>\n <h3>Arguments</h3>\n <p>This function needs 3 arguments:</p>\n <ul>\n <li><b>arg1</b>: Balabala....</li>\n <li><b>arg2</b>: Balabala....</li>\n <li><b>arg3</b>: Balabala....</li>\n </ul>\n\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(function_2, document_format=\"html\")\n adapter.run()\n
\u63d0\u793a\uff1a\u6587\u6863\u6d4f\u89c8\u5668
\u5bf9html
\u7684\u652f\u6301\u6709\u9650\uff0c\u4ec5\u652f\u6301html4
\u7684\u5b50\u96c6\uff0c\u5177\u4f53\u53ef\u4ee5\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863\u7684\u8bf4\u660e\uff1aSupported HTML Subset | Qt GUI 5.15.17
"},{"location":"multiple-functions/#2","title":"2\u3001\u624b\u52a8\u8bbe\u7f6e\u8bf4\u660e\u6587\u6863\u5185\u5bb9","text":"\u5982\u679c\u5f00\u53d1\u8005\u4e0d\u60f3\u5c06\u5927\u6bb5\u6587\u672c\u653e\u5230\u51fd\u6570\u7684docstring
\u4e2d\uff0c\u4e5f\u53ef\u4ee5\u624b\u52a8\u6307\u5b9a\u51fd\u6570\u7684\u8bf4\u660e\u6587\u6863\uff0c\u6bd4\u5982\u5c06\u5916\u90e8\u6587\u4ef6\u4f5c\u4e3a\u8bf4\u660e\u6587\u6863\uff1a
examples/html_file_document_example.py
from pyguiadapter import utils\nfrom pyguiadapter.adapter import GUIAdapter\n\n\ndef function_3(arg1: int, arg2: str, arg3: bool):\n \"\"\"\n\n @param arg1:\n @param arg2:\n @param arg3:\n @return:\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n html_doc = utils.read_text_file(\"document.html\")\n adapter.add(function_3, document=html_doc, document_format=\"html\")\n adapter.run()\n
"},{"location":"multiple-functions/#3","title":"3\u3001\u8bf4\u660e\u6587\u6863\u4e2d\u7684\u7279\u6b8a\u201c\u951a\u70b9\u201d\u94fe\u63a5","text":"\u5728\u51fd\u6570\u7684\u8bf4\u660e\u6587\u6863\u4e2d\uff0c\u5b58\u5728\u4e24\u79cd\u7279\u6b8a\u7684\u201d\u951a\u70b9\u201c\u94fe\u63a5\uff0c\u4e00\u79cd\u662f\u201dParameter\u951a\u70b9\uff08parameter anchor\uff09\u201c\uff0c\u53e6\u4e00\u79cd\u662fGroup\u951a\u70b9\uff08group anchor\uff09\uff0c\u8fd9\u4e24\u79cd\u951a\u70b9\u94fe\u63a5\u7684\u4f5c\u7528\u662f\u4e0e\u6307\u5b9a\u7684\u51fd\u6570\u53c2\u6570\u6216\u51fd\u6570\u53c2\u6570\u5206\u7ec4\u76f8\u951a\u5b9a\uff0c\u5728\u7528\u6237\u70b9\u51fb\u8fd9\u4e9b\u94fe\u63a5\u65f6\u5feb\u901f\u5bfc\u822a\u5230\u6307\u5b9a\u53c2\u6570\u63a7\u4ef6\u6216\u53c2\u6570\u5206\u7ec4\uff0c\u5177\u4f53\u6765\u8bb2\uff1a
\u5bf9\u4e8eParameter\u951a\u70b9\uff08parameter anchor\uff09\uff0cPyGUIAdapter
\u9996\u5148\u4f1a\u67e5\u627e\u5bf9\u5e94\u53c2\u6570\u7684\u63a7\u4ef6\u4f4d\u4e8e\u54ea\u4e2a\u51fd\u6570\u5206\u7ec4\uff0c\u7136\u540e\u5c55\u5f00\u5176\u6240\u5728\u7684\u51fd\u6570\u5206\u7ec4\uff0c\u63a5\u7740\u8c03\u6574\u6eda\u52a8\u6761\u4f4d\u7f6e\uff0c\u786e\u4fdd\u8be5\u53c2\u6570\u63a7\u4ef6\u5bf9\u7528\u6237\u53ef\u89c1\uff0c\u7136\u540e\u9ad8\u4eae\u663e\u793a\u8be5\u63a7\u4ef6\u3002\u6548\u679c\u5982\u56fe\u6240\u793a\uff1a
\u5bf9\u4e8eGroup\u951a\u70b9\uff08group anchor\uff09\uff0cPyGUIAdapter
\u5219\u4f1a\u5728\u7528\u6237\u70b9\u51fb\u951a\u70b9\u94fe\u63a5\u65f6\u5c55\u5f00\u5bf9\u4e8e\u7684\u51fd\u6570\u5206\u7ec4\u3002\u6548\u679c\u5982\u4e0b\u56fe\u6240\u793a\uff1a
\u5728\u51fd\u6570\u53c2\u6570\u975e\u5e38\u591a\u65f6\uff0cParameter\u951a\u70b9\uff08parameter anchor\uff09\u4e0eGroup\u951a\u70b9\uff08group anchor\uff09\u975e\u5e38\u6709\u7528\u3002\u5f00\u53d1\u8005\u5728\u51fd\u6570\u8bf4\u660e\u6587\u6863\u4e2d\u63cf\u8ff0\u53c2\u6570\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e9b\u951a\u70b9\u4ee5\u5e2e\u52a9\u7528\u6237\u5feb\u901f\u5b9a\u4f4d\u5230\u5bf9\u5e94\u7684\u63a7\u4ef6\uff0c\u8fd9\u5927\u5927\u589e\u52a0\u4e86\u7a0b\u5e8f\u7684\u6613\u7528\u6027\u3002
Parameter\u951a\u70b9\uff08parameter anchor\uff09\u4e0eGroup\u951a\u70b9\uff08group anchor\uff09\u7279\u6027\u9ed8\u8ba4\u662f\u5173\u95ed\u7684\uff0c\u9700\u8981\u5728FnExecuteWindowConfig
\u4e2d\u5f00\u542f\uff0c\u65b9\u6cd5\u5982\u4e0b\uff1a
\u4ee5\u4e0b\u662f\u4e00\u4e2a\u5b8c\u6574\u7684\u4f8b\u5b50\uff1a
\u6e90\u7801\u4ee5\u53ca\u51fd\u6570\u6587\u6863\u7684\u8def\u5f84
- \u6e90\u7801\uff1aexamples/anchors_in_document.py
- \u51fd\u6570\u6587\u6863\uff1aexamples/anchors_in_document.md
import os\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.utils import read_text_file\nfrom pyguiadapter.windows import DocumentBrowserConfig\nfrom pyguiadapter.windows.fnexec import FnExecuteWindowConfig\n\nDOCUMENT_PATH = os.path.join(os.path.dirname(__file__), \"anchors_in_document.md\")\n\n\ndef anchors_in_document(\n a: str,\n b: str,\n c: str,\n d: str,\n e: str,\n f: str,\n g: str,\n h: str,\n i: str,\n j: str,\n k: str,\n l: str,\n m: str,\n n: str,\n o: str,\n p: str,\n):\n \"\"\"\n This is an example demonstrating how to use parameter anchors and group anchors in the document of function.\n\n Args:\n a: description of parameter a.\n b: description of parameter b.\n c: description of parameter c.\n d: description of parameter d.\n e: description of parameter e.\n f: description of parameter f.\n g: description of parameter g.\n h: description of parameter h.\n i: description of parameter i.\n j: description of parameter j.\n k: description of parameter k.\n l: description of parameter l.\n m: description of parameter m.\n n: description of parameter n.\n o: description of parameter o.\n p: description of parameter p.\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n\n widget_configs = {\n # parameters in Group-A\n \"a\": {\"group\": \"Group-A\"},\n \"b\": {\"group\": \"Group-A\"},\n \"c\": {\"group\": \"Group-A\"},\n \"d\": {\"group\": \"Group-A\"},\n # parameters in Group-B\n \"e\": {\"group\": \"Group-B\"},\n \"f\": {\"group\": \"Group-B\"},\n \"g\": {\"group\": \"Group-B\"},\n \"h\": {\"group\": \"Group-B\"},\n # parameters in Group-C\n \"i\": {\"group\": \"Group-C\"},\n \"j\": {\"group\": \"Group-C\"},\n \"k\": {\"group\": \"Group-C\"},\n \"l\": {\"group\": \"Group-C\"},\n # parameters in default group\n \"m\": {\"group\": None},\n \"n\": {\"group\": None},\n \"o\": {\"group\": None},\n \"p\": {\"group\": None},\n }\n\n document = read_text_file(DOCUMENT_PATH)\n adapter = GUIAdapter()\n adapter.add(\n anchors_in_document,\n document=document,\n document_format=\"markdown\",\n widget_configs=widget_configs,\n window_config=FnExecuteWindowConfig(\n document_browser_config=DocumentBrowserConfig(\n parameter_anchor=True, group_anchor=True\n )\n ),\n )\n adapter.run()\n
"},{"location":"multiple-functions/#_4","title":"\uff08\u4e94\uff09\u5bf9\u51fd\u6570\u8fdb\u884c\u5206\u7ec4","text":"\u5f00\u53d1\u8005\u5728\u8c03\u7528GUIAdapter.add()
\u65b9\u6cd5\u6dfb\u52a0\u51fd\u6570\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7group
\u53c2\u6570\u6307\u5b9a\u51fd\u6570\u7684\u5206\u7ec4\uff0cPyGUIAdapter
\u4f1a\u5c06\u76f8\u540cgroup
\u7684\u51fd\u6570\u805a\u5408\u5230\u4e00\u8d77\uff1b\u5bf9\u4e8e\u672a\u6307\u5b9agroup
\u7684\u51fd\u6570\uff0cPyGUIAdapter
\u5219\u4f1a\u5c06\u5176\u653e\u7f6e\u5728\u9ed8\u8ba4\u5206\u7ec4\u4e2d\uff0c\u8be5\u5206\u7ec4\u7684\u9ed8\u8ba4\u540d\u79f0\u4e3a\"Main Functions\"
\u3002
\u6bd4\u5982\u4e0b\u9762\u8fd9\u4e2a\u793a\u4f8b\uff0c\u5c06\u51fd\u6570\u6309\u7167\u529f\u80fd\u5206\u6210\u4e86\u4e09\u7ec4\uff1a\u7f16\u7801\u5668\u51fd\u6570Encoders
\u3001\u89e3\u7801\u5668\u51fd\u6570Decoders
\u548c\u5176\u4ed6\u51fd\u6570\uff08\u9ed8\u8ba4\u5206\u7ec4\uff09Main Functions
\u3002
examples/function_groups_example.py
from pyguiadapter.adapter import GUIAdapter\n\n\ndef mp4_encoder():\n \"\"\"\n MP4 Encoder\n \"\"\"\n pass\n\n\ndef mp3_encoder():\n \"\"\"\n MP3 Encoder\n \"\"\"\n pass\n\n\ndef avi_encoder():\n \"\"\"\n AVI Encoder\n \"\"\"\n pass\n\n\ndef ogg_encoder():\n \"\"\"\n OGG Encoder\n \"\"\"\n pass\n\n\ndef avi_decoder():\n \"\"\"\n AVI Decoder\n \"\"\"\n pass\n\n\ndef ogg_decoder():\n \"\"\"\n OGG Decoder\n \"\"\"\n pass\n\n\ndef mp3_decoder():\n \"\"\"\n MP3 Decoder\n \"\"\"\n pass\n\n\ndef mp4_decoder():\n \"\"\"\n MP4 Decoder\n \"\"\"\n pass\n\n\ndef universal_settings():\n \"\"\"\n Universal Settings\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(universal_settings)\n adapter.add(mp4_encoder, group=\"Encoders\")\n adapter.add(mp3_encoder, group=\"Encoders\")\n adapter.add(avi_encoder, group=\"Encoders\")\n adapter.add(ogg_encoder, group=\"Encoders\")\n adapter.add(avi_decoder, group=\"Decoders\")\n adapter.add(ogg_decoder, group=\"Decoders\")\n adapter.add(mp3_decoder, group=\"Decoders\")\n adapter.add(mp4_decoder, group=\"Decoders\")\n adapter.run()\n
"},{"location":"packaging/","title":"\u5e94\u7528\u6253\u5305","text":""},{"location":"packaging/#_1","title":"\uff08\u4e00\uff09\u524d\u8a00","text":"\u4e3a\u4e86\u4fbf\u4e8e\u5206\u53d1\u548c\u90e8\u7f72\uff0c\u53ef\u4ee5\u5c06\u5f00\u53d1\u597d\u7684\u5e94\u7528\u6253\u5305\u6210\u4e8c\u8fdb\u5236\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u8fd9\u6837\u7528\u6237\u53ef\u4ee5\u5728\u4e0d\u5b89\u88c5Python\u89e3\u91ca\u5668\u548c\u76f8\u5173\u7a0b\u5e8f\u5e93\u7684\u73af\u5883\u4e0b\u8fd0\u884c\u7a0b\u5e8f\u3002\u7b14\u8005\u6d4b\u8bd5\u4e86pyinstaller
\u6253\u5305\u5de5\u5177\uff0c\u53d1\u73b0\u5176\u53ef\u4ee5\u5e94\u7528\u8fdb\u884c\u6253\u5305\uff0c\u4e0b\u9762\u4ee5\u4e00\u4e2a\u5177\u4f53\u7684Demo\u9879\u76ee\u4e3a\u4f8b\uff0c\u5bf9\u4f7f\u7528pyinstaller
\u6253\u5305\u8fdb\u884c\u8bb2\u89e3\u3002\u672c\u6587\u4e2d\u6d89\u53ca\u7684\u6240\u6709\u4ee3\u7801\u3001\u8d44\u6e90\u6587\u4ef6\u3001\u6253\u5305\u914d\u7f6e\u6587\u4ef6\u7b49\u5747\u53ef\u4ee5\u5728\u4ee5\u4e0b\u76ee\u5f55\u4e2d\u627e\u5230\uff1a
- examples/packaging/
\u6b64\u5916\uff0c\u5f3a\u70c8\u5efa\u8bae\u5f00\u53d1\u8005\u5728python\u865a\u62df\u73af\u5883\u4e2d\u5bf9\u5e94\u7528\u8fdb\u884c\u6253\u5305\uff0c\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u5c06\u8bb8\u591a\u672a\u7528\u5230\u7684\u5e93\u548c\u6587\u4ef6\u6253\u5305\u5230\u6700\u7ec8\u7684\u4ea7\u7269\u4e2d\uff0c\u4ece\u800c\u51cf\u5c11\u53ef\u6267\u884c\u6587\u4ef6\u7684\u4f53\u79ef\u3002
"},{"location":"packaging/#_2","title":"\uff08\u4e8c\uff09\u51c6\u5907\u5de5\u4f5c","text":"\u9996\u5148\uff0c\u9700\u8981\u5b89\u88c5pyinstaller
\u6253\u5305\u5de5\u5177\uff1a
"},{"location":"packaging/#1pip","title":"1\u3001\u4f7f\u7528pip","text":"pip install pyinstaller\n
"},{"location":"packaging/#2poetry","title":"2\u3001\u4f7f\u7528poetry","text":"poetry add pyinstaller --group dev\n
\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u4f1a\u56e0\u4e3apython
\u7248\u672c\u95ee\u9898\uff0c\u5bfc\u81f4\u5b89\u88c5\u5931\u8d25\u3002\u63d0\u793a\u4fe1\u606f\u5927\u6982\u5982\u4e0b\uff1a
The current project's supported Python range (>=3.8,<4.0) is not compatible with some of the required packages Python requirement:\n - pyinstaller requires Python <3.14,>=3.8, so it will not be satisfied for Python >=3.14,<4.0\n\nBecause no versions of pyinstaller match >6.10.0,<7.0.0\n and pyinstaller (6.10.0) requires Python <3.14,>=3.8, pyinstaller is forbidden.\nSo, because pyguiadapter depends on pyinstaller (^6.10.0), version solving failed.\n\n \u2022 Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties\n\n For pyinstaller, a possible solution would be to set the `python` property to \">=3.8,<3.14\"\n\n https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,\n https://python-poetry.org/docs/dependency-specification/#using-environment-markers\n https://python-poetry.org/docs/dependency-specification/#using-environment-markers \n
\u6b64\u65f6\uff0c\u9700\u8981\u5c06pyproject.toml
\u6587\u4ef6\u4e2dpython
\u4f9d\u8d56\u9879\u7684\u7248\u672c\u8bbe\u7f6e\u5230\u6b63\u786e\u7684\u8303\u56f4\uff0c\u6bd4\u5982\uff1a
...\n[tool.poetry.dependencies]\npython = \"^3.8, <3.14\"\n...\n
\u7136\u540e\u518d\u6b21\u8fd0\u884cpoetry add pyinstaller --group dev
\u3002
"},{"location":"packaging/#_3","title":"\uff08\u4e09\uff09\u5f00\u59cb\u6253\u5305","text":"\u9996\u5148\u9700\u8981\u8fdb\u5165examples/packaging/\u76ee\u5f55\uff0c\u4ee5\u4e0b\u547d\u4ee4\u884c\u5747\u5728\u6b64\u76ee\u5f55\u4e0b\u5b8c\u6210\u3002
cd example/packaging/\n
"},{"location":"packaging/#1","title":"1\u3001\u57fa\u7840\u547d\u4ee4","text":"pyinstaller
\u7684\u547d\u4ee4\u8bed\u6cd5\u5982\u4e0b\uff1a
pyinstaller [options] script [script \u2026] | specfile\n
\u9996\u5148\uff0c\u8ba9\u6211\u4eec\u5c1d\u8bd5\u4e0d\u52a0\u4efb\u4f55\u9009\u9879\u6765\u6253\u5305\u6211\u4eec\u7684\u5e94\u7528\uff0c\u5728\u547d\u4ee4\u884c\u4e0b\u8f93\u5165\uff1a
pyinstaller app.py\n
\u4e0d\u51fa\u610f\u5916\uff0c\u6211\u4eec\u5c06\u770b\u5230\u7c7b\u4f3c\u4e0b\u9762\u7684\u8f93\u51fa\uff1a
...\n20490 INFO: Fixing EXE headers\n20566 INFO: Building EXE from EXE-00.toc completed successfully.\n20569 INFO: checking COLLECT\n20571 INFO: Building COLLECT COLLECT-00.toc\n20786 INFO: Building COLLECT COLLECT-00.toc completed successfully.\n
\u8fd9\u8868\u660e\u6253\u5305\u5df2\u7ecf\u6210\u529f\u4e86\uff0c\u6b64\u65f6\uff0cexamples/packaging/
\u76ee\u5f55\u4e0b\u4f1a\u51fa\u73b0\u4e24\u4e2a\u65b0\u7684\u76ee\u5f55build
\u548cdist
\uff0c\u4ee5\u53ca\u4e00\u4e2a\u65b0\u7684\u6587\u4ef6app.spec
\uff1a
build/
\uff1a\u8be5\u76ee\u5f55\u7528\u4e8e\u5b58\u653e\u6253\u5305\u8fc7\u7a0b\u4e2d\u751f\u6210\u7684\u4e00\u4e9b\u4e2d\u95f4\u6587\u4ef6\uff0c\u4e00\u822c\u65e0\u9700\u8fc7\u591a\u5173\u6ce8\u3002 dist/
\uff1a\u8be5\u76ee\u5f55\u7528\u4e8e\u5b58\u653e\u6253\u5305\u7684\u7ed3\u679c\u4ea7\u7269\uff0c\u6211\u4eec\u9700\u8981\u7684\u4e8c\u8fdb\u5236\u53ef\u6267\u884c\u6587\u4ef6\u5c31\u5c06\u88ab\u653e\u5230\u8fd9\u4e2a\u547d\u4ee4\u4e0b app.spec
\uff1a*.spec
\u6587\u4ef6\u65f6\u6253\u5305\u914d\u7f6e\u6587\u4ef6\uff0c\u8be5\u6587\u4ef6\u8bb0\u5f55\u4e86\u6253\u5305\u6240\u4f7f\u7528\u7684\u53c2\u6570\uff0c\u8fd0\u884c\u6253\u5305\u547d\u4ee4\u540e\u5c06\u81ea\u52a8\u751f\u6210\u8be5\u6587\u4ef6\u3002\u540e\u7eed\u53ef\u4ee5\u76f4\u63a5\u8f93\u5165pyinstaller app.spec
\u547d\u4ee4\u6253\u5305\u5e94\u7528\uff0c\u800c\u65e0\u9700\u6bcf\u6b21\u90fd\u624b\u52a8\u8f93\u5165\u53c2\u6570\u3002
\u73b0\u5728\u8ba9\u6211\u4eec\u67e5\u770bdist
\u76ee\u5f55\uff0c\u91cc\u9762\u5305\u542b\u4e00\u4e2a\u540d\u4e3aapp
\u7684\u5b50\u76ee\u5f55\uff0c\u6700\u7ec8\u7684\u53ef\u6267\u884c\u6587\u4ef6\u5c31\u5728\u8be5\u76ee\u5f55\u4e0b\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cpyinstaller
\u4f1a\u751f\u6210\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u53ca\u4e00\u4e2a_internal/
\u76ee\u5f55\uff1a
_internal/
\u76ee\u5f55\u4e0b\u5b58\u653e\u7740\u8fd9\u53ef\u6267\u884c\u6587\u4ef6\u8fd0\u884c\u65f6\u4f9d\u8d56\u7684\u5e93\u548c\u5176\u4ed6\u6587\u4ef6\uff1a
"},{"location":"packaging/#2","title":"2\u3001\u6253\u5305\u8d44\u6e90\uff08\u6570\u636e\uff09\u6587\u4ef6","text":""},{"location":"packaging/#1_1","title":"\uff081\uff09\u7b2c\u4e09\u65b9\u4f9d\u8d56\u4e2d\u7684\u8d44\u6e90\u6587\u4ef6","text":"\u73b0\u5728\uff0c\u8ba9\u6211\u4eec\u8fd0\u884capp.exe
\uff0c\u7ed3\u679c\u53d1\u73b0\u53ea\u6709\u4e00\u4e2a\u547d\u4ee4\u884c\u7a97\u53e3\u4e00\u95ea\u800c\u8fc7\uff0c\u7a0b\u5e8f\u6ca1\u6709\u542f\u52a8\u6210\u529f\u3002\u8fd9\u8bf4\u660e\u6253\u5305\u8fd8\u5b58\u5728\u4e00\u4e9b\u95ee\u9898\uff0c\u5e76\u6ca1\u6709\u771f\u6b63\u6210\u529f\u3002\u8ba9\u6211\u4eec\u901a\u8fc7\u547d\u4ee4\u884c\u518d\u6b21\u542f\u52a8app.exe
\uff0c\u5c1d\u8bd5\u4ece\u5176\u547d\u4ee4\u884c\u8f93\u51fa\u4e2d\u5b9a\u4f4d\u95ee\u9898\u6240\u5728\u3002
./dist/app/app.exe\n
\u7a0b\u5e8f\u8f93\u51fa\u4e86\u5927\u6bb5\u7684\u5f02\u5e38\u56de\u6eaf\u4fe1\u606f\uff0c\u8ba9\u6211\u4eec\u622a\u53d6\u5176\u4e2d\u5173\u952e\u7684\u90e8\u5206\uff1a
Traceback (most recent call last):\n ...\n File \"yapf_third_party\\_ylib2to3\\pygram.py\", line 29, in <module>\n File \"yapf_third_party\\_ylib2to3\\pgen2\\driver.py\", line 237, in load_grammar\n File \"pkgutil.py\", line 637, in get_data\n File \"PyInstaller\\loader\\pyimod02_importers.py\", line 509, in get_data\nFileNotFoundError: [Errno 2] No such file or directory: '...\\\\dist\\\\app\\\\_internal\\\\yapf_third_party\\\\_ylib2to3\\\\Grammar.txt'\n
\u4ece\u5f02\u5e38\u4fe1\u606f\u4e2d\u4e0d\u96be\u53d1\u73b0\uff0c\u4e00\u4e9b\u7a0b\u5e8f\u8fd0\u884c\u6240\u5fc5\u987b\u7684\u6587\u4ef6\u6ca1\u6709\u88ab\u6253\u5305\u5230_internal/
\u76ee\u5f55\u4e0b\uff0c\u5177\u4f53\u800c\u8a00\uff0c\u8be5\u6587\u4ef6\u88ab\u7b2c\u4e09\u65b9\u5305yapf_third_party
\u5f15\u7528\u3002
PyGUIAdapter
\u4f9d\u8d56yapf
\u5b9e\u73b0\u4ee3\u7801\u683c\u5f0f\u5316\u529f\u80fd\uff0c\u800cyapf
\u5728\u5185\u90e8\u4f9d\u8d56\u53c8\u4e86yapf_third_party
\u3002\u663e\u7136\uff0c\u76ee\u524dpyinstaller
\u8fd8\u65e0\u6cd5\u5904\u7406yapf
\u8fd9\u79cd\u4f9d\u8d56\u5173\u7cfb\uff0c\u65e0\u6cd5\u81ea\u52a8\u6536\u96c6\u5e76\u6253\u5305\u5176\u6240\u9700\u7684\u6587\u4ef6\u3002\u4e3a\u4e86\u5904\u7406\u7c7b\u4f3c\u7684\u9519\u8bef\uff0c\u6211\u4eec\u53ef\u4ee5\u624b\u52a8\u6307\u5b9a\u9700\u8981\u6536\u96c6\u7684\u6587\u4ef6\u7684\u5305\u6216\u6a21\u5757\uff0cpyinstanller
\u63d0\u4f9b\u4e86\u4ee5\u4e0b\u9009\u9879\uff1a
--hidden-import MODULENAME
\u6216 --hiddenimport MODULENAME
\uf0c1
\u7528\u4e8e\u544a\u8bc9pyInstaller
\u5728\u6253\u5305\u8fc7\u7a0b\u4e2d\u5305\u542b\u90a3\u4e9b\u53ef\u80fd\u6ca1\u6709\u88ab\u81ea\u52a8\u8bc6\u522b\u4e3a\u4f9d\u8d56\u7684\u989d\u5916python\u5305\uff0c\u5373\u90a3\u4e9b\u901a\u8fc7importlib
\u7b49\u65b9\u5f0f\u9690\u5f0f\u5bfc\u5165\u7684\u5305\u3002
--collect-submodules MODULENAME
\uf0c1
\u7528\u4e8e\u6536\u96c6\u6307\u5b9a\u5305\u6216\u6a21\u5757\u7684\u6240\u6709\u5b50\u6a21\u5757\u3002
--collect-data MODULENAME
\u6216--collect-datas MODULENAME
\uf0c1
\u7528\u4e8e\u6536\u96c6\u6307\u5b9a\u5305\u6216\u6a21\u5757\u4e0b\u7684\u6570\u636e\u6587\u4ef6\u3002
--collect-binaries MODULENAME
\uf0c1
\u7528\u4e8e\u6536\u96c6\u6307\u5b9a\u5305\u6216\u6a21\u5757\u4e0b\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002
--collect-all MODULENAME
\uf0c1
\u7528\u4e8e\u6307\u5b9a\u5305\u6216\u6a21\u5757\u4e0b\u7684\u6240\u6709\u5b50\u6a21\u5757\u3001\u6570\u636e\u6587\u4ef6\u3001\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002
\u73b0\u5728\uff0c\u8ba9\u6211\u4eec\u624b\u52a8\u6307\u5b9a\u9700\u8981\u6536\u96c6\u8d44\u6e90\u6587\u4ef6\u7684\u7b2c\u4e09\u65b9\u4f9d\u8d56\u3002\u9664\u4e86yapf_third_party
\uff0c\u8fd8\u6709pyqcodeeditor
\u3002
pyqcodeeditor
\u662f\u4f5c\u8005\u79fb\u690d\u7684\u4e00\u4e2a\u4ee3\u7801\u7f16\u8f91\u5668\u63a7\u4ef6\uff0cPyGUIAdapter
\u4f7f\u7528\u4e86\u8be5\u63a7\u4ef6\u3002pyqcodeeditor
\u5185\u7f6e\u4e86\u4e00\u4e9b\u7528\u4e8e\u5b9a\u4e49\u8bed\u6cd5\u548c\u9ad8\u4eae\u89c4\u5219\u7684json
\u6587\u4ef6\uff0cpyinstaller
\u8fd8\u6ca1\u529e\u6cd5\u81ea\u52a8\u6536\u96c6\u8fd9\u4e9b\u6587\u4ef6\uff0c\u56e0\u6b64\u4e5f\u9700\u8981\u624b\u52a8\u6536\u96c6\u8fd9\u4e9b\u6587\u4ef6\u3002
pyinstaller app.py --collect-data yapf_third_party --collect-data pyqcodeeditor -y --clean\n
\u8fd9\u91cc\u4f7f\u7528\u4e86\u4e24\u4e2a\u65b0\u7684\u9009\u9879-y
\u548c--clean
\u3002\u5176\u542b\u4e49\u548c\u7528\u9014\u5982\u4e0b\uff1a
-y
\u6307\u5b9a\u8be5\u9009\u9879\u540e\uff0c\u5982\u679c\u5b58\u5728\u4e4b\u524d\u751f\u6210\u7684\u6587\u4ef6\uff0c\u76f4\u63a5\u8fdb\u884c\u8986\u76d6\uff0c\u4e0d\u4f1a\u8be2\u95ee\u662f\u5426\u8981\u79fb\u9664\u5b83\u4eec\u3002
--clean
\u6e05\u9664\u7f13\u5b58\uff0c\u5e76\u79fb\u9664\u4e4b\u524d\u6784\u5efa\u65f6\u4ea7\u751f\u7684\u4e34\u65f6\u6587\u4ef6\u3002
\u6253\u5305\u5b8c\u6210\u540e\u3002\u53ef\u4ee5\u53d1\u73b0\uff0cyapf_third_party
\u548cpyqcodeeditor
\u4e2d\u7684\u8d44\u6e90\u6587\u4ef6\u6253\u5305\u5230_internal
\u76ee\u5f55\u4e0b\u4e86\u3002
\u8ba9\u6211\u4eec\u518d\u6b21\u8fd0\u884capp.exe
\uff0c\u5df2\u7ecf\u53ef\u4ee5\u6b63\u5e38\u663e\u793a\u7a0b\u5e8f\u754c\u9762\u4e86\u3002
\u5c0f\u7ed3\uff1a\u5982\u679c\u7a0b\u5e8f\u5f15\u7528\u4e86\u4e00\u4e9b\u7b2c\u4e09\u65b9\u5e93\uff0c\u800cpyinstaller
\u76ee\u524d\u8fd8\u65e0\u6cd5\u81ea\u52a8\u6536\u96c6\u8fd9\u4e9b\u5e93\u6216\u662f\u5176\u8d44\u6e90\u6587\u4ef6\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528--collect-xxx
\u9009\u9879\u624b\u52a8\u5305\u542b\u9700\u8981\u7684\u6587\u4ef6\u3002
"},{"location":"packaging/#1_2","title":"\uff081\uff09\u9879\u76ee\u8d44\u6e90\u6587\u4ef6","text":"\u73b0\u5728\uff0c\u6211\u4eec\u7684\u5e94\u7528\u4ecd\u7136\u5b58\u5728\u4e00\u4e2a\u5c0f\u95ee\u9898\uff1a\u5f53\u6211\u4eec\u5355\u51fbHelp
\u83dc\u5355\u4e0b\u7684About
\u83dc\u5355\u9879\uff0c\u672c\u5e94\u5f39\u51fa\u4e00\u4e2a\u5173\u4e8e\u5bf9\u8bdd\u6846\uff0c\u4f46\u662f\uff0c\u4ec0\u4e48\u90fd\u6ca1\u6709\u53d1\u751f\u3002
\u8ba9\u6211\u4eec\u4ece\u547d\u4ee4\u884c\u8f93\u51fa\u4e2d\u5b9a\u4f4d\u95ee\u9898\uff1a
Traceback (most recent call last):\n File \"pyguiadapter\\window.py\", line 361, in _on_triggered\n File \"app.py\", line 40, in on_action_about\n File \"pyguiadapter\\utils\\messagebox.py\", line 264, in show_text_file\n File \"pyguiadapter\\utils\\io.py\", line 2, in read_text_file\nFileNotFoundError: [Errno 2] No such file or directory: '...\\\\dist\\\\app\\\\_internal\\\\about.html'\n
\u975e\u5e38\u6e05\u6670\u7684\u9519\u8bef\u6d88\u606f\uff1aapp.py
\u7684\u7b2c40\u884c
\u7528\u5230\u4e86\u4e00\u4e2a\u6587\u4ef6about.html
\uff0c\u4f46\u8be5\u6587\u4ef6\u5e76\u4e0d\u5b58\u5728\u3002
about.html
\u4e0eapp.py
\u5728\u540c\u4e00\u76ee\u5f55\u4e0b\uff0cpyinstaller
\u5728\u6253\u5305\u65f6\u5374\u6ca1\u6709\u5c06about.html
\u6253\u5305\u5230_internal
\u76ee\u5f55\u4e0b\uff0c\u8fd9\u5c31\u662f\u95ee\u9898\u7684\u6839\u6e90\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u9700\u8981\u624b\u52a8\u6307\u5b9a\u9879\u76ee\u4e2d\u54ea\u4e9b\u8d44\u6e90\u6587\u4ef6\u9700\u8981\u88ab\u6253\u5305\u5230\u6700\u7ec8\u4ea7\u7269\u4e2d\u3002\u5bf9\u6b64\uff0cpyinstaller
\u63d0\u4f9b\u4e86--add-data
\u9009\u9879\u3002
--add-data SOURCE:DEST
\uf0c1
Additional data files or directories containing data files to be added to the application. The argument value should be in form of \u201csource:dest_dir\u201d, where source is the path to file (or directory) to be collected, dest_dir is the destination directory relative to the top-level application directory, and both paths are separated by a colon (:). To put a file in the top-level application directory, use . as a dest_dir. This option can be used multiple times.
\u8ba9\u6211\u4eec\u6dfb\u52a0\u9700\u8981\u6253\u5305\u7684\u6587\u4ef6\uff0c\u7136\u540e\u518d\u6b21\u8fdb\u884c\u6253\u5305\uff1a
pyinstaller app.py --collect-data yapf_third_party --collect-data pyqcodeeditor --add-data \"./about.html:./\" -y --clean\n
--add-data \"./about.html:./\"
\u7684\u542b\u4e49\u662f\uff1a\u628a\u5f53\u524d\u76ee\u5f55\uff08./\uff09
\u4e0b\u7684about.html
\u6587\u4ef6\u6253\u5305\u5230\u76ee\u6807\u4ea7\u7269\u7684\u6839\u76ee\u5f55(./)
\u4e0b
\u800c\u5728\u65b0\u7248\u672c\u7684pyinstaller
\u4e2d\uff0c\u6700\u7ec8\u4ea7\u7269\u7684\u6839\u76ee\u5f55\u5c31\u662f_internal
\u76ee\u5f55\u3002
\u6253\u5305\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u53d1\u73b0about.html
\u5df2\u7ecf\u88ab\u6253\u5305\u5230_internal
\u76ee\u5f55\u4e0b\u4e86\u3002
\u518d\u6b21\u8fd0\u884capp.exe
\uff0c\u73b0\u5728\u7ec8\u4e8e\u53ef\u4ee5\u6b63\u5e38\u5f39\u51fa\u5bf9\u8bdd\u6846\u4e86\uff1a
"},{"location":"packaging/#3","title":"\uff083\uff09\u5173\u4e8e\u6587\u4ef6\u8def\u5f84\u7684\u4e00\u4e9b\u63d0\u793a","text":"\u4e3a\u4e86\u5728\u7a0b\u5e8f\u6253\u5305\u540e\u4ecd\u7136\u53ef\u4ee5\u8bbf\u95ee\u5230\u9879\u76ee\u4e2d\u7684\u8d44\u6e90\u6587\u4ef6\uff0c\u9700\u8981\u5728\u4ee3\u7801\u4e2d\u5fc5\u987b\u975e\u5e38\u5c0f\u5fc3\u7684\u9664\u4e86\u8def\u5f84\u95ee\u9898\uff0c\u5c24\u5176\u662f\u91c7\u7528\u76f8\u5bf9\u8def\u5f84
\u65f6\uff0c\u6e90\u7801\u72b6\u6001\u4e0b\u548c\u6253\u5305\u72b6\u6001\u4e0b\u76f8\u5bf9\u8def\u5f84
\u4e2d\u201c\u76f8\u5bf9\u201d\u7684\u542b\u4e49\u662f\u4e0d\u540c\u7684\uff0c\u5177\u4f53\u800c\u8a00\uff0c\u201c\u76f8\u5bf9\u201d\u7684\u8d77\u70b9\u4e0d\u540c\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u4e00\u79cd\u53ef\u884c\u7684\u65b9\u6cd5\u662f\uff0c\u4ee5__file__
\u4e3a\u8d77\u70b9\u5bf9\u8def\u5f84\u8fdb\u884c\u5b9a\u4f4d\uff0c\u672c\u4f8b\u4e2d\u5c31\u662f\u91c7\u7528\u8fd9\u79cd\u505a\u6cd5\u3002
"},{"location":"packaging/#_4","title":"\uff08\u56db\uff09\u4fee\u6539\u53ef\u6267\u884c\u6587\u4ef6\u540d\u79f0\u3001\u56fe\u6807","text":""},{"location":"packaging/#1_3","title":"1\u3001\u4fee\u6539\u53ef\u6267\u884c\u6587\u4ef6\u540d","text":"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cpyinstaller
\u751f\u6210\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u540d\u79f0\u5c06\u4e0e\u8f93\u5165\u7684\u6e90\u7801\u6587\u4ef6\u540d\u79f0\u4e00\u81f4\u3002\u6bd4\u5982\uff0c\u5728windows
\u5e73\u53f0\u4e0b\uff0capp.py
\u6253\u5305\u540e\u7684\u4e8c\u8fdb\u5236\u53ef\u6267\u884c\u6587\u4ef6\u540d\u9ed8\u8ba4\u4e3aapp.exe
\u3002\u5f53\u7136\uff0cpyinstaller
\u5141\u8bb8\u6211\u4eec\u6307\u5b9a\u53ef\u6267\u884c\u6587\u4ef6\u7684\u540d\u79f0\uff0c\u65b9\u6cd5\u662f\u4f7f\u7528--name
\u9009\u9879\u3002
-n NAME
, --name NAME
\uf0c1
Name to assign to the bundled app and spec file (default: first script\u2019s basename)
\u73b0\u5728\uff0c\u8ba9\u6211\u4eec\u628a\u7a0b\u5e8f\u540d\u79f0\u4fee\u6539\u4e3aEquation-Solver
\u3002
\u9996\u5148\uff0c\u628a\u4e4b\u524d\u751f\u6210\u7684dist
\u3001build
\u3001app.spec
\u6587\u4ef6\u5220\u9664\u3002\u7136\u540e\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a
pyinstaller app.py --name \"Equation-Solver\" --collect-data yapf_third_party --collect-data pyqcodeeditor --add-data \"./about.html:./\" -y --clean\n
\u6253\u5305\u5b8c\u6210\u540e\uff0c\u91cd\u65b0\u751f\u6210\u4e86\u4e00\u4e2a.spec
\u6587\u4ef6\uff0c\u540d\u79f0\u4e3aEquation-Solver.spec
\u3002\u5728dist/Equation-Solver
\u76ee\u5f55\u4e0b\uff0c\u751f\u6210\u4e86\u4e00\u4e2a\u540d\u4e3aEquation-Solver.exe
\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002
"},{"location":"packaging/#2_1","title":"2\u3001\u4fee\u6539\u53ef\u6267\u884c\u6587\u4ef6\u7684\u56fe\u6807","text":"pyinstaller
\u751f\u6210\u7684\u53ef\u6267\u884c\u6587\u4ef6\u5177\u6709\u4e00\u4e2a\u9ed8\u8ba4\u7684\u56fe\u6807\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u5176\u66ff\u6362\u6210\u81ea\u5df1\u7684\u56fe\u6807\uff0c\u65b9\u6cd5\u662f\u4f7f\u7528--icon
\u9009\u9879\u3002
-i <FILE.ico or FILE.exe,ID or FILE.icns or Image or \"NONE\">
, --icon <FILE.ico or FILE.exe,ID or FILE.icns or Image or \"NONE\">
\uf0c1
FILE.ico: apply the icon to a Windows executable. FILE.exe,ID: extract the icon with ID from an exe. FILE.icns: apply the icon to the .app bundle on Mac OS. If an image file is entered that isn\u2019t in the platform format (ico on Windows, icns on Mac), PyInstaller tries to use Pillow to translate the icon into the correct format (if Pillow is installed). Use \u201cNONE\u201d to not apply any icon, thereby making the OS show some default (default: apply PyInstaller\u2019s icon). This option can be used multiple times.
\u9996\u5148\uff0c\u9700\u8981\u51c6\u5907\u597d\u56fe\u6807\u6587\u4ef6\uff08.ico
\u6216.icns
\u683c\u5f0f\uff09\uff0c\u5e76\u5c06\u5176\u653e\u5230app.py
\u540c\u76ee\u5f55\u4e0b\u3002
\u6267\u884c\u4ee5\u4e0b\u6253\u5305\u547d\u4ee4\uff1a
pyinstaller app.py --name \"Equation-Solver\" --icon \"./icon.ico\" --collect-data yapf_third_party --collect-data pyqcodeeditor --add-data \"./about.html:./\" -y --clean\n
\u6253\u5305\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u5c31\u5f97\u5230\u4e86\u4e00\u4e2a\u5e26\u81ea\u5b9a\u4e49\u56fe\u6807\u7684\u53ef\u6267\u884c\u6587\u4ef6\u4e86\uff1a
"},{"location":"packaging/#_5","title":"\uff08\u4e94\uff09\u7a97\u53e3\u6a21\u5f0f","text":"pyinstaller
\u6253\u5305\u5e94\u7528\u7a0b\u5e8f\u7684\u65f6\u5019\u9ed8\u8ba4\u4f7f\u7528-c
\u9009\u9879\uff0c\u56e0\u6b64\u6253\u5f00\u751f\u6210\u7684\u53ef\u6267\u884c\u6587\u4ef6\u65f6\u5c06\u540c\u65f6\u6253\u5f00\u4e00\u4e2a\u63a7\u5236\u53f0\u7a97\u53e3\u4f5c\u4e3a\u5176\u6807\u51c6io\u3002\u82e5\u8981\u9690\u85cf\u8be5\u7a97\u53e3\uff0c\u53ef\u4ee5\u4f7f\u7528-w
\u9009\u9879\u3002
-w
, --windowed
, --noconsole
\uf0c1
Windows and Mac OS X: do not provide a console window for standard i/o. On Mac OS this also triggers building a Mac OS .app bundle. On Windows this option is automatically set if the first script is a \u2018.pyw\u2019 file. This option is ignored on *NIX systems.
pyinstaller app.py -w --name \"Equation-Solver\" --icon \"./icon.ico\" --collect-data yapf_third_party --collect-data pyqcodeeditor --add-data \"./about.html:./\" -y --clean\n
"},{"location":"packaging/#_6","title":"\uff08\u516d\uff09\u5355\u6587\u4ef6\u6a21\u5f0f","text":"pyinstaller
\u5728\u6253\u5305\u65f6\uff0c\u9ed8\u8ba4\u4f1a\u751f\u6210\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u4ee5\u53ca\u4e00\u4e2a\u7528\u4e8e\u5b58\u653e\u5176\u4ed6\u6587\u4ef6\u7684\u76ee\u5f55\uff08\u9ed8\u8ba4\u4e3a_internal
\uff09\u3002pyinstaller
\u4e5f\u652f\u6301\u5c06\u6240\u6709\u6587\u4ef6\u6253\u5305\u6210\u5355\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u65b9\u6cd5\u662f\u4f7f\u7528-F
\u9009\u9879\u3002
-F
, --onefile
\uf0c1
Create a one-file bundled executable.
\u9996\u5148\uff0c\u5c06dist/
\u76ee\u5f55\u6e05\u7a7a\u3002\u7136\u540e\u6267\u884c\u4e0b\u5217\u547d\u4ee4\u3002
pyinstaller app.py -F -w --name \"Equation-Solver\" --icon \"./icon.ico\" --collect-data yapf_third_party --collect-data pyqcodeeditor --add-data \"./about.html:./\" -y --clean\n
\u6253\u5305\u5b8c\u6210\u540e\uff0cdist/
\u76ee\u5f55\u4e0b\u53ea\u6709\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u5176\u4ed6\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u6253\u5305\u5230\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u4e86\u3002
\u73b0\u5728\u53ea\u9700\u8981\u4e00\u4e2a\u6587\u4ef6\u5c31\u53ef\u4ee5\u5b8c\u6210\u7a0b\u5e8f\u7684\u5206\u53d1\u4e86\u3002
\u76f8\u6bd4\u591a\u6587\u4ef6\u6a21\u5f0f\uff0c\u5355\u6587\u4ef6\u6253\u5305\u7684\u4f18\u52bf\u4e3b\u8981\u5305\u62ec\u4ee5\u4e0b\u4e24\u70b9\uff1a
- \u65b9\u4fbf\u90e8\u7f72\u548c\u5206\u53d1
- \u603b\u7684\u4f53\u79ef\u66f4\u5c0f
\u4e0d\u8db3\u5728\u4e8e\u5e94\u7528\u542f\u52a8\u7684\u901f\u5ea6\u53ef\u80fd\u4f1a\u7a0d\u6162\u4e00\u4e9b\uff08\u8fd0\u884c\u901f\u5ea6\u4e0d\u53d7\u5f71\u54cd\uff09\uff0c\u4f46\u662f\u4e00\u822c\u4e0d\u662f\u5f88\u660e\u663e\u3002
\u5c31\u672c\u793a\u4f8b\u6765\u8bf4\uff0c\u5728\u542f\u7528\u5355\u6587\u4ef6\u6a21\u5f0f\u524d\uff0c\u6240\u6709\u6587\u4ef6\u4f53\u79ef\u52a0\u8d77\u6765\u6709114MB
\u5de6\u53f3\uff0c\u800c\u91c7\u7528\u5355\u6587\u4ef6\u6a21\u5f0f\u540e\uff0c\u6587\u4ef6\u4f53\u79ef\u88ab\u538b\u7f29\u523046.5MB
\uff0c\u53ef\u4ee5\u8bf4\u6548\u679c\u663e\u8457\u3002
"},{"location":"packaging/#_7","title":"\uff08\u4e03\uff09\u8fdb\u4e00\u6b65\u538b\u7f29\u4f53\u79ef\u7684\u65b9\u6cd5","text":""},{"location":"packaging/#1-strip","title":"1\u3001\u4f7f\u7528--strip
\u9009\u9879","text":"\u6309\u7167pyinstaller
\u5b98\u65b9\u7684\u8bf4\u6cd5\uff0c\u8be5\u9009\u9879\u53ef\u7528\u4e8e\u53bb\u9664\u53ef\u6267\u884c\u6587\u4ef6\u548c\u5171\u4eab\u5e93\u4e2d\u7684\u7b26\u53f7\u8868\uff08\u5728Windows
\u4e0b\u4e0d\u63a8\u8350\u4f7f\u7528\uff09\uff0c\u8fd9\u53ef\u80fd\u6709\u52a9\u4e8e\u51cf\u5c11\u751f\u6210\u6587\u4ef6\u7684\u4f53\u79ef\u3002
-s
, --strip
\uf0c1
Apply a symbol-table strip to the executable and shared libs (not recommended for Windows)
"},{"location":"packaging/#2upx","title":"2\u3001\u4f7f\u7528upx
","text":"\u7b14\u8005\u6ca1\u6709\u5b9e\u9645\u5c1d\u8bd5\u8fd9\u79cd\u65b9\u6cd5\uff0c\u5177\u4f53\u7684\u65b9\u6cd5\u53ef\u4ee5\u53c2\u8003pyinstaller
\u7684\u5b98\u65b9\u6587\u6863\uff1aUsing Upx\u3002
"},{"location":"packaging/#_8","title":"\uff08\u516b\uff09\u7ed3\u8bed","text":"pyinstaller
\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u6253\u5305\u9009\u9879\uff0c\u672c\u6587\u4ec5\u4ec5\u5bf9\u5e38\u7528\u7684\u51e0\u4e2a\u9009\u9879\u8fdb\u884c\u4e00\u4e9b\u8bf4\u660e\u548c\u6f14\u793a\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u8fdb\u4e00\u6b65\u9605\u8bfb\u5b98\u65b9\u6587\u6863\uff0c\u4e86\u89e3\u66f4\u591a\u7ec6\u8282\u4e86\uff0c\u6253\u5305\u8fc7\u7a0b\u4e2d\u9047\u5230\u7684\u7edd\u5927\u591a\u6570\u95ee\u9898\u90fd\u53ef\u4ee5\u5728\u5176\u4e2d\u627e\u5230\u89e3\u51b3\u65b9\u6cd5\uff0c\u4ee5\u4e0b\u662fpyinstaller
\u5b98\u65b9\u6587\u6863\u7684\u5730\u5740\uff1aPyInstaller Manual \u2014 PyInstaller 6.10.0 documentation\u3002
\u8fd9\u91cc\uff0c\u4e5f\u8d34\u51fa\u672c\u6b21\u6f14\u793a\u6700\u7ec8\u7684spec
\u6587\u4ef6\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u8fd9\u4e2a\u6587\u4ef6\u57fa\u7840\u4e0a\u8fdb\u884c\u4fee\u6539\uff0c\u4ece\u800c\u5feb\u901f\u5f97\u5230\u7b26\u5408\u81ea\u5df1\u9879\u76ee\u5b9e\u9645\u7684\u6253\u5305\u914d\u7f6e\u6587\u4ef6\u3002
examples/packaging/Equation-Solver.spec
# -*- mode: python ; coding: utf-8 -*-\nfrom PyInstaller.utils.hooks import collect_data_files\n\ndatas = [('./about.html', './')]\ndatas += collect_data_files('yapf_third_party')\ndatas += collect_data_files('pyqcodeeditor')\n\n\na = Analysis(\n ['app.py'],\n pathex=[],\n binaries=[],\n datas=datas,\n hiddenimports=[],\n hookspath=[],\n hooksconfig={},\n runtime_hooks=[],\n excludes=[],\n noarchive=False,\n optimize=0,\n)\npyz = PYZ(a.pure)\n\nexe = EXE(\n pyz,\n a.scripts,\n a.binaries,\n a.datas,\n [],\n name='Equation-Solver',\n debug=False,\n bootloader_ignore_signals=False,\n strip=False,\n upx=True,\n upx_exclude=[],\n runtime_tmpdir=None,\n console=False,\n disable_windowed_traceback=False,\n argv_emulation=False,\n target_arch=None,\n codesign_identity=None,\n entitlements_file=None,\n icon=['icon.ico'],\n)\n
"},{"location":"progressbar/","title":"\u8fdb\u5ea6\u6761\u4e0e\u8fdb\u5ea6\u5bf9\u8bdd\u6846","text":""},{"location":"progressbar/#_1","title":"\u8fdb\u5ea6\u6761","text":""},{"location":"progressbar/#_2","title":"\uff08\u4e00\uff09\u6982\u8ff0","text":"PyGUIAdapter
\u63d0\u4f9b\u4e86\u8fdb\u5ea6\u6761\u529f\u80fd\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u663e\u793a\u3001\u9690\u85cf\u548c\u66f4\u65b0\u8fdb\u5ea6\u6761\u3002
\u8fdb\u5ea6\u6761\u4f4d\u4e8e\u51fd\u6570\u6267\u884c\u7a97\u53e3Ouput Dock
\u4e2d\uff0c\u5728\u8f93\u51fa\u6d4f\u89c8\u5668\u4e0b\u65b9\uff0c\u4e3b\u8981\u5305\u62ec\u4e09\u4e2a\u90e8\u5206\uff1a
-
Progress Bar\uff1a\u8fdb\u5ea6\u6761\u672c\u4f53\u3002
-
Message\uff1a\u8fdb\u5ea6\u6761\u4e0a\u663e\u793a\u7684\u8fdb\u5ea6\u4fe1\u606f\u3002
-
Info\uff1a\u989d\u5916\u663e\u793a\u7684\u4fe1\u606f\u3002
\u76f8\u5173\u7684API\u5728pyguiadapter.adapter.uprogress
\u6a21\u5757\u4e2d\uff0c\u4e3b\u8981\u5305\u542b\u4ee5\u4e0b\u4e09\u4e2a\u63a5\u53e3\uff1a
-
show_progressbar()
\uff1a\u7528\u4e8e\u663e\u793a\u8fdb\u5ea6\u6761\u3002
-
hide_progressbar()
\uff1a\u7528\u4e8e\u9690\u85cf\u8fdb\u5ea6\u6761\u3002
-
update_progress()
\uff1a\u7528\u4e8e\u66f4\u65b0\u8fdb\u5ea6\u4fe1\u606f\u548c\u989d\u5916\u663e\u793a\u7684\u4fe1\u606f\u3002
\u5404\u4e2a\u51fd\u6570\u5177\u4f53\u4fe1\u606f\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.adapter.uprogress
"},{"location":"progressbar/#_3","title":"\uff08\u4e8c\uff09\u793a\u4f8b","text":"import time\n\nfrom pyguiadapter.adapter import GUIAdapter, udialog\nfrom pyguiadapter.adapter import uprogress\nfrom pyguiadapter.adapter.ucontext import is_function_cancelled\nfrom pyguiadapter.adapter.uoutput import uprint\n\n\ndef progressbar_example(total: int = 100, delay: float = 0.5):\n \"\"\"\n example for **progressbar** and **cancellable function**\n\n @param total: how many task will be processed\n @param delay: how much time will be consumed per task\n @return:\n \"\"\"\n uprogress.show_progressbar(0, total, message_visible=True)\n cancelled = False\n task_processed = 0\n for i in range(total):\n if is_function_cancelled():\n uprint(\"Cancelled!\")\n cancelled = True\n break\n task_processed = i + 1\n uprint(f\"[Processed] {task_processed}\")\n uprogress.update_progress(\n task_processed, info=f\"[{task_processed}/{total}] please wait...\"\n )\n time.sleep(delay)\n if cancelled:\n udialog.show_warning_messagebox(\n f\"{task_processed} task(s) processed!\", title=\"Cancelled\"\n )\n else:\n udialog.show_info_messagebox(\n f\"{task_processed} task(s) processed!\", title=\"Completed\"\n )\n uprogress.hide_progressbar()\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(progressbar_example, cancelable=True)\n adapter.run()\n
\u6548\u679c\u5982\u4e0b\uff1a
"},{"location":"progressbar/#_4","title":"\u8fdb\u5ea6\u5bf9\u8bdd\u6846","text":""},{"location":"progressbar/#_5","title":"\uff08\u4e00\uff09\u6982\u8ff0","text":"\u9664\u4e86\u96c6\u6210\u5728Ouput Dock
\u4e2d\u7684\u8fdb\u5ea6\u6761\uff0cPyGUIAdapter
\u8fd8\u63d0\u4f9b\u4e86\u72ec\u7acb\u8fdb\u5ea6\u5bf9\u8bdd\u6846\u529f\u80fd\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u663e\u793a\u3001\u9690\u85cf\u548c\u66f4\u65b0\u8fdb\u5ea6\u5bf9\u8bdd\u6846\u3002
\u8fdb\u5ea6\u5bf9\u8bdd\u6846
\u4e3b\u8981\u5305\u62ec\u4ee5\u4e0b\u56db\u4e2a\u90e8\u5206\uff1a
-
Progress Bar\uff1a\u8fdb\u5ea6\u6761\u3002
-
Message\uff1a\u8fdb\u5ea6\u6761\u4e0a\u663e\u793a\u7684\u8fdb\u5ea6\u4fe1\u606f\u3002
-
Info\uff1a\u989d\u5916\u663e\u793a\u7684\u4fe1\u606f\u3002
-
Cancel Button\uff1a\u53d6\u6d88\u6309\u94ae\u3002\u4ec5\u5728function\u88ab\u6807\u8bb0\u4e3acancelable=True
\u65f6\u663e\u793a\u3002\u4e0e\u6267\u884c\u7a97\u53e3\u754c\u9762\u4e0a\u7684\u53d6\u6d88\u6309\u94ae\u529f\u80fd\u4e00\u81f4\uff0c\u7528\u4e8e\u8bf7\u6c42\u53d6\u6d88\u5f53\u524d\u6b63\u5728\u6267\u884c\u7684\u51fd\u6570\u3002
\u76f8\u5173\u7684API\u5728pyguiadapter.adapter.uprogress
\u6a21\u5757\u4e2d\uff0c\u4e3b\u8981\u5305\u542b\u4ee5\u4e0b\u4e09\u4e2a\u63a5\u53e3\uff1a
-
show_progress_dialog()
\uff1a\u7528\u4e8e\u663e\u793a\u8fdb\u5ea6\u5bf9\u8bdd\u6846\u3002
-
dismiss_progress_dialog()
\uff1a\u7528\u4e8e\u53d6\u6d88\u8fdb\u5ea6\u5bf9\u8bdd\u6846\u3002
-
update_progress_dialog()
\uff1a\u7528\u4e8e\u66f4\u65b0\u8fdb\u5ea6\u5bf9\u8bdd\u6846\u4e2d\u8fdb\u5ea6\u6761\u7684\u8fdb\u5ea6\u4fe1\u606f\u548c\u989d\u5916\u663e\u793a\u7684\u4fe1\u606f\u3002
\u5404\u4e2a\u51fd\u6570\u5177\u4f53\u4fe1\u606f\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.adapter.uprogress
"},{"location":"progressbar/#_6","title":"\uff08\u4e8c\uff09\u793a\u4f8b","text":"import time\n\nfrom pyguiadapter.adapter import GUIAdapter, udialog\nfrom pyguiadapter.adapter import uprogress\nfrom pyguiadapter.adapter.ucontext import is_function_cancelled\nfrom pyguiadapter.adapter.uoutput import uprint\n\n\ndef progress_dialog_example(total: int = 100, delay: float = 0.5):\n \"\"\"\n An example for **progress dialog** features\n\n @param total: how many task will be processed\n @param delay: how much time will be consumed per task\n @return:\n \"\"\"\n cancelled = False\n task_processed = 0\n # use this function to show a progress dialog\n uprogress.show_progress_dialog(\n 0, total, message_visible=True, info_visible=True, modal=False\n )\n for i in range(total):\n if is_function_cancelled():\n uprint(\"Cancelled!\")\n cancelled = True\n break\n task_processed = i + 1\n uprint(f\"[Processed] {task_processed}\")\n # use this function to update the progressbar and info message in the progress dialog\n uprogress.update_progress_dialog(\n task_processed, info=f\"[{task_processed}/{total}] please wait...\"\n )\n time.sleep(delay)\n if cancelled:\n udialog.show_warning_messagebox(\n f\"{task_processed} task(s) processed!\", title=\"Cancelled\"\n )\n else:\n udialog.show_info_messagebox(\n f\"{task_processed} task(s) processed!\", title=\"Completed\"\n )\n # use this function to dismiss the progress dialog after the task is done\n uprogress.dismiss_progress_dialog()\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(progress_dialog_example, cancelable=True)\n adapter.run()\n
\u6548\u679c\u5982\u4e0b\uff1a
"},{"location":"quickstart/","title":"\u5feb\u901f\u5f00\u59cb","text":""},{"location":"quickstart/#_1","title":"\uff08\u4e00\uff09\u524d\u7f6e\u6761\u4ef6","text":"\u8981\u4f7f\u7528PyGUIAdapter
\u5f00\u53d1\u5e94\u7528\u7a0b\u5e8f\uff0c\u9700\u6ee1\u8db3\u4ee5\u4e0b\u6761\u4ef6\uff1a
Python
\u7248\u672c >= 3.8
- \u5b89\u88c5
PyGUIAdapter
- \u5b89\u88c5Qt\u7684\u7ed1\u5b9a\u5e93\u4e4b\u4e00\uff0c\u53ef\u9009\uff1a
PyQt5
\u3001PyQt6
\u3001PySide2
\u3001PySide6
"},{"location":"quickstart/#_2","title":"\uff08\u4e8c\uff09\u5b89\u88c5\u4f9d\u8d56","text":"1\u3001\u5b89\u88c5PyGUIAdapter
pip install PyGUIAdapter\n
2\u3001\u5b89\u88c5Qt\u7684\u7ed1\u5b9a\u5e93\uff0c\u8fd9\u91cc\u4ee5PySide2
\u4e3a\u4f8b\uff1a
pip install pyside2\n
\u5982\u679c\u4f60\u7684\u73af\u5883\u4e0b\u540c\u65f6\u5b89\u88c5\u4e86\u591a\u4e2aQt\u7ed1\u5b9a\u5e93\uff0cqtpy
\u9ed8\u8ba4\u4f1a\u4f7f\u7528PyQt5
(\u5982\u679c\u5b58\u5728\u7684\u8bdd)\u3002\u53ef\u4ee5\u901a\u8fc7\u73af\u5883\u53d8\u91cfQT_API
\u660e\u786e\u6307\u5b9a\u8981\u4f7f\u7528\u7684\u7ed1\u5b9a\u5e93\uff0c\u53ef\u4ee5\u6307\u5b9a\u4ee5\u4e0b\u503c\uff1a
pyqt5
pyside2
pyqt6
pyside6
\u53ef\u4ee5\u53c2\u89c1qtpy\u5b98\u65b9\u8bf4\u660e\u3002
"},{"location":"quickstart/#_3","title":"\uff08\u4e09\uff09\u7f16\u5199\u4ee3\u7801","text":""},{"location":"quickstart/#1","title":"1\u3001\u5b9e\u73b0\u4e1a\u52a1\u903b\u8f91\uff0c\u5e76\u5c01\u88c5\u4e3a\u51fd\u6570\u3002","text":"from typing import Optional\n\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.exceptions import ParameterError\n\n\ndef equation_solver(a: float = 1.0, b: float = 0.0, c: float = 0.0) -> Optional[tuple]:\n \"\"\"A simple equation solver for equations like:\n\n **ax^2 + bx + c = 0** (a, b, c \u2208 **R** and a \u2260 0)\n\n @param a: a \u2208 R and a \u2260 0\n @param b: b \u2208 R\n @param c: c \u2208 R\n @return:\n \"\"\"\n if a == 0:\n raise ParameterError(parameter_name=\"a\", message=\"a cannot be zero!\")\n uprint(f\"Equation:\")\n uprint(f\" {a}x\u00b2 + {b}x + {c} = 0\")\n delta = b**2 - 4 * a * c\n if delta < 0:\n return None\n x1 = (-b + delta**0.5) / (2 * a)\n if delta == 0:\n return x1, x1\n x2 = (-b - delta**0.5) / (2 * a)\n return x1, x2\n
"},{"location":"quickstart/#2gui","title":"2\u3001\u521b\u5efaGUI\u754c\u9762","text":"from pyguiadapter.adapter import GUIAdapter\n...\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(equation_solver)\n adapter.run()\n
\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a
from typing import Optional\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.exceptions import ParameterError\n\n\ndef equation_solver(a: float = 1.0, b: float = 0.0, c: float = 0.0) -> Optional[tuple]:\n \"\"\"A simple equation solver for equations like:\n\n **ax^2 + bx + c = 0** (a, b, c \u2208 **R** and a \u2260 0)\n\n @param a: a \u2208 R and a \u2260 0\n @param b: b \u2208 R\n @param c: c \u2208 R\n @return:\n \"\"\"\n if a == 0:\n raise ParameterError(parameter_name=\"a\", message=\"a cannot be zero!\")\n uprint(f\"Equation:\")\n uprint(f\" {a}x\u00b2 + {b}x + {c} = 0\")\n delta = b**2 - 4 * a * c\n if delta < 0:\n return None\n x1 = (-b + delta**0.5) / (2 * a)\n if delta == 0:\n return x1, x1\n x2 = (-b - delta**0.5) / (2 * a)\n return x1, x2\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(equation_solver)\n adapter.run()\n
\u754c\u9762\u6548\u679c\u5982\u4e0b\uff1a
"},{"location":"quickstart/#_4","title":"\uff08\u56db\uff09\u4e00\u4e9b\u8bf4\u660e","text":""},{"location":"quickstart/#1_1","title":"1\u3001\u539f\u7406","text":"\u5728PyGUIAdapter
\u4e2d\uff0c\u51fd\u6570\u662f\u754c\u9762\u7684\u57fa\u672c\u5355\u5143\uff0c\u4e00\u4e2a\u51fd\u6570\u5bf9\u5e94\u4e00\u4e2a\u7a97\u53e3\uff0c\u51fd\u6570\u7684\u53c2\u6570\u5217\u8868\u5219\u5b9a\u4e49\u4e86\u7a97\u53e3\u4e2d\u7684\u8f93\u5165\u63a7\u4ef6\u3002
\u5728\u57fa\u4e8e\u201c\u8f93\u5165\uff08Input\uff09-\u5904\u7406\uff08Process\uff09-\u8f93\u51fa\uff08Output\uff09
\u201d\u7684\u7a0b\u5e8f\u8bbe\u8ba1\u6a21\u578b\u4e2d\uff0cPyGUIAdapter
\u4e3a\u5f00\u53d1\u8005\u81ea\u52a8\u5b8c\u6210\u4e86\u201c\u8f93\u5165\uff08Input\uff09
\u201d\u548c\u201c\u8f93\u51fa\uff08Output\uff09
\u201d\u8fd9\u4e24\u4e2a\u73af\u8282\u3002\u56e0\u6b64\uff0c\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u5f00\u53d1\u8005\u552f\u4e00\u9700\u8981\u5173\u6ce8\u7684\u662f\u5982\u4f55\u5b9e\u73b0\u201c\u5904\u7406\uff08Process\uff09
\u201d\u73af\u8282\uff0c\u5373\u7a0b\u5e8f\u7684\u6838\u5fc3\u529f\u80fd\u6216\u8005\u8bf4\u4e1a\u52a1\u903b\u8f91\u3002
\u4e0e\u4f20\u7edfGUI\u7f16\u7a0b\u4e0d\u540c\uff0c\u5728PyGUIAdapter
\u4e2d\uff0c\u7a97\u53e3\u548c\u63a7\u4ef6\u7684\u521b\u5efa\u3001\u7ba1\u7406\u8fc7\u7a0b\u5bf9\u4e8e\u5f00\u53d1\u8005\u800c\u8a00\u662f\u900f\u660e\u7684\uff0c\u5f00\u53d1\u8005\u51e0\u4e4e\u4e0d\u4f1a\u611f\u77e5\u5230\u8fd9\u4e00\u8fc7\u7a0b\u7684\u5b58\u5728\u3002\u8fd9\u610f\u5473\u7740\uff0c\u5f00\u53d1\u8005\u4e0d\u4f1a\u88ab\u201c\u5982\u4f55\u521b\u5efa\u548c\u9500\u6bc1\u7a97\u53e3\u548c\u63a7\u4ef6\u201d
\u3001\u201c\u5982\u4f55\u5bf9\u63a7\u4ef6\u8fdb\u884c\u5e03\u5c40\u201d
\u3001\u201c\u5982\u4f55\u5904\u7406\u7528\u6237\u8f93\u5165\u201d
\u3001\u201c\u5982\u4f55\u54cd\u5e94\u4e8b\u4ef6\u201d
\u4e4b\u7c7b\u7ec6\u679d\u672b\u8282\u7684\u95ee\u9898\u5206\u6563\u6ce8\u610f\u529b\uff0c\u4ece\u800c\u80fd\u591f\u5c06\u5173\u6ce8\u70b9\u59cb\u7ec8\u805a\u7126\u5728\u6838\u5fc3\u529f\u80fd\u7684\u5b9e\u73b0\u4e0a\u3002
\u5c06\u754c\u9762\u4e0e\u903b\u8f91\u8fdb\u884c\u5206\u79bb\u88ab\u8ba4\u4e3a\u662f\u4e00\u79cd\u597d\u7684\u5b9e\u8df5\uff0c\u5982\u679c\u80fd\u591f\u5728\u5f00\u53d1\u8005\u65e0\u611f\u77e5\u7684\u60c5\u51b5\u4e0b\u5b8c\u6210\u5168\u90e8\uff08\u6216\u8005\u5927\u90e8\u5206\uff09GUI\u76f8\u5173\u7684\u7f16\u7a0b\u5de5\u4f5c\uff0c\u90a3\u4e48\u53ef\u4ee5\u8bf4\uff0c\u57fa\u4e8e\u8fd9\u79cd\u6784\u67b6\u7f16\u5199\u7684\u4ee3\u7801\u5929\u7136\u5c31\u662f\u903b\u8f91\u4e0e\u754c\u9762\u5206\u79bb\u7684\u3002\u8981\u5b9e\u73b0\u8fd9\u4e00\u70b9\uff0c\u5b9e\u9645\u4e0a\u4e0d\u4f1a\u975e\u5e38\u590d\u6742\uff0c\u4e5f\u65e0\u9700\u6240\u8c13\u7684\u201c\u9ed1\u9b54\u6cd5\u201d\uff0c\u53ea\u9700\u8981\u7528\u5230\u73b0\u4ee3Python\u7684\u4e00\u4e9b\u57fa\u672c\u7279\u6027\uff0c\u5305\u62ec\uff1a
- \u7c7b\u578b\u6ce8\u89e3\uff08type hint\uff09
- \u5185\u9192\u4e0e\u53cd\u5c04\uff08inspect\uff09
- \u6587\u6863\u5b57\u7b26\u4e32\uff08
docstring
\uff09
\u5177\u4f53\u800c\u8a00\uff0c\u5728\u8fd0\u884c\u65f6\uff0cPyGUIAdapter
\u4f1a\u4ece\u51fd\u6570\u7b7e\u540d\u4e2d\u8bfb\u53d6\u5176\u53c2\u6570\u5217\u8868\u4fe1\u606f\uff0c\u7136\u540e\u6839\u636e\u53c2\u6570\u7684\u7c7b\u578b\uff0c\u81ea\u52a8\u9009\u62e9\u6700\u5408\u9002\u63a7\u4ef6\u3002
\u4f8b\u5982\uff1a\u5bf9\u4e8eint
\u7c7b\u578b\u7684\u53c2\u6570\uff0c\u5c06\u9ed8\u8ba4\u521b\u5efaIntSpinBox
\uff1b\u5bf9\u4e8estr
\u7c7b\u578b\u7684\u53c2\u6570\uff0c\u5c06\u9ed8\u8ba4\u521b\u5efaLineEdit
\u7b49\u3002
\u540c\u65f6\uff0cPyGUIAdapter
\u8fd8\u5c06\u4ece\u51fd\u6570\u7684\u7b7e\u540d\u3001docstring
\u4e2d\uff0c\u5206\u6790\u3001\u6536\u96c6\u5176\u4ed6\u6709\u7528\u7684\u4fe1\u606f\uff0c\u5e76\u6839\u636e\u8fd9\u4e9b\u4fe1\u606f\uff0c\u81ea\u5b8c\u6210\u7a97\u53e3\u521b\u5efa\u3001\u754c\u9762\u5e03\u5c40\u548c\u4e8b\u4ef6\u7ed1\u5b9a\u7b49\u5de5\u4f5c\u3002
\u5f53\u7528\u6237\u70b9\u51fbExecute
\u6309\u94ae\u65f6\uff0cPyGUIAdapter
\u5c06\u4ece\u63a7\u4ef6\u4e2d\u6536\u96c6\u7528\u6237\u8f93\u5165\u7684\u6570\u636e\uff0c\u5bf9\u8fd9\u4e9b\u6570\u636e\u8fdb\u884c\u5fc5\u8981\u8f6c\u6362\u548c\u5904\u7406\u4e4b\u540e\uff0c\u5c06\u5176\u4f5c\u4e3a\u53c2\u6570\u8c03\u7528\u51fd\u6570\uff0c\u7136\u540e\u7b49\u5f85\u51fd\u6570\u6267\u884c\u5b8c\u6bd5\uff0c\u83b7\u53d6\u51fd\u6570\u7684\u8fd4\u56de\u503c\u6216\u5904\u7406\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u53d1\u751f\u7684\u5f02\u5e38\u3002
PyGUIAdapter
\u5145\u5206\u5229\u7528\u4e86Python\u7684\u7c7b\u578b\u6ce8\u89e3\u673a\u5236\u3002\u5728PyGUIAdapter
\u4e2d\uff0c\u51fd\u6570\u53c2\u6570\u7684\u7c7b\u578b\u6ce8\u89e3\u4e0d\u662f\u53ef\u6709\u53ef\u65e0\u7684\u4e1c\u897f\uff0c\u5b83\u662f\u751f\u6210\u53c2\u6570\u63a7\u4ef6\u7684\u51b3\u5b9a\u56e0\u7d20\u4e4b\u4e00\u3002\u867d\u7136\u5e76\u975e\u8bf4\u4e0d\u4f7f\u7528\u7c7b\u578b\u6ce8\u89e3\u5c31\u5b8c\u5168\u65e0\u6cd5\u5229\u7528PyGUIAdapter
\u2014\u2014PyGUIAdapter
\u4e5f\u5141\u8bb8\u5f00\u53d1\u8005\u624b\u52a8\u4e3a\u6bcf\u4e2a\u53c2\u6570\u663e\u5f0f\u5730\u6307\u5b9a\u63a7\u4ef6\u2014\u2014\u4f46\u662f\uff0c\u8fd9\u6837\u505a\u5728\u5f88\u5927\u7a0b\u5ea6\u4e0a\u5931\u53bb\u4e86\u4f7f\u7528PyGUIAdapter
\u5e26\u6765\u7684\u65b9\u4fbf\u3002\u56e0\u6b64\uff0c\u5f3a\u70c8\u5efa\u8bae\u5f00\u53d1\u8005\u517b\u6210\u4f7f\u7528\u7c7b\u578b\u6ce8\u89e3\u7684\u4e60\u60ef\u3002
"},{"location":"quickstart/#2","title":"2\u3001\u53c2\u6570\u6821\u9a8c\u4e0e\u5f02\u5e38\u5904\u7406","text":"\u7a0b\u5e8f\u8fd0\u884c\u65f6\u7684\u9519\u8bef\u6216\u8005\u5f02\u5e38\uff0c\u5f88\u591a\u65f6\u5019\u6839\u6e90\u5728\u4e8e\u672a\u7ecf\u6821\u9a8c\u7684\u7528\u6237\u8f93\u5165\u3002\u5728\u7f16\u5199\u7a0b\u5e8f\u65f6\uff0c\u8981\u907f\u514d\u8fc7\u5ea6\u4e50\u89c2\uff0c\u5c24\u5176\u662f\u5728\u6d89\u53ca\u5230\u4e0e\u7528\u6237\u8f93\u5165\u6253\u4ea4\u9053\u7684\u573a\u5408\uff0c\u8981\u5c3d\u91cf\u8003\u8651\u201c\u6700\u574f\u201d\u7684\u60c5\u51b5\uff0c\u4e5f\u5c31\u662f\u6240\u8c13\u7684\u201c\u8fb9\u754c\u6761\u4ef6\u201d\u3002\u5f88\u591a\u65f6\u5019\uff0c\u5949\u884c\u201c\u6c38\u8fdc\u4e0d\u8981\u76f8\u4fe1\u7528\u6237\u7684\u8f93\u5165\u201d\u53ef\u4ee5\u907f\u514d\u5f88\u591a\u95ee\u9898\uff08\u6216\u8005\u8bf4\u7edd\u5927\u90e8\u5206\u95ee\u9898\uff09\u3002\u5bf9\u7528\u6237\u8f93\u5165\u8fdb\u884c\u6821\u9a8c\uff0c\u5c3d\u53ef\u80fd\u8fc7\u6ee4\u90a3\u4e9b\u201c\u975e\u6cd5\u201d\u7684\u503c\u662f\u589e\u5f3a\u7a0b\u5e8f\u5065\u58ee\u6027\u7684\u5173\u952e\u6240\u5728\u3002
\u56e0\u6b64\uff0cPyGUIAdapter
\u9f13\u52b1\u5f00\u53d1\u8005\u5bf9\u51fd\u6570\u53c2\u6570\uff08\u5373\u7528\u6237\u8f93\u5165\uff09\u8fdb\u884c\u6821\u9a8c\uff0c\u5e76\u4e3a\u6b64\u63d0\u4f9b\u4e86\u4e00\u79cd\u7b80\u5355\u4e14\u7b26\u5408\u76f4\u89c9\u7684\u673a\u5236\u3002 \u5728\u4e0a\u8ff0\u793a\u4f8b\u4ee3\u7801\u4e2d\uff0c\u6709\u4ee5\u4e0b\u51e0\u884c\u4ee3\u7801\uff0c\u6f14\u793a\u4e86\u6821\u9a8c\u53c2\u6570\u7684\u57fa\u672c\u65b9\u5f0f\uff1a
...\n if a == 0:\n raise ParameterError(parameter_name=\"a\", message=\"a cannot be zero!\")\n ...\n
\u5bf9\u4e8e\u975e\u6cd5\u7684\u51fd\u6570\u53c2\u6570\u503c\uff0c\u5f00\u53d1\u8005\u53ea\u9700\u629b\u51faParameterError
\u5f02\u5e38\uff0c\u5373\u5b8c\u6210\u4e86\u53c2\u6570\u7684\u6821\u9a8c\u5de5\u4f5c\u3002PyGUIAdapter
\u5c06\u81ea\u52a8\u63a5\u7ba1\u540e\u7eed\u7684\u5de5\u4f5c\u2014\u2014\u5305\u62ec\u4ee5\u4e00\u79cd\u5408\u9002\u7684\u65b9\u5f0f\u63d0\u9192\u7528\u6237\u54ea\u91cc\u53d1\u751f\u4f55\u79cd\u5f02\u5e38\u3002
\u5f53\u7136\uff0c\u5f00\u53d1\u8005\u5982\u679c\u504f\u7231\u6240\u8c13\u7684\u201cValidator\u201d\u6a21\u5f0f\uff0c\u6216\u8005\u60f3\u8981\u590d\u7528\u67d0\u4e9b\u6821\u9a8c\u903b\u8f91\uff0c\u4e5f\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\uff1a
def non_zero_validator(parameter_name: str, value: Union[int, float]):\n if not isinstance(value, (int, float)):\n raise ParameterError(parameter_name, message=\"must be a number!\")\n\n if value == 0:\n raise ParameterError(parameter_name, message=\"cannot be zero!\")\n\n\ndef your_function(a: int, b: int, c: float):\n non_zero_validator(\"a\", a)\n non_zero_validator(\"b\", b)\n non_zero_validator(\"c\", c)\n
\u4e8b\u5b9e\u4e0a\uff0cPyGUIAdapter
\u5bf9\u4e8eParameterError
\u7684\u5904\u7406\u53ef\u4ee5\u770b\u4f5c\u4e00\u822c\u5f02\u5e38\u5904\u7406\u673a\u5236\u7684\u4e00\u4e2a\u7279\u4f8b\u3002\u5c3d\u7ba1PyGUIAdapter
\u9f13\u52b1\u5f00\u53d1\u8005\u5c3d\u53ef\u80fd\u9884\u89c1\u7a0b\u5e8f\u53ef\u80fd\u53d1\u751f\u7684\u5f02\u5e38\u5e76\u63d0\u524d\u89c4\u907f\u5b83\u4eec\uff0c\u4f46\u4ece\u5ba2\u89c2\u4e0a\u770b\uff0c\u7a0b\u5e8f\u7684\u5f02\u5e38\u65e0\u6cd5\u4fdd\u8bc1\u5b8c\u5168\u6d88\u9664\u3002\u56e0\u6b64\uff0c\u5bf9\u4e8e\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u53d1\u751f\u7684\u5f02\u5e38\uff0cPyGUIAdapter
\u91c7\u53d6\u7684\u9ed8\u8ba4\u7b56\u7565\u662f\uff1a\u6355\u83b7\u5b83\u4eec\uff0c\u5e76\u4ee5\u4e00\u79cd\u5408\u9002\u7684\u65b9\u5f0f\u63d0\u9192\u7528\u6237\uff0c\u800c\u4e0d\u662f\u8ba9\u6574\u4e2a\u7a0b\u5e8f\u76f4\u63a5\u5d29\u6e83\u3002 \u8fd9\u6837\u7684\u8bbe\u8ba1\u4e3b\u8981\u662f\u51fa\u4e8e\u589e\u5f3a\u7a0b\u5e8f\u5065\u58ee\u6027\u7684\u8003\u8651\u3002
"},{"location":"quickstart/#3","title":"3\u3001\u63cf\u8ff0\u6027\u4fe1\u606f\uff08\u5e2e\u52a9\u4fe1\u606f\uff09","text":"\u65e0\u8bba\u662f\u547d\u4ee4\u884c\u7a0b\u5e8f\u8fd8\u662f\u56fe\u5f62\u754c\u9762\u7a0b\u5e8f\uff0c\u4e3a\u7a0b\u5e8f\u53ca\u5176\u53c2\u6570\u63d0\u4f9b\u63cf\u8ff0\u6027\u6587\u5b57\u90fd\u662f\u975e\u5e38\u6709\u5fc5\u8981\u7684\u4e00\u4ef6\u4e8b\u3002\u8fd9\u4e9b\u6587\u5b57\u4e00\u822c\u88ab\u79f0\u4e3a\u7a0b\u5e8f\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5bf9\u4e8eCLI
\u7a0b\u5e8f\uff0c\u4e00\u822c\u4f7f\u7528-h
\u6216--help
\u6765\u83b7\u53d6\u5176\u5e2e\u52a9\u4fe1\u606f\uff0c\u4f8b\u5982\uff0c\u4e0b\u56fe\u662fpyhton -h
\u547d\u4ee4\u6253\u5370\u51fa\u7684Python
\u89e3\u91ca\u5668\u7a0b\u5e8f\u7684\u90e8\u5206\u5e2e\u52a9\u4fe1\u606f\u3002
PyGUIAdapter
\u540c\u6837\u652f\u6301\u4e3a\u51fd\u6570\u53c2\u6570\u4ee5\u53ca\u51fd\u6570\u672c\u8eab\u6dfb\u52a0\u63cf\u8ff0\u4fe1\u606f\u3002
\u5bf9\u4e8e\u51fd\u6570\u7684\u53c2\u6570\uff0cPyGUIAdapter
\u5728\u5176\u8f93\u5165\u63a7\u4ef6\u7684\u4e0a\u65b9\u9884\u7559\u4e86\u7528\u4e8e\u663e\u793a\u63cf\u8ff0\u4fe1\u606f\u7684\u7a7a\u95f4\uff1a
\u5bf9\u4e8e\u51fd\u6570\u672c\u8eab\uff0cPyGUIAdapter
\u5219\u63d0\u4f9b\u4e86\u4e13\u95e8\u7684\u6587\u6863\u6d4f\u89c8\u5668\uff08Document Browser\uff09
\u6765\u5c55\u793a\u5176\u8bf4\u660e\u4fe1\u606f\uff0c\u51fd\u6570\u7684\u63cf\u8ff0\u4fe1\u606f\uff0c\u4e00\u822c\u4e5f\u88ab\u79f0\u4e3a\u51fd\u6570\u7684\u8bf4\u660e\u6587\u6863\uff1a
\u56de\u770b\u793a\u4f8b\u4ee3\u7801\uff0c\u6211\u4eec\u4f3c\u4e4e\u5e76\u4f7f\u7528\u901a\u8fc7\u7279\u6b8a\u7684\u65b9\u6cd5\u8bbe\u7f6e\u8fd9\u4e9b\u4fe1\u606f\uff0c\u90a3\u4e48\u8fd9\u4e9b\u4fe1\u606f\u662f\u4ece\u4f55\u800c\u6765\u5462\uff1f\u4ed4\u7ec6\u9605\u8bfb\u4ee3\u7801\uff0c\u4e0d\u96be\u53d1\u73b0\uff0c\u8fd9\u4e9b\u4fe1\u606f\u5b9e\u9645\u4e0a\u6765\u81ea\u4e8e\u51fd\u6570\u7684\u6587\u6863\u5b57\u7b26\u4e32\uff08
docstring\uff09
\u3002
\u201c\u5c3d\u53ef\u80fd\u5229\u7528\u73b0\u6709\u4fe1\u606f\uff0c\u964d\u4f4e\u5f00\u53d1\u8005\u7684\u5b66\u4e60\u548c\u4f7f\u7528\u6210\u672c\u201d\u662fPyGUIAdapter
\u7684\u91cd\u8981\u8bbe\u8ba1\u601d\u60f3\u3002PyGUIAdapter
\u4f1a\u81ea\u52a8\u4ece\u51fd\u6570\u7684docstring
\u4e2d\u63d0\u53d6\u51fd\u6570\u548c\u53c2\u6570\u7684\u63cf\u8ff0\u4fe1\u606f\uff0c\u5e76\u5c06\u5176\u663e\u793a\u5728\u6b63\u786e\u4f4d\u7f6e\u3002\u5f53\u7136\uff0c\u8fd9\u8981\u6c42\u5f00\u53d1\u8005\u5c3d\u53ef\u80fd\u89c4\u8303\u5730\u7f16\u5199\u51fd\u6570\u7684docstring
\uff0c\u8003\u8651\u5230\u4e0d\u540c\u5f00\u53d1\u8005\u53ef\u80fd\u4e60\u60ef\u4e8e\u4e0d\u540c\u7684docstring
\uff0cPyGUIAdapter
\u5bf9\u591a\u79cd\u5e38\u7528\u7684\u683c\u5f0f\u8fdb\u884c\u4e86\u652f\u6301\uff0c\u5305\u62ec\uff1a
ReST
Google
Numpydoc-style
Epydoc
\u9664\u4e86\u4ece\u51fd\u6570\u7684docstring
\u4e2d\u81ea\u52a8\u63d0\u53d6\u63cf\u8ff0\u4fe1\u606f\uff0cPyGUIAdapter
\u4e5f\u5141\u8bb8\u5f00\u53d1\u8005\u624b\u52a8\u8bbe\u7f6e\u8fd9\u4e9b\u4fe1\u606f\u3002\u8fd9\u5728\u4e00\u4e9b\u573a\u5408\u4e0b\u975e\u5e38\u6709\u7528\u3002\u6bd4\u5982\u63cf\u8ff0\u4fe1\u606f\u592a\u957f\u4e0d\u5b9c\u653e\u5230docstring
\u4e2d\uff0c\u6216\u8005\u9700\u8981\u5bf9\u63cf\u8ff0\u4fe1\u606f\u8fdb\u884c\u56fd\u9645\u5316\u7b49\u60c5\u51b5\u3002\u5173\u4e8e\u5982\u4f55\u624b\u52a8\u751a\u81f3\u63a7\u4ef6\u6216\u51fd\u6570\u7684\u63cf\u8ff0\u4fe1\u606f\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- \u5173\u4e8e\u5982\u4f55\u624b\u52a8\u8bbe\u7f6e\u53c2\u6570\u7684\u63cf\u8ff0\u4fe1\u606f\uff0c\u53c2\u89c1\uff1a\u914d\u7f6e\u63a7\u4ef6\u5c5e\u6027\u3002
- \u5173\u4e8e\u5982\u4f55\u624b\u52a8\u8bbe\u7f6e\u51fd\u6570\u7684\u63cf\u8ff0\u4fe1\u606f\uff08\u8bf4\u660e\u6587\u6863\uff09\uff0c\u53c2\u89c1\uff1a\u6dfb\u52a0\u591a\u4e2a\u51fd\u6570\u3002
"},{"location":"quickstart/#4","title":"4\u3001\u6253\u5370\u6d88\u606f","text":"print()
\u662fPython\u5f00\u53d1\u8005\u975e\u5e38\u719f\u6089\u7684\u4e00\u4e2a\u51fd\u6570\uff0c\u5e38\u88ab\u7528\u4e8e\u5411\u7528\u6237\u5c55\u793a\u7a0b\u5e8f\u8fd0\u884c\u4fe1\u606f\u3002\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u901a\u8fc7print()
\u6253\u5370\u7684\u4fe1\u606f\u4f1a\u88ab\u8f93\u51fa\u5230\u7a0b\u5e8f\u7684\u6807\u51c6\u8f93\u51fa\u4e0a\uff0c\u4e3a\u4e86\u4f7f\u5f00\u53d1\u8005\u80fd\u591f\u5c06\u4fe1\u606f\u6253\u5370\u5230\u7a97\u53e3\u7684\u8f93\u51fa\u6d4f\u89c8\u5668\uff08Output Browser\uff09
\u4e2d\uff0cPyGUIAdapter
\u63d0\u4f9b\u4e86uprint()
\u51fd\u6570\u3002
\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u5bfc\u5165uprint()
\u51fd\u6570\uff1a
from pyguiadapter.adapter.uoutput import uprint\n
\u8be5\u51fd\u6570\u7684\u7528\u6cd5\u540cprint()
\u7c7b\u4f3c\uff0c\u5176\u539f\u578b\u5982\u4e0b\uff1a
uprint()
\u652f\u6301\u8f93\u51fahtml
\u683c\u5f0f\u7684\u5bcc\u6587\u672c\u5185\u5bb9\uff0c\u6bd4\u5982\u56fe\u7247\u3002\u9700\u8981\u6307\u51fa\u7684\u662f\uff0c\u8f93\u51fa\u6d4f\u89c8\u5668
\u5bf9\u4e8ehtml
\u7684\u652f\u6301\u662f\u6709\u9650\u7684\uff0c\u5177\u4f53\u53ef\u4ee5\u53c2\u8003QT\u7684\u5b98\u65b9\u6587\u6863\uff1aSupported HTML Subset
\u9664\u4e86uprint()
\uff0cpyguiadapter.adapter.uoutput
\u4e2d\u8fd8\u5b9e\u73b0\u4e86\u8bb8\u591a\u7528\u4e8e\u8f93\u51fa\u4fe1\u606f\u7684\u51fd\u6570\uff0c\u501f\u52a9\u8fd9\u4e9b\u51fd\u6570\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u8f93\u51fa\u683c\u5f0f\u66f4\u52a0\u4e30\u5bcc\u7684\u5185\u5bb9\uff0c\u53ef\u4ee5\u67e5\u770b\u4ee5\u4e0b\u6587\u6863\u83b7\u53d6\u66f4\u591a\u4fe1\u606f\uff1apyguiadapter.adapter.uoutput
"},{"location":"quickstart/#pyguiadapter.adapter.uoutput.uprint","title":"uprint(*args: Any, sep: str = ' ', end: str = '\\n', html: bool = False, scroll_to_bottom: bool = True) -> None
","text":"\u6253\u5370\u4fe1\u606f\u5230\u8f93\u51fa\u6d4f\u89c8\u5668
Parameters:
Name Type Description Default *args
Any
\u8981\u6253\u5370\u7684\u4fe1\u606f
()
sep
str
\u6bcf\u6761\u4fe1\u606f\u4e4b\u95f4\u7684\u5206\u9694\u5b57\u7b26\u4e32
' '
end
str
\u6dfb\u52a0\u5230\u6700\u540e\u4e00\u6761\u4fe1\u606f\u540e\u9762\u7684\u5b57\u7b26\u4e32
'\\n'
html
bool
\u8981\u6253\u5370\u7684\u4fe1\u606f\u662f\u5426\u4e3ahtml
\u683c\u5f0f
False
scroll_to_bottom
bool
\u6253\u5370\u4fe1\u606f\u540e\u662f\u5426\u5c06\u8f93\u51fa\u6d4f\u89c8\u5668
\u6eda\u52a8\u5230\u6700\u5e95\u90e8
True
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"quickstart/#_5","title":"\uff08\u4e94\uff09\u793a\u4f8b\u8fdb\u9636","text":"PyGUIAdapter
\u7684\u9ad8\u5ea6\u7075\u6d3b\u6027\u4f53\u73b0\u5728\u5141\u8bb8\u5f00\u53d1\u8005\u5bf9\u751f\u6210\u7684\u754c\u9762\u8fdb\u884c\u914d\u7f6e\uff0c\u5f00\u53d1\u8005\u4e0d\u4ec5\u53ef\u4ee5\u914d\u7f6e\u7a97\u53e3\u7684\u5c5e\u6027\u548c\u5916\u89c2\uff0c\u800c\u4e14\u53ef\u4ee5\u5bf9\u51fd\u6570\u6bcf\u4e2a\u53c2\u6570\u5bf9\u5e94\u7684\u63a7\u4ef6\u8fdb\u884c\u7cbe\u7ec6\u5316\u7684\u8c03\u6574\uff0c\u6539\u53d8\u5176\u9ed8\u8ba4\u7684\u884c\u4e3a\u3002
\u4e0b\u9762\uff0c\u5c06\u9010\u6b65\u5b8c\u5584\u4e0a\u8ff0\u793a\u4f8b\u4ee3\u7801\uff0c\u5e76\u5728\u6b64\u8fc7\u7a0b\u4e2d\u6f14\u793a\u914d\u7f6e\u7a97\u53e3\u548c\u63a7\u4ef6\u5c5e\u6027\u7684\u65b9\u6cd5\u3002
"},{"location":"quickstart/#1_2","title":"1\u3001\u914d\u7f6e\u7a97\u53e3\u5c5e\u6027","text":"\u9996\u5148\uff0c\u6211\u4eec\u5c06\u5bf9\u793a\u4f8b\u7a0b\u5e8f\u7684\u7a97\u53e3\u8fdb\u884c\u914d\u7f6e\uff0c\u5305\u62ec\uff1a
- \u8c03\u6574\u7a97\u53e3\u5927\u5c0f
- \u8bbe\u7f6e\u7a97\u53e3\u6807\u9898\u548c\u56fe\u6807
- \u9690\u85cf
\u6587\u6863\u6d4f\u89c8\u5668
- \u6539\u53d8\u51fd\u6570\u8fd4\u56de\u503c\u7684\u6d88\u606f\u683c\u5f0f
- \u5f39\u51fa\u5bf9\u8bdd\u6846\u663e\u793a\u51fd\u6570\u8fd4\u56de\u503c
- ......
\u5bf9\u7a97\u53e3\u5c5e\u6027\u7684\u8c03\u6574\u9700\u8981\u501f\u52a9\u7a97\u53e3\u914d\u7f6e\u7c7b
\u5bf9\u8c61\u3002\u5bf9\u4e8e\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff0c\u5176\u7a97\u53e3\u914d\u7f6e\u7c7b\u4e3aFnExecuteWindowConfig
\uff0c\u8be5\u7c7b\u4e2d\u5b9a\u4e49\u4e86\u51fd\u6570\u6267\u884c\u7a97\u53e3\u7684\u53ef\u914d\u7f6e\u5c5e\u6027\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u5bf9\u7a97\u53e3\u8fdb\u884c\u914d\u7f6e\uff1a
\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a
from typing import Optional\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.exceptions import ParameterError\nfrom pyguiadapter.windows.fnexec import FnExecuteWindowConfig\n\n\ndef equation_solver_2(\n a: float = 1.0, b: float = 0.0, c: float = 0.0\n) -> Optional[tuple]:\n \"\"\"A simple equation solver for equations like:\n\n **ax^2 + bx + c = 0** (a, b, c \u2208 **R** and a \u2260 0)\n\n @param a: a \u2208 R and a \u2260 0\n @param b: b \u2208 R\n @param c: c \u2208 R\n @return:\n \"\"\"\n if a == 0:\n raise ParameterError(parameter_name=\"a\", message=\"a cannot be zero!\")\n uprint(f\"Equation:\")\n uprint(f\" {a}x\u00b2 + {b}x + {c} = 0\")\n delta = b**2 - 4 * a * c\n if delta < 0:\n return None\n x1 = (-b + delta**0.5) / (2 * a)\n if delta == 0:\n return x1, x1\n x2 = (-b - delta**0.5) / (2 * a)\n return x1, x2\n\n\nif __name__ == \"__main__\":\n window_config = FnExecuteWindowConfig(\n title=\"Equation Solver\",\n icon=\"mdi6.function-variant\",\n execute_button_text=\"Solve\",\n size=(350, 550),\n document_dock_visible=False,\n output_dock_initial_size=(None, 100),\n show_function_result=True,\n function_result_message=\"roots: {}\",\n default_parameter_group_name=\"Equation Parameters\",\n )\n\n adapter = GUIAdapter()\n adapter.add(equation_solver_2, window_config=window_config)\n adapter.run()\n
\u6548\u679c\u5982\u4e0b\uff1a
FnExecuteWindowConfig
\u5b9a\u4e49\u4e86\u5927\u91cf\u53ef\u914d\u7f6e\u5c5e\u6027\uff0c\u8fd9\u91cc\u4ec5\u4ec5\u6f14\u793a\u4e86\u5176\u4e2d\u4e00\u5c0f\u90e8\u5206\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\u83b7\u53d6\u5b8c\u6574\u7684\u53ef\u914d\u7f6e\u5c5e\u6027\u5217\u8868\uff1apyguiadapter.windows.fnexec.FnExecuteWindowConfig
"},{"location":"quickstart/#2_1","title":"2\u3001\u914d\u7f6e\u63a7\u4ef6\u5c5e\u6027","text":"\u5728\u76ee\u524d\u7684\u793a\u4f8b\u7a0b\u5e8f\u4e2d\uff0c\u53c2\u6570a
\u3001b
\u3001c
\u7684\u8f93\u5165\u63a7\u4ef6\u53ea\u80fd\u8f93\u5165\u5c0f\u6570\u70b9\u540e2\u4f4d\uff0c\u4e14\u6bcf\u6b21\u8c03\u6574\u7684\u6b65\u8fdb\u503c\u4e3a1\u3002
\u539f\u56e0\u5728\u4e8efloat
\u7c7b\u578b\u5bf9\u5e94\u7684FloatSpinBox
\u63a7\u4ef6\uff0c\u5176step
\uff08\u5355\u6b21\u6b65\u8fdb\u503c\uff09\u5c5e\u6027\u548cdecimals
\uff08\u5c0f\u6570\u70b9\u4f4d\u6570\uff09\u5c5e\u6027\u5206\u522b\u88ab\u914d\u7f6e\u4e3a1.0
\u548c2
\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u4fee\u6539\u63a7\u4ef6\u7684\u9ed8\u8ba4\u5c5e\u6027\u914d\u7f6e\uff0c\u4ee5\u8fbe\u5230\u6539\u53d8\u63a7\u4ef6\u7684\u9ed8\u8ba4\u884c\u4e3a\u7684\u76ee\u7684\u3002
\u73b0\u5728\u6211\u4eec\u5c06\u5bf9\u4e0a\u8ff0\u793a\u4f8b\u505a\u8fdb\u4e00\u6b65\u4fee\u6539\uff0c\u5c06\u53c2\u6570a
\u3001b
\u3001c
\u5bf9\u5e94\u63a7\u4ef6\u7684decimals
\uff08\u5c0f\u6570\u70b9\u4f4d\u6570\uff09\u914d\u7f6e\u4e3a5
\uff0cstep
\uff08\u5355\u6b21\u6b65\u8fdb\u503c\uff09\u914d\u7f6e\u4e3a0.00005
\u3002
"},{"location":"quickstart/#1paramsend","title":"\u65b9\u6cd51\uff1a\u5229\u7528@params...@end
\u914d\u7f6e\u5757","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u51fd\u6570\u7684docstring
\u4e2d\u914d\u7f6e\u53c2\u6570\u7684\u63a7\u4ef6\u3002PyGUIAdapter
\u5c06docstring
\u4e2d\u4f7f\u7528@params
\u548c@end
\u5305\u88f9\u8d77\u6765\u6587\u672c\u5757\u89c6\u4e3a\u63a7\u4ef6\u7684\u914d\u7f6e\u5757\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u8be5\u533a\u57df\u5bf9\u63a7\u4ef6\u7684\u5c5e\u6027\u8fdb\u884c\u914d\u7f6e\u3002\u914d\u7f6e\u5757\u7684\u683c\u5f0f\u4e3aTOML
\u3002\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u683c\u5f0f\u914d\u7f6e\u6307\u5b9a\u63a7\u4ef6\u7684\u6307\u5b9a\u5c5e\u6027\uff1a
[\u53c2\u6570\u540d\u79f0]\n\u5c5e\u6027\u540d\u79f01 = \u5c5e\u6027\u503c1\n\u5c5e\u6027\u540d\u79f02 = \u5c5e\u6027\u503c2\n\u5c5e\u6027\u540d\u79f0N = \u5c5e\u6027\u503cN\n
\u6bd4\u5982\u8981\u914d\u7f6e\u4e0a\u8ff0\u793a\u4f8b\u4e2d\u53c2\u6570a
\u3001b
\u3001c
\u5bf9\u5e94\u63a7\u4ef6\u7684step
\u5c5e\u6027\u548cdecimals
\u5c5e\u6027\uff0c\u53ef\u4ee5\u8fd9\u6837\u505a\uff1a
\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a
from typing import Optional\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.exceptions import ParameterError\nfrom pyguiadapter.windows.fnexec import FnExecuteWindowConfig\n\n\ndef equation_solver_3(\n a: float = 1.0, b: float = 0.0, c: float = 0.0\n) -> Optional[tuple]:\n \"\"\"A simple equation solver for equations like:\n\n **ax^2 + bx + c = 0** (a, b, c \u2208 **R** and a \u2260 0)\n\n @param a: a \u2208 R and a \u2260 0\n @param b: b \u2208 R\n @param c: c \u2208 R\n @return:\n\n @params\n [a]\n decimals = 5\n step = 0.00005\n\n [b]\n decimals = 5\n step = 0.00005\n\n [c]\n decimals = 5\n step = 0.00005\n @end\n\n \"\"\"\n if a == 0:\n raise ParameterError(parameter_name=\"a\", message=\"a cannot be zero!\")\n uprint(f\"Equation:\")\n uprint(f\" {a}x\u00b2 + {b}x + {c} = 0\")\n delta = b**2 - 4 * a * c\n if delta < 0:\n return None\n x1 = (-b + delta**0.5) / (2 * a)\n if delta == 0:\n return x1, x1\n x2 = (-b - delta**0.5) / (2 * a)\n return x1, x2\n\n\nif __name__ == \"__main__\":\n window_config = FnExecuteWindowConfig(\n title=\"Equation Solver\",\n icon=\"mdi6.function-variant\",\n execute_button_text=\"Solve\",\n size=(350, 550),\n document_dock_visible=False,\n output_dock_initial_size=(None, 100),\n show_function_result=True,\n function_result_message=\"roots: {}\",\n default_parameter_group_name=\"Equation Parameters\",\n )\n\n adapter = GUIAdapter()\n adapter.add(equation_solver_3, window_config=window_config)\n adapter.run()\n
"},{"location":"quickstart/#2_2","title":"\u65b9\u6cd52\uff1a\u4f7f\u7528\u914d\u7f6e\u7c7b\u5bf9\u8c61","text":"\u5728@params...@end
\u5757\u4e2d\u914d\u7f6e\u53c2\u6570\u7684\u63a7\u4ef6\uff0c\u4f18\u70b9\u662f\u7b80\u5355\u3001\u5feb\u901f\uff0c\u4f46\u4e5f\u5e76\u975e\u4e07\u80fd\u3002\u4e00\u65b9\u9762\uff0c\u7531\u4e8e\u914d\u7f6e\u5757\u7684\u683c\u5f0f\u4e3aTOML
\uff0c\u5176\u652f\u6301\u7684\u6570\u636e\u7c7b\u578b\u6709\u9650\uff0c\u67d0\u4e9b\u63a7\u4ef6\u7684\u4e00\u4e9b\u5c5e\u6027\u53ef\u80fd\u4f7f\u7528\u4e86\u8d85\u51fa\u5176\u8868\u8fbe\u80fd\u529b\u8303\u56f4\u7684\u6570\u636e\u7c7b\u578b\uff1b\u53e6\u4e00\u65b9\u9762\uff0c\u5982\u679c\u8981\u914d\u7f6e\u7684\u53c2\u6570\u5f88\u591a\uff0c\u6216\u8005\u8981\u8bbe\u7f6e\u7684\u5c5e\u6027\u5f88\u591a\uff0c\u53ef\u80fd\u4f1a\u4f7fdocstring
\u53d8\u5f97\u975e\u5e38\u5197\u957f\u3002\u5728docstring
\u4e2d\u7f16\u5199\u53c2\u6570\u914d\u7f6e\u4ee3\u7801\u4e5f\u5c06\u5931\u53bb\u73b0\u4ee3IDE
\u6216\u8005\u4ee3\u7801\u7f16\u8f91\u6240\u5e26\u6765\u79cd\u79cd\u4fbf\u5229\uff0c\u6bd4\u5982\u4ee3\u7801\u63d0\u793a\u3001\u81ea\u52a8\u5b8c\u6210\u7b49\u3002
\u603b\u4e4b\uff0c\u5728@params...@end
\u4e2d\u914d\u7f6e\u63a7\u4ef6\u53c2\u6570\u662f\u4e00\u79cd\u5f88\u4fbf\u6377\u7684\u624b\u6bb5\uff0c\u4f46\u5b83\u65e0\u6cd5\u89e3\u51b3\u6240\u6709\u7684\u95ee\u9898\uff0c\u56e0\u6b64\uff0cPyGUIAdapter
\u63d0\u4f9b\u4e86\u53e6\u4e00\u79cd\u66f4\u52a0\u901a\u7528\u7684\u914d\u7f6e\u63a7\u4ef6\u5c5e\u6027\u7684\u65b9\u6cd5\uff0c\u90a3\u5c31\u662f\u4f7f\u7528\u63a7\u4ef6\u7684\u914d\u7f6e\u7c7b\u5bf9\u8c61\uff08\u5b9e\u9645\u4e0a\uff0c\u5728@params...@end
\u4e2d\u7f16\u5199\u7684\u914d\u7f6e\uff0c\u6700\u7ec8\u4e5f\u4f1a\u88ab\u8f6c\u6362\u4e3a\u5bf9\u5e94\u7684\u914d\u7f6e\u7c7b\u5bf9\u8c61\uff09\u3002
\u5728PyGUIAdapter
\uff0c\u51fd\u6570\u53c2\u6570\u7684\u63a7\u4ef6\uff0c\u5176\u7c7b\u578b\u4e00\u822c\u7531\u53c2\u6570\u7684\u6570\u636e\u7c7b\u578b\u51b3\u5b9a\uff0c\u800c\u63a7\u4ef6\u7684\u5c5e\u6027\uff0c\u5219\u7531\u5176\u5bf9\u5e94\u7684\u914d\u7f6e\u7c7b\u5b9a\u4e49\u3002\u6bd4\u5982\uff1a
-
int
-> IntSpinBox
-> IntSpinBoxConfig
-
float
-> FloatSpinBox
-> FloatSpinBox
str
-> LineEdit
-> LineEditConfig
- ......
\u786e\u5b9a\u4e86\u53c2\u6570\u5bf9\u5e94\u63a7\u4ef6\u7684\u7c7b\u578b\uff0c\u4fbf\u53ef\u4ee5\u521b\u5efa\u5bf9\u5e94\u914d\u7f6e\u7c7b\u5bf9\u8c61\u6765\u5bf9\u5176\u5c5e\u6027\u8fdb\u884c\u914d\u7f6e\uff0c\u4ee5\u4e0a\u8ff0\u793a\u4f8b\u4ee3\u7801\u4e3a\u4f8b\uff0c\u53ef\u4ee5\u8fd9\u6837\u914d\u7f6e\u5176\u5c5e\u6027\uff1a
\u4f7f\u7528\u914d\u7f6e\u7c7b\u5bf9\u8c61\u65f6\uff0c\u5f00\u53d1\u8005\u5728\u51fd\u6570\u7b7e\u540d\u4e2d\u6307\u5b9a\u7684\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u5c06\u4f1a\u88ab\u8986\u76d6\uff0c\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u7c7b\u5bf9\u8c61\u7684default_value
\u5c5e\u6027\u91cd\u65b0\u6307\u5b9a
\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b
from typing import Optional\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.exceptions import ParameterError\nfrom pyguiadapter.widgets import FloatSpinBoxConfig\nfrom pyguiadapter.windows.fnexec import FnExecuteWindowConfig\n\n\ndef equation_solver_4(\n a: float = 1.0, b: float = 0.0, c: float = 0.0\n) -> Optional[tuple]:\n \"\"\"A simple equation solver for equations like:\n\n **ax^2 + bx + c = 0** (a, b, c \u2208 **R** and a \u2260 0)\n\n @param a: a \u2208 R and a \u2260 0\n @param b: b \u2208 R\n @param c: c \u2208 R\n @return:\n \"\"\"\n if a == 0:\n raise ParameterError(parameter_name=\"a\", message=\"a cannot be zero!\")\n uprint(f\"Equation:\")\n uprint(f\" {a}x\u00b2 + {b}x + {c} = 0\")\n delta = b**2 - 4 * a * c\n if delta < 0:\n return None\n x1 = (-b + delta**0.5) / (2 * a)\n if delta == 0:\n return x1, x1\n x2 = (-b - delta**0.5) / (2 * a)\n return x1, x2\n\n\nif __name__ == \"__main__\":\n window_config = FnExecuteWindowConfig(\n title=\"Equation Solver\",\n icon=\"mdi6.function-variant\",\n execute_button_text=\"Solve\",\n size=(350, 550),\n document_dock_visible=False,\n output_dock_initial_size=(None, 100),\n show_function_result=True,\n function_result_message=\"roots: {}\",\n default_parameter_group_name=\"Equation Parameters\",\n )\n\n adapter = GUIAdapter()\n adapter.add(\n equation_solver_4,\n window_config=window_config,\n widget_configs={\n \"a\": FloatSpinBoxConfig(\n default_value=1.0,\n decimals=5,\n step=0.00005,\n ),\n \"b\": FloatSpinBoxConfig(decimals=5, step=0.00005),\n \"c\": FloatSpinBoxConfig(decimals=5, step=0.00005),\n },\n )\n adapter.run()\n
-
\u4f7f\u7528\u914d\u7f6e\u7c7b\u5bf9\u8c61\u5bf9\u63a7\u4ef6\u8fdb\u884c\u914d\u7f6e\uff0c\u9996\u5148\u9700\u8981\u77e5\u9053\u53c2\u6570\u5bf9\u5e94\u63a7\u4ef6\u7684\u63a7\u4ef6\u914d\u7f6e\u7c7b\u662f\u4ec0\u4e48\uff0c\u4e0b\u9762\u7684\u94fe\u63a5\u5c55\u793a\u4e86\u53c2\u6570\u6570\u636e\u7c7b\u578b
\u3001\u63a7\u4ef6\u7c7b\u578b
\u3001\u63a7\u4ef6\u914d\u7f6e\u5bf9\u8c61\u7c7b\u578b
\u4e09\u8005\u4e4b\u95f4\u7684\u6620\u5c04\u5173\u7cfb\uff0c\u5f00\u53d1\u8005\u82e5\u4e0d\u6e05\u695a\u67d0\u4e2a\u6570\u636e\u7c7b\u578b\u5bf9\u5e94\u7684\u63a7\u4ef6\u7c7b\u578b
\u6216\u63a7\u4ef6\u914d\u7f6e\u5bf9\u8c61\u7c7b\u578b
\uff0c\u53ef\u4ee5\u53c2\u8003\u8be5\u6587\u6863\uff1a\u63a7\u4ef6\u4e0e\u53c2\u6570\u6570\u636e\u7c7b\u578b\u3002
-
\u5f00\u53d1\u8005\u53ef\u4ee5\u9605\u8bfb\u4ee5\u4e0b\u6587\u6863\uff0c\u4ee5\u83b7\u53d6\u5173\u4e8e\u63a7\u4ef6\u5c5e\u6027\u914d\u7f6e\u66f4\u4e3a\u8be6\u7ec6\u7684\u8bf4\u660e\uff1a\u914d\u7f6e\u63a7\u4ef6\u5c5e\u6027\u3002
"},{"location":"quickstart/#3_1","title":"3\u3001\u6dfb\u52a0\u83dc\u5355","text":"\u53ef\u4ee5\u4e3a\u7a97\u53e3\u6dfb\u52a0\u83dc\u5355\u680f\uff0c\u5e76\u5411\u83dc\u5355\u680f\u6dfb\u52a0\u83dc\u5355\u548c\u83dc\u5355\u9879\uff0c\u4e3a\u83dc\u5355\u9879\u8bbe\u7f6e\u4e8b\u4ef6\u56de\u8c03\u3002\u4e0b\u9762\uff0c\u5728\u4e0a\u8ff0\u793a\u4f8b\u4ee3\u7801\u57fa\u7840\u4e0a\uff0c\u6f14\u793a\u5982\u4f55\u6dfb\u52a0\u83dc\u5355\u5e76\u54cd\u5e94\u4e8b\u4ef6\u3002
from typing import Optional\n\nfrom pyguiadapter.action import Action\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.exceptions import ParameterError\nfrom pyguiadapter.menu import Menu\nfrom pyguiadapter.utils import messagebox\nfrom pyguiadapter.widgets import FloatSpinBoxConfig\nfrom pyguiadapter.windows.fnexec import FnExecuteWindowConfig, FnExecuteWindow\n\n\ndef equation_solver_5(\n a: float = 1.0, b: float = 0.0, c: float = 0.0\n) -> Optional[tuple]:\n \"\"\"A simple equation solver for equations like:\n\n **ax^2 + bx + c = 0** (a, b, c \u2208 **R** and a \u2260 0)\n\n @param a: a \u2208 R and a \u2260 0\n @param b: b \u2208 R\n @param c: c \u2208 R\n @return:\n \"\"\"\n if a == 0:\n raise ParameterError(parameter_name=\"a\", message=\"a cannot be zero!\")\n uprint(f\"Equation:\")\n uprint(f\" {a}x\u00b2 + {b}x + {c} = 0\")\n delta = b**2 - 4 * a * c\n if delta < 0:\n return None\n x1 = (-b + delta**0.5) / (2 * a)\n if delta == 0:\n return x1, x1\n x2 = (-b - delta**0.5) / (2 * a)\n return x1, x2\n\n\nif __name__ == \"__main__\":\n window_config = FnExecuteWindowConfig(\n title=\"Equation Solver\",\n icon=\"mdi6.function-variant\",\n execute_button_text=\"Solve\",\n size=(350, 450),\n document_dock_visible=False,\n show_function_result=True,\n function_result_message=\"roots: {}\",\n default_parameter_group_name=\"Equation Parameters\",\n # \u9690\u85cf`OutputDock`\u7a97\u53e3\n output_dock_visible=False,\n # \u56e0\u4e3a\u9690\u85cf\u4e86`OutputDock`\u7a97\u53e3\uff0c\u6240\u4ee5\u65e0\u9700\u5c06\u51fd\u6570\u8c03\u7528\u7ed3\u679c\u53ca\u51fd\u6570\u5f02\u5e38\u4fe1\u606f\u6253\u5370\u5230\u8f93\u51fa\u6d4f\u89c8\u5668\u4e2d\n print_function_error=False,\n print_function_result=False,\n )\n\n def on_action_about(wind: FnExecuteWindow, action: Action):\n messagebox.show_text_file(\n wind,\n text_file=\"./about.html\",\n text_format=\"html\",\n title=\"About\",\n )\n\n action_about = Action(text=\"About\", on_triggered=on_action_about)\n menu_help = Menu(title=\"Help\", actions=[action_about])\n\n adapter = GUIAdapter()\n adapter.add(\n equation_solver_5,\n window_menus=[menu_help],\n window_config=window_config,\n widget_configs={\n \"a\": FloatSpinBoxConfig(\n default_value=1.0,\n decimals=5,\n step=0.00005,\n ),\n \"b\": FloatSpinBoxConfig(decimals=5, step=0.00005),\n \"c\": FloatSpinBoxConfig(decimals=5, step=0.00005),\n },\n )\n adapter.run()\n
\u6548\u679c\u5982\u4e0b\uff1a
\u4ee3\u7801\u8bf4\u660e\uff1a
\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u6dfb\u52a0\u4e86\u4e00\u4e2a\u52a8\u4f5c\uff08Action
\uff09\uff1aaction_about
\uff0c\u5e76\u4e3a\u5176\u6307\u5b9a\u4e86triggered
\u4e8b\u4ef6\u54cd\u5e94\u51fd\u6570\uff1aon_action_about
\uff0c\u8be5\u51fd\u6570\u5c06\u5728\u52a8\u4f5c\u88ab\u89e6\u53d1\u65f6\u8c03\u7528\u3002
\u5728action_about
\u7684\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\uff0c\u6211\u4eec\u8c03\u7528pyguiadapter.utils.messagebox
\u6a21\u5757\u4e2d\u7684show_text_file()
\u51fd\u6570\uff0c\u5f39\u7a97\u5c55\u793a\u5f53\u524d\u76ee\u5f55\u4e0b\u7684about.html
\u6587\u4ef6\uff1a
\u7136\u540e\uff0c\u521b\u5efa\u4e86\u4e00\u4e2aMenu
\u5bf9\u8c61\uff1amenu_help
\uff0c\u5c06\u5176\u6807\u9898\u8bbe\u7f6e\u4e3a\"Help\"\uff0c\u5e76\u5c06action_about
\u6dfb\u52a0\u5230\u5176actions
\u4e2d\uff1a
\u6700\u540e\uff0c\u5c06menu_help
\u5bf9\u8c61\u6dfb\u52a0\u5230window_menus
\u4e2d\uff0c\u8fd9\u6837\u4fbf\u5b8c\u6210\u4e86\u521b\u5efa\u548c\u6dfb\u52a0\u83dc\u5355\u7684\u5168\u8fc7\u7a0b\uff1a
- \u6240\u8c13\u201c\u52a8\u4f5c\u201d\uff08
Action
\uff09\uff0c\u5c31\u662f\u5177\u6709\u6587\u5b57\u3001\u56fe\u6807\u7b49\u4e00\u7cfb\u5217\u5c5e\u6027\uff0c\u53ef\u4ee5\u54cd\u5e94\u7279\u5b9a\u9f20\u6807\u3001\u5feb\u6377\u952e\u4e8b\u4ef6\u7684\u7ec4\u4ef6\u3002\u5b83\u53ef\u4ee5\u88ab\u6dfb\u52a0\u5230\u83dc\u5355\u3001\u5de5\u5177\u680f\u4e2d\uff0c\u5f53\u5176\u88ab\u6dfb\u52a0\u5230\u83dc\u5355\u4e2d\uff0c\u5176\u8868\u73b0\u4e3a\u83dc\u5355\u9879\uff1b\u5f53\u5176\u88ab\u6dfb\u52a0\u5230\u5de5\u5177\u680f\u65f6\uff0c\u5176\u8868\u73b0\u4e3a\u5de5\u5177\u680f\u6309\u94ae\u3002\u6bd4\u5982\u4e0b\u56fe\u4e2d\u7ea2\u8272\u65b9\u6846\u6807\u8bb0\u7684\u662f\u540c\u4e00\u7ec4Action
\u5206\u522b\u5728\u83dc\u5355\u548c\u5de5\u5177\u680f\u4e2d\u7684\u6837\u5b50\u3002
- \u53ef\u4ee5\u901a\u8fc7\u9f20\u6807\u5355\u51fb\u6216\u5feb\u6377\u952e\u6765\u201c\u89e6\u53d1\u201d\u52a8\u4f5c\u3002
\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff0c\u83b7\u53d6\u5173\u4e8e\u7a97\u53e3\u83dc\u5355\u680f\u4e0e\u5de5\u5177\u680f\u7684\u8be6\u7ec6\u8bf4\u660e\uff1a
- \u7a97\u53e3\u5de5\u5177\u680f
- \u7a97\u53e3\u83dc\u5355\u680f
"},{"location":"schema-object/","title":"\u7ed3\u6784\u5316\u5bf9\u8c61\uff08Schema Object\uff09\u53ca\u5176\u7f16\u8f91\u5668","text":""},{"location":"schema-object/#schema-object_1","title":"\u4e00\u3001\u4ec0\u4e48\u662f\u7ed3\u6784\u5316\u5bf9\u8c61\uff08schema object\uff09","text":"\u6211\u4eec\u8fd9\u91cc\u5c06\u7ed3\u6784\u5316\u5bf9\u8c61\u79f0\u4e3a\u201cschema object\u201d\uff0c\u56e0\u4e3a\u5b83\u6307\u7684\u662f\u8fd9\u6837\u4e00\u7c7b\u5bf9\u8c61\uff1a\u672c\u8d28\u4e0a\u5b83\u662f\u4e00\u4e2adict\uff0c\u4f46\u4e0e\u4e00\u822c\u7684dict\u4e0d\u540c\u7684\u662f\uff0c\u5b83\u5177\u6709\u4e00\u7ec4\u56fa\u5b9a\u7684\u201c\u952e\u201d\uff0c\u4e14\u6bcf\u4e2a\u952e\u6240\u5bf9\u5e94\u7684 \u503c\u5177\u6709\u786e\u5b9a\u7684\u7c7b\u578b\uff0c\u7528\u4e8e\u63cf\u8ff0\u4e00\u4e2a\u5bf9\u8c61\u5e94\u5f53\u5177\u6709\u54ea\u4e9b\u952e\u4ee5\u53ca\u8fd9\u4e9b\u952e\u53ef\u4ee5\u88ab\u8d4b\u4e88\u4ec0\u4e48\u7c7b\u578b\u7684\u503c\u7684\u4e1c\u897f\u5c31\u88ab\u79f0\u4e3a\"schema\"\u3002\u7b80\u5355\u6765\u8bf4\uff0c\u6240\u8c13\u7ed3\u6784\u5316\u5bf9\u8c61\uff0c\u5c31\u662f\u4e00\u4e2a\u4f7f\u7528schema \u6765\u9650\u5236\u5176\u952e\u7684\u8303\u56f4\u548c\u503c\u7684\u7c7b\u578b\u7684\u666e\u901adict\u3002
\u4f8b\u5982\uff0c\u4ee5\u4e0b\u5bf9\u8c61\uff1a
{\n \"name\": \"Alice\",\n \"age\": 25,\n \"scores\": 90.5,\n \"grade\": \"A\",\n \"photo\": \"images/alice.jpg\"\n}\n
\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0bschema\u6765\u63cf\u8ff0\uff1a
{\n \"name\": StringValue(),\n \"age\": IntValue(),\n \"password\": StringValue(),\n \"scores\": FloatValue(),\n \"grade\": ChoiceValue(\"A\", [\"A\", \"B\", \"C\", \"D\", \"E\"]),\n \"photo\": FileValue()\n}\n
\u53ef\u4ee5\u770b\u5230\uff0c\u6211\u4eec\u4f7f\u7528StrValue
\u3001IntValue
\u3001FloatValue
\u3001ChoiceValue
\u3001FileValue
\u6765\u63cf\u8ff0\u6bcf\u4e2a\u952e\u6240\u5bf9\u5e94\u503c\u7684\u7c7b\u578b\uff08 \u8fd9\u4e9b\u7c7b\u90fd\u7ee7\u627f\u81eapyguiadapter.itemseditor.schema.ValueType
\u7c7b\uff09\uff0c\u800c\u4e0d\u662f\u4f7f\u7528int
\u3001str
\u3001float
\u7b49\u5185\u7f6e\u7684\u7c7b\u578b\uff0c \u4e3b\u8981\u662f\u662f\u56e0\u4e3aValueType
\u53ef\u4ee5\u63d0\u4f9b\u66f4\u591a\u7684\u4fe1\u606f\u3002
\u6bd4\u5982\uff0c\u5bf9\u4e8eIntValue
\u7c7b\u578b\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u5b83\u7684\u4e0a\u4e0b\u9650\uff1a
{ \n \"age\": IntValue(min_value=0, max_value=20)\n}\n
\u53c8\u6bd4\u5982\uff0c\u53ef\u4ee5\u901a\u8fc7FileValue
\u8bbe\u7f6e\u6587\u4ef6\u540d\u8fc7\u6ee4\u5668\uff1a
{\n \"photo\": FileValue(file_filters=\"JPG Files (*.jpg);;PNG Files (*.png)\")\n}\n
\u540c\u65f6\uff0c\u6709\u4e9bValueType
\u8fd8\u5b9a\u4e49\u4e86\u4e00\u4e9b\u53ef\u4ee5\u5f71\u54cd\u5176\u7f16\u8f91\u63a7\u4ef6\u7684\u5916\u89c2\u548c\u884c\u4e3a\u7684\u5c5e\u6027\uff0c\u6bd4\u5982\uff0c\u53ef\u4ee5\u901a\u8fc7StrValue
\u8bbe\u7f6e\u6587\u672c\u8f93\u5165\u6846\u7684\u5360\u4f4d\u6587\u672c\u3001\u56de\u663e\u6a21\u5f0f\u3001\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae\u7b49\uff1a
{\n \"password\": StringValue(\n default_value=\"123456\",\n display_name=\"Password\",\n placeholder=\"Enter Password\",\n echo_mode=PasswordEchoOnEditMode,\n clear_button=True,\n ),\n}\n
\u5bf9\u4e8e\u5e38\u7528\u7684\u503c\u7c7b\u578b\uff0cpyguiadapter
\u5df2\u7ecf\u5b9e\u73b0\u4e86\u76f8\u5e94\u7684ValueType
\uff0c\u5305\u62ec\uff1a
- IntValue
- FloatValue
- StringValue
- BoolValue
- ChoiceValue
- ColorValue
- DateTimeValue
- DateValue
- DateTimeValue
- TimeValue
- FileValue
- DirectoryValue
- GenericPathValue
- VariantValue
- ListValue
- TupleValue
- DictValue
\u8fd9\u4e9b\u7c7b\u578b\u5747\u5728pyguiadapter.itemseditor.valuetypes
\u5305\u4e2d\u5b9a\u4e49\u548c\u5b9e\u73b0\uff0c\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u65b9\u5f0f\u5bfc\u5165\uff1a
from pyguiadapter.itemseditor.valuetypes import <Value-Type-Name>\n
\u4f8b\u5982\uff1a
from pyguiadapter.itemseditor.valuetypes import (\n StringValue,\n PasswordEchoOnEditMode,\n BoolValue,\n ChoiceValue,\n)\n
\u5982\u679c\u5185\u7f6e\u7684ValueType
\u65e0\u6cd5\u6ee1\u8db3\u9700\u6c42\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u7ee7\u627fValueType
\u7c7b\u6765\u5b9e\u73b0\u81ea\u5b9a\u4e49\u7684\u7c7b\u578b\u3002
\u6240\u6709\u7684ValueType
\u5747\u5177\u6709\u4ee5\u4e0b\u5c5e\u6027\uff1a
default_value
\uff1a\u8be5\u7c7b\u578b\u7684\u9ed8\u8ba4\u503c\u3002 display_name
\uff1a\u7528\u4e8e\u6307\u5b9a\u663e\u793a\u5728\u754c\u9762\u4e0a\u7684\u540d\u79f0\uff0c\u5982\u679c\u4e0d\u6307\u5b9a\uff08None\uff09\uff0c\u5219\u4f7f\u7528\u952e\u540d\u4f5c\u4e3a\u663e\u793a\u540d\u79f0\u3002
\u9664\u4e86\u4ee5\u4e0a\u516c\u5171\u5c5e\u6027\uff0c\u4e0d\u540c\u7c7b\u578b\u7684ValueType
\u8fd8\u5b9a\u4e49\u4e00\u4e9b\u4e13\u5c5e\u7684\u5c5e\u6027\uff0c\u8fd9\u4e9b\u5c5e\u6027\u6216\u8bb8\u7528\u4e8e\u503c\u7684\u6821\u9a8c\uff0c\u6216\u8005\u7528\u4e8e\u914d\u7f6e\u754c\u9762\u7684\u5916\u89c2\u548c\u884c\u4e3a\u3002\u53ef\u4ee5\u53c2\u8003\u76f8\u5e94\u7684ValueType
\u7c7b\u7684 \u6784\u9020\u51fd\u6570\u6765\u4e86\u89e3\u8be5\u7c7b\u578b\u652f\u6301\u7684\u5c5e\u6027\u3002
"},{"location":"schema-object/#_1","title":"\u4e8c\u3001\u7ed3\u6784\u5316\u5bf9\u8c61\u7684\u7f16\u8f91\u5668","text":"\u76ee\u524d\uff0c\u6211\u4eec\u5b9e\u73b0\u4e86\u4e24\u79cd\u53ef\u89c6\u5316\u5de5\u5177\uff0c\u7528\u4e8e\u6d4f\u89c8\u548c\u7f16\u8f91\u7ed3\u6784\u5316\u5bf9\u8c61\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u83dc\u5355\u6216\u8005\u5de5\u5177\u680f\u6309\u94ae\u7684\u56de\u8c03\u51fd\u6570\u4e2d\u8c03\u51fa\u8fd9\u4e9b\u5de5\u5177\u3002
"},{"location":"schema-object/#show_schema_object_editor","title":"\uff08\u4e00\uff09show_schema_object_editor()
","text":"\u51fd\u6570show_schema_object_editor()
\u7528\u4e8e\u8c03\u51fa\u4e00\u4e2aTableView
\u98ce\u683c\u7684\u7ed3\u6784\u5316\u5bf9\u8c61\u7f16\u8f91\u5668:
\u5b83\u7684\u51fd\u6570\u7b7e\u540d\u5982\u4e0b\uff1a
\u4e0b\u9762\u662f\u4e00\u4e2a\u76f8\u5bf9\u5b8c\u6574\u7684\u793a\u4f8b\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u4f7f\u7528show_schema_object_editor()
\u6765\u7f16\u8f91\u4e00\u4e2a\u7ed3\u6784\u5316\u5bf9\u8c61\uff1a
from typing import Any, Dict\n\nfrom qtpy.QtWidgets import QWidget\n\nfrom pyguiadapter.action import Action\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.itemseditor.valuetypes import (\n StringValue,\n IntValue,\n ChoiceValue,\n PasswordEchoOnEditMode,\n FloatValue,\n BoolValue,\n FileValue,\n)\nfrom pyguiadapter.toolbar import ToolBar\nfrom pyguiadapter.utils import (\n messagebox,\n show_schema_object_editor,\n SchemaObjectEditorConfig,\n)\nfrom pyguiadapter.windows.fnexec import FnExecuteWindow\n\nstudent_profile_schema = {\n \"name\": StringValue(default_value=\"Undefined\", display_name=\"Name\"),\n \"age\": IntValue(default_value=16, display_name=\"Age\", min_value=16, max_value=20),\n \"grade\": ChoiceValue(\n default_value=\"A\",\n choices=[\"A\", \"B\", \"C\", \"D\", \"E\"],\n ),\n \"password\": StringValue(\n default_value=\"Admin123\",\n display_name=\"ID Password\",\n echo_mode=PasswordEchoOnEditMode,\n clear_button=True,\n password_symbol=\"*\",\n max_password_symbols=10,\n ),\n \"scores\": FloatValue(\n default_value=0.0,\n display_name=\"Average Scores\",\n min_value=0.0,\n max_value=100.0,\n step=0.5,\n suffix=\" (avg)\",\n display_affix=True,\n ),\n \"is_active\": BoolValue(\n default_value=True, display_name=\"Active\", true_text=\"Yes\", false_text=\"No\"\n ),\n \"photo\": FileValue(\n default_value=\"Not Provided\",\n display_name=\"Photo\",\n title=\"Select a photo\",\n file_filters=\"JPG Files (*.jpg);;PNG Files (*.png);;All Files (*.*)\",\n ),\n}\n\nstudent_profile = {\n \"name\": \"John Doe\",\n \"age\": 18,\n \"grade\": \"B\",\n \"password\": \"MyPassword123\",\n \"scores\": 99.5,\n \"is_active\": True,\n \"photo\": \"/path/to/john_doe.jpg\",\n}\n\n\ndef _accept_hook(editor: QWidget, obj: Dict[str, Any]) -> bool:\n password = obj.get(\"password\")\n if len(password) < 6:\n messagebox.show_warning_message(\n editor,\n message=\"Password should be at least 6 characters long.\",\n title=\"Warning\",\n )\n return False\n return True\n\n\ndef on_action_schema_object_editor(window: FnExecuteWindow, action: Action):\n _ = action # unused\n new_settings, ok = show_schema_object_editor(\n window,\n schema=student_profile_schema,\n obj=student_profile,\n config=SchemaObjectEditorConfig(\n title=\"Student Profile\",\n center_container_title=\"Personal Information\",\n icon=\"ei.adult\",\n # show_horizontal_header=False,\n ),\n accept_hook=_accept_hook,\n )\n if not ok:\n return\n student_profile.update(new_settings)\n\n\naction_profile = Action(\n text=\"Profile\",\n icon=\"ei.adult\",\n on_triggered=on_action_schema_object_editor,\n shortcut=\"Ctrl+O\",\n)\n\ntoolbar = ToolBar(actions=[action_profile], moveable=False, floatable=False)\n\n\ndef foo():\n uprint(\"current profile:\")\n uprint(student_profile)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(foo, window_toolbar=toolbar)\n adapter.run()\n
"},{"location":"schema-object/#pyguiadapter.utils.show_schema_object_editor","title":"show_schema_object_editor(parent: Optional[QWidget], schema: Dict[str, ValueType], obj: Dict[str, Any], config: SchemaObjectEditorConfig = SchemaObjectEditorConfig(), *, copy: bool = True, normalize_object: bool = True, validate: bool = True, accept_hook: Optional[Callable[[ObjectEditor, Dict[str, Any]], bool]] = None, reject_hook: Optional[Callable[[ObjectEditor], bool]] = None) -> Tuple[Dict[str, Any], bool]
","text":"\u5f39\u51fa\u4e00\u4e2a\u7ed3\u6784\u5316\u5bf9\u8c61\u7f16\u8f91\u5668
Parameters:
Name Type Description Default parent
Optional[QWidget]
\u7236\u7a97\u53e3
required schema
Dict[str, ValueType]
\u5bf9\u8c61\u7684Schema
required obj
Dict[str, Any]
\u8981\u7f16\u8f91\u7684\u5bf9\u8c61
required config
SchemaObjectEditorConfig
\u7f16\u8f91\u5668\u914d\u7f6e
SchemaObjectEditorConfig()
copy
bool
\u662f\u5426\u590d\u5236\u5bf9\u8c61
True
normalize_object
bool
\u662f\u5426\u89c4\u8303\u5316\u5bf9\u8c61\uff0c\u89c4\u8303\u5316\u5bf9\u8c61\u662f\u6307\uff1a\u5220\u9664obj\u4e2d\u4e0d\u5728schema\u672a\u5b9a\u4e49\u7684\u952e\uff0c\u5e76\u4e14\u4f7f\u7528\u9ed8\u8ba4\u503c\u586b\u5145\u7f3a\u5931\u7684\u952e
True
validate
bool
\u662f\u5426\u9a8c\u8bc1\u5bf9\u8c61\uff0c\u5373\u68c0\u67e5obj\u662f\u5426\u7b26\u5408schema\u5b9a\u4e49\u7684\u683c\u5f0f\uff0c\u5982\u679c\u4e0d\u7b26\u5408\u5219\u5f15\u53d1\u5f02\u5e38
True
accept_hook
Optional[Callable[[ObjectEditor, Dict[str, Any]], bool]]
\u70b9\u51fb\u7f16\u8f91\u5668Ok
\u6309\u94ae\u540e\u6267\u884c\u7684\u94a9\u5b50\u51fd\u6570\uff0c\u51fd\u6570\u7b7e\u540d\u4e3a(editor: ObjectEditor, obj: Dict[str, Any]) -> bool\uff0c\u8fd4\u56deTrue\u5219\u5173\u95ed\u7f16\u8f91\u5668\uff0c\u8fd4\u56deFalse\u5219\u4e0d\u5173\u95ed\u7f16\u8f91\u5668\u3002
None
reject_hook
Optional[Callable[[ObjectEditor], bool]]
\u70b9\u51fb\u7f16\u8f91\u5668Cancel
\u6309\u94ae\u6216\u5173\u95ed\u7f16\u8f91\u5668\u540e\u6267\u884c\u7684\u94a9\u5b50\u51fd\u6570\uff0c\u51fd\u6570\u7b7e\u540d\u4e3a(editor: ObjectEditor) -> bool\uff0c\u8fd4\u56deTrue\u5219\u5173\u95ed\u7f16\u8f91\u5668\uff0c\u8fd4\u56deFalse\u5219\u4e0d\u5173\u95ed\u7f16\u8f91\u5668\u3002
None
Returns:
Type Description Tuple[Dict[str, Any], bool]
\u8fd4\u56de\u4e00\u4e2a\u5143\u7ec4\uff0c\u8be5\u5143\u7ec4\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u662f\u7f16\u8f91\u540e\u7684\u5bf9\u8c61\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20\u7f16\u8f91\u5668\u662f\u5426accepted\uff08\u4e00\u822c\u662f\u70b9\u51fbOk
\u6309\u94ae\uff09\u3002
"},{"location":"schema-object/#show_schema_object_panel","title":"\uff08\u4e8c\uff09show_schema_object_panel()
","text":"\u51fd\u6570show_schema_object_panel()
\u7528\u4e8e\u8c03\u51fa\u4e00\u4e2aPanel
\u98ce\u683c\u7684\u7ed3\u6784\u5316\u5bf9\u8c61\u7f16\u8f91\u5668:
\u5176\u51fd\u6570\u7b7e\u540d\u5982\u4e0b\uff1a
\u4e0b\u9762\u662f\u4e00\u4e2a\u76f8\u5bf9\u5b8c\u6574\u7684\u793a\u4f8b\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u4f7f\u7528show_schema_object_panel()
\u6765\u7f16\u8f91\u4e00\u4e2a\u7ed3\u6784\u5316\u5bf9\u8c61\uff1a
from typing import Any, Dict\n\nfrom qtpy.QtWidgets import QWidget\n\nfrom pyguiadapter.action import Action\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.itemseditor.valuetypes import (\n StringValue,\n IntValue,\n ChoiceValue,\n PasswordEchoOnEditMode,\n FloatValue,\n BoolValue,\n FileValue,\n)\nfrom pyguiadapter.toolbar import ToolBar\nfrom pyguiadapter.utils import (\n messagebox,\n show_schema_object_panel,\n SchemaObjectPanelConfig,\n)\nfrom pyguiadapter.windows.fnexec import FnExecuteWindow\n\nstudent_profile_schema = {\n \"name\": StringValue(default_value=\"Undefined\", display_name=\"Name\"),\n \"age\": IntValue(default_value=16, display_name=\"Age\", min_value=16, max_value=20),\n \"grade\": ChoiceValue(\n default_value=\"A\",\n choices=[\"A\", \"B\", \"C\", \"D\", \"E\"],\n ),\n \"password\": StringValue(\n default_value=\"Admin123\",\n display_name=\"ID Password\",\n echo_mode=PasswordEchoOnEditMode,\n clear_button=True,\n password_symbol=\"*\",\n max_password_symbols=10,\n ),\n \"scores\": FloatValue(\n default_value=0.0,\n display_name=\"Average Scores\",\n min_value=0.0,\n max_value=100.0,\n step=0.5,\n suffix=\" (avg)\",\n display_affix=True,\n ),\n \"is_active\": BoolValue(\n default_value=True, display_name=\"Active\", true_text=\"Yes\", false_text=\"No\"\n ),\n \"photo\": FileValue(\n default_value=\"Not Provided\",\n display_name=\"Photo\",\n title=\"Select a photo\",\n file_filters=\"JPG Files (*.jpg);;PNG Files (*.png);;All Files (*.*)\",\n ),\n}\n\nstudent_profile = {\n \"name\": \"John Doe\",\n \"age\": 18,\n \"grade\": \"B\",\n \"password\": \"MyPassword123\",\n \"scores\": 99.5,\n \"is_active\": True,\n \"photo\": \"/path/to/john_doe.jpg\",\n}\n\n\ndef _accept_hook(editor: QWidget, obj: Dict[str, Any]) -> bool:\n password = obj.get(\"password\")\n if len(password) < 6:\n messagebox.show_warning_message(\n editor,\n message=\"Password should be at least 6 characters long.\",\n title=\"Warning\",\n )\n return False\n return True\n\n\ndef on_action_schema_object_panel(window: FnExecuteWindow, action: Action):\n _ = action # unused\n new_settings, ok = show_schema_object_panel(\n window,\n schema=student_profile_schema,\n obj=student_profile,\n config=SchemaObjectPanelConfig(\n title=\"Student Profile\",\n center_container_title=\"Personal Information\",\n icon=\"ei.adult\",\n ),\n accept_hook=_accept_hook,\n )\n if not ok:\n return\n student_profile.update(new_settings)\n\n\naction_profile = Action(\n text=\"Profile\",\n icon=\"ei.adult\",\n on_triggered=on_action_schema_object_panel,\n shortcut=\"Ctrl+O\",\n)\n\ntoolbar = ToolBar(actions=[action_profile], moveable=False, floatable=False)\n\n\ndef foo():\n uprint(\"current profile:\")\n uprint(student_profile)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(foo, window_toolbar=toolbar)\n adapter.run()\n
"},{"location":"schema-object/#pyguiadapter.utils.show_schema_object_panel","title":"show_schema_object_panel(parent: Optional[QWidget], schema: Dict[str, ValueType], obj: Dict[str, Any], config: SchemaObjectPanelConfig = SchemaObjectPanelConfig(), *, copy: bool = True, normalize_object: bool = True, validate: bool = True, accept_hook: Optional[Callable[[ObjectEditor, Dict[str, Any]], bool]] = None, reject_hook: Optional[Callable[[ObjectEditor], bool]] = None) -> Tuple[Dict[str, Any], bool]
","text":"\u5f39\u51fa\u4e00\u4e2a\u7ed3\u6784\u5316\u5bf9\u8c61\u7f16\u8f91\u9762\u677f
Parameters:
Name Type Description Default parent
Optional[QWidget]
\u7236\u7a97\u53e3
required schema
Dict[str, ValueType]
\u5bf9\u8c61\u7684Schema
required obj
Dict[str, Any]
\u8981\u7f16\u8f91\u7684\u5bf9\u8c61
required config
SchemaObjectPanelConfig
\u7f16\u8f91\u5668\u914d\u7f6e
SchemaObjectPanelConfig()
copy
bool
\u662f\u5426\u590d\u5236\u5bf9\u8c61
True
normalize_object
bool
\u662f\u5426\u89c4\u8303\u5316\u5bf9\u8c61\uff0c\u89c4\u8303\u5316\u5bf9\u8c61\u662f\u6307\uff1a\u5220\u9664obj\u4e2d\u4e0d\u5728schema\u672a\u5b9a\u4e49\u7684\u952e\uff0c\u5e76\u4e14\u4f7f\u7528\u9ed8\u8ba4\u503c\u586b\u5145\u7f3a\u5931\u7684\u952e
True
validate
bool
\u662f\u5426\u9a8c\u8bc1\u5bf9\u8c61\uff0c\u5373\u68c0\u67e5obj\u662f\u5426\u7b26\u5408schema\u5b9a\u4e49\u7684\u683c\u5f0f\uff0c\u5982\u679c\u4e0d\u7b26\u5408\u5219\u5f15\u53d1\u5f02\u5e38
True
accept_hook
Optional[Callable[[ObjectEditor, Dict[str, Any]], bool]]
\u70b9\u51fb\u7f16\u8f91\u5668Ok
\u6309\u94ae\u540e\u6267\u884c\u7684\u94a9\u5b50\u51fd\u6570\uff0c\u51fd\u6570\u7b7e\u540d\u4e3a(editor: ObjectEditor, obj: Dict[str, Any]) -> bool\uff0c\u8fd4\u56deTrue\u5219\u5173\u95ed\u7f16\u8f91\u5668\uff0c\u8fd4\u56deFalse\u5219\u4e0d\u5173\u95ed\u7f16\u8f91\u5668\u3002
None
reject_hook
Optional[Callable[[ObjectEditor], bool]]
\u70b9\u51fb\u7f16\u8f91\u5668Cancel
\u6309\u94ae\u6216\u5173\u95ed\u7f16\u8f91\u5668\u540e\u6267\u884c\u7684\u94a9\u5b50\u51fd\u6570\uff0c\u51fd\u6570\u7b7e\u540d\u4e3a(editor: ObjectEditor) -> bool\uff0c\u8fd4\u56deTrue\u5219\u5173\u95ed\u7f16\u8f91\u5668\uff0c\u8fd4\u56deFalse\u5219\u4e0d\u5173\u95ed\u7f16\u8f91\u5668\u3002
None
Returns:
Type Description Tuple[Dict[str, Any], bool]
\u8fd4\u56de\u4e00\u4e2a\u5143\u7ec4\uff0c\u8be5\u5143\u7ec4\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u662f\u7f16\u8f91\u540e\u7684\u5bf9\u8c61\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20\u7f16\u8f91\u5668\u662f\u5426accepted\uff08\u4e00\u822c\u662f\u70b9\u51fbOk
\u6309\u94ae\uff09\u3002
"},{"location":"schema-object/#_2","title":"\u4e09\u3001\u793a\u4f8b\uff1a\u4f7f\u7528\u7ed3\u6784\u5316\u5bf9\u8c61\u7f16\u8f91\u5668\u5b9e\u73b0\u914d\u7f6e\u754c\u9762","text":"\u6709\u4e9b\u5f00\u53d1\u8005\u53ef\u80fd\u5df2\u7ecf\u60f3\u5230\uff0c\u4f7f\u7528\u7ed3\u6784\u5316\u5bf9\u8c61\u548c\u7ed3\u6784\u5316\u5bf9\u8c61\u7f16\u8f91\u5668\uff0c\u53ef\u4ee5\u5f88\u5bb9\u6613\u5b9e\u73b0\u4e00\u4e2a\u8bbe\u7f6e\u754c\u9762
\uff0c\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a
from typing import Any, Dict\n\nfrom qtpy.QtWidgets import QWidget\n\nfrom pyguiadapter.action import Action, Separator\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.itemseditor.valuetypes import (\n StringValue,\n PasswordEchoOnEditMode,\n BoolValue,\n ChoiceValue,\n)\nfrom pyguiadapter.menu import Menu\nfrom pyguiadapter.utils import (\n messagebox,\n show_schema_object_editor,\n show_schema_object_panel,\n SchemaObjectEditorConfig,\n SchemaObjectPanelConfig,\n)\nfrom pyguiadapter.windows.fnselect import FnSelectWindow\n\nsetting_schema = {\n \"username\": StringValue(\n default_value=\"admin\", display_name=\"Username\", placeholder=\"Enter Username\"\n ),\n \"password\": StringValue(\n default_value=\"123456\",\n display_name=\"Password\",\n placeholder=\"Enter Password\",\n echo_mode=PasswordEchoOnEditMode,\n clear_button=True,\n ),\n \"remember_me\": BoolValue(\n default_value=True, display_name=\"Remember Me\", true_text=\"Yes\", false_text=\"No\"\n ),\n \"language\": ChoiceValue(\n default_value=0,\n choices=[\"English\", \"Chinese\", \"Japanese\", \"Korean\", \"French\"],\n display_name=\"Language\",\n ),\n \"theme\": ChoiceValue(\n default_value=\"light\",\n choices=[\"light\", \"dark\", \"system\"],\n display_name=\"Theme\",\n ),\n \"port\": StringValue(\n default_value=\"8080\",\n display_name=\"Port\",\n validator=\"^[0-9]+$\",\n max_length=5,\n placeholder=\"Enter Port\",\n ),\n \"host\": StringValue(\n default_value=\"localhost\",\n display_name=\"Host\",\n placeholder=\"Enter Host\",\n max_length=100,\n ),\n}\n\nsettings = {\n \"username\": \"admin\",\n \"password\": \"123456\",\n \"remember_me\": True,\n \"language\": 0,\n \"theme\": \"light\",\n \"port\": \"8080\",\n \"host\": \"localhost\",\n}\n\n\ndef _accept_hook(editor: QWidget, obj: Dict[str, Any]) -> bool:\n password = obj.get(\"password\")\n if len(password) < 6:\n messagebox.show_warning_message(\n editor,\n message=\"Password should be at least 6 characters long.\",\n title=\"Warning\",\n )\n return False\n return True\n\n\ndef on_action_settings(window: FnSelectWindow, action: Action):\n _ = action # unused\n new_settings, ok = show_schema_object_editor(\n window,\n schema=setting_schema,\n obj=settings,\n config=SchemaObjectEditorConfig(\n title=\"Settings\",\n center_container_title=\"configurations\",\n icon=\"ri.settings-5-fill\",\n ),\n accept_hook=_accept_hook,\n )\n if not ok:\n return\n settings.update(new_settings)\n\n\ndef on_action_settings_panel(window: FnSelectWindow, action: Action):\n _ = action # unused\n new_settings, ok = show_schema_object_panel(\n window,\n schema=setting_schema,\n obj=settings,\n config=SchemaObjectPanelConfig(\n title=\"Settings\",\n center_container_title=\"configurations\",\n icon=\"ri.settings-5-fill\",\n ),\n accept_hook=_accept_hook,\n )\n if not ok:\n return\n settings.update(new_settings)\n\n\ndef on_action_close(window: FnSelectWindow, _: Action):\n ret = messagebox.show_question_message(\n window,\n message=\"Are you sure to close the application?\",\n buttons=messagebox.Yes | messagebox.No,\n )\n if ret == messagebox.Yes:\n window.close()\n\n\naction_settings = Action(\n text=\"Settings\",\n icon=\"msc.settings-gear\",\n on_triggered=on_action_settings,\n shortcut=\"Ctrl+O\",\n)\naction_settings_panel = Action(\n text=\"Settings Panel\",\n icon=\"msc.settings-gear\",\n on_triggered=on_action_settings_panel,\n shortcut=\"Ctrl+P\",\n)\naction_close = Action(\n text=\"Close\", icon=\"fa.close\", on_triggered=on_action_close, shortcut=\"Ctrl+Q\"\n)\n\n\nmenu_file = Menu(\n title=\"File\",\n actions=[action_settings, action_settings_panel, Separator(), action_close],\n)\n\n\ndef foo():\n uprint(\"current settings:\")\n uprint(settings)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(foo)\n adapter.run(show_select_window=True, select_window_menus=[menu_file])\n
\u6548\u679c\u5982\u4e0b\uff1a
"},{"location":"style/","title":"\u754c\u9762\u7f8e\u5316","text":""},{"location":"style/#_1","title":"\uff08\u4e00\uff09\u6982\u8ff0","text":"PyGUIAdapter
\u5e95\u5c42\u4f7f\u7528Qt
\u6784\u5efaGUI\uff0c \u6240\u4ee5\u4e00\u4e9b\u9002\u7528\u4e8eQt
\u7684\u754c\u9762\u7f8e\u5316\u65b9\u6cd5\u540c\u6837\u4e5f\u9002\u7528\u4e8ePyGUIAdapter
\uff0c\u6bd4\u5982\u6837\u5f0f\u8868\u4ee5\u53ca\u7b2c\u4e09\u65b9\u7f8e\u5316\u5e93\u3002\u4e0b\u9762\u5c06\u5206\u522b\u4ecb\u7ecd\u8fd9\u4e24\u79cd\u754c\u9762\u7f8e\u5316\u7684\u65b9\u6cd5\u3002
"},{"location":"style/#_2","title":"\uff08\u4e8c\uff09\u4f7f\u7528\u6837\u5f0f\u8868","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528QT\u6837\u5f0f\u8868\uff08QSS
\uff09\u6765\u81ea\u5b9a\u4e49\u754c\u9762\u98ce\u683c\u3002\u6709\u51e0\u79cd\u65b9\u6cd5\u53ef\u4ee5\u8bbe\u7f6e\u6837\u5f0f\u8868\uff1a
"},{"location":"style/#1","title":"1\u3001\u8bbe\u7f6e\u5168\u5c40\u6837\u5f0f\u8868","text":"GUIAdapter
\u7c7b\u7684\u6784\u9020\u51fd\u6570\u4e2d\u6709\u4e00\u4e2aglobal_style
\u53c2\u6570\uff0c\u7528\u4e8e\u8bbe\u7f6e\u5168\u5c40\u6837\u5f0f\u8868\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u628a\u5168\u5c40\u6837\u5f0f\u8868\u7684\u5185\u5bb9\u6216\u8005\u4e00\u4e2a\u4ee5\u5168\u5c40\u6837\u5f0f\u8868\u5185\u5bb9\u4e3a\u8fd4\u56de\u503c\u7684\u51fd\u6570\u4f20\u9012\u7ed9\u8be5\u53c2\u6570\u3002
"},{"location":"style/#1_1","title":"\uff081\uff09\u4f20\u5165\u6837\u5f0f\u8868\u5185\u5bb9","text":"examples/global_style_example.py
import os.path\nfrom datetime import datetime\n\nfrom pyguiadapter import utils\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.extend_types import text_t\n\n\ndef app_style_example(\n arg1: str, arg2: int, arg3: float, arg4: bool, arg5: text_t, arg6: datetime\n):\n \"\"\"\n This example shows how to apply a global stylesheet to the application.\n\n First, read the stylesheet from a qss file. In this example, [Ubuntu.qss](https://github.com/GTRONICK/QSS/blob/master/Ubuntu.qss)\n will be used. This qss file is from GTRONICK's [QSS](https://github.com/GTRONICK/QSS) repo.\n\n Then, pass the qss content to the GUIAdapter constructor's **global_style** argument.\n\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n\n QSS_FILE = os.path.join(os.path.dirname(__file__), \"Ubuntu.qss\")\n global_stylesheet = utils.read_text_file(QSS_FILE)\n\n adapter = GUIAdapter(global_stylesheet=global_stylesheet)\n adapter.add(app_style_example)\n adapter.run()\n
"},{"location":"style/#2","title":"\uff082\uff09\u4f20\u5165\u6837\u5f0f\u8868\u52a0\u8f7d\u51fd\u6570","text":"examples/global_style_example_2.py
import os.path\nfrom datetime import datetime\n\nfrom pyguiadapter import utils\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.extend_types import text_t\n\n\ndef app_style_example(\n arg1: str, arg2: int, arg3: float, arg4: bool, arg5: text_t, arg6: datetime\n):\n \"\"\"\n This example shows how to apply a global stylesheet to the application.\n\n First, read the stylesheet from a qss file. In this example, [Ubuntu.qss](https://github.com/GTRONICK/QSS/blob/master/Ubuntu.qss)\n will be used. This qss file is from GTRONICK's [QSS](https://github.com/GTRONICK/QSS) repo.\n\n Then, pass the qss content to the GUIAdapter constructor's **global_style** argument.\n\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n\n QSS_FILE = os.path.join(os.path.dirname(__file__), \"Ubuntu.qss\")\n\n def load_stylesheet() -> str:\n \"\"\"\n This function will be called after the QApplication instance being created\n \"\"\"\n return utils.read_text_file(QSS_FILE)\n\n adapter = GUIAdapter(global_stylesheet=load_stylesheet)\n adapter.add(app_style_example)\n adapter.run()\n
"},{"location":"style/#2_1","title":"2\u3001\u624b\u52a8\u52a0\u8f7d\u5e76\u8bbe\u7f6e\u6837\u5f0f\u8868","text":"GUIAdapter
\u542f\u52a8\u65f6\u5185\u90e8\u5c06\u521b\u5efaQApplication
\u5b9e\u4f8b\u3002\u5c06\u56de\u8c03on_app_start()
\u65b9\u6cd5\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u8be5\u56de\u8c03\u51fd\u6570\u4e2d\u8bbf\u95ee\u5230\u5f53\u524dQApplication
\u5bf9\u8c61\uff0c\u4e4b\u540e\u4fbf\u53ef\u8c03\u7528\u5176setStyleSheet()
\u65b9\u6cd5\u8bbe\u7f6e\u6837\u5f0f\u8868\u3002
import os.path\nfrom datetime import datetime\n\nfrom qtpy.QtWidgets import QApplication\nfrom pyguiadapter import utils\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.extend_types import text_t\n\n\ndef app_style_example(\n arg1: str, arg2: int, arg3: float, arg4: bool, arg5: text_t, arg6: datetime\n):\n \"\"\"\n This example shows how to apply a global stylesheet to the application.\n\n In this example, [Ubuntu.qss](https://github.com/GTRONICK/QSS/blob/master/Ubuntu.qss)\n will be used. This qss file is from GTRONICK's [QSS](https://github.com/GTRONICK/QSS) repo.\n\n The QSS will be set in **on_app_start()** callback.\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n\n QSS_FILE = os.path.join(os.path.dirname(__file__), \"Ubuntu.qss\")\n\n def on_app_start(app: QApplication):\n assert isinstance(app, QApplication)\n print(\"on_app_start\")\n qss = utils.read_text_file(QSS_FILE)\n app.setStyleSheet(qss)\n print(\"app style applied\")\n\n adapter = GUIAdapter(on_app_start=on_app_start)\n adapter.add(app_style_example)\n adapter.run()\n
"},{"location":"style/#_3","title":"\uff08\u4e09\uff09\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93","text":"PyGUIAdapter
\u5185\u90e8\u4f7f\u7528qtpy
\u521b\u5efa\u7528\u6237\u754c\u9762\uff0c\u56e0\u6b64\u53ef\u4ee5\u65e0\u7f1d\u63a5\u5165\u4e00\u4e9b\u652f\u6301qtpy
\u7684\u7b2c\u4e09\u65b9\u7f8e\u5316\u5e93\u3002\u4e0b\u9762\u662f\u4e00\u4e9b\u521d\u6b65\u6d4b\u8bd5\u53ef\u7528\u7b2c\u4e09\u65b9\u5e93\u3002
"},{"location":"style/#1pyqtdarktheme","title":"1\u3001PyQtDarkTheme
","text":"\u8fd0\u884c\u793a\u4f8b\u4ee3\u7801\uff0c\u9700\u8981\u5148\u5b89\u88c5PyQtDarkTheme
\uff1a
pip install pyqtdarktheme\n
\"\"\"\nThis example requires PyQtDarkTheme. Please install it before you run this example.\n\"\"\"\n\nfrom datetime import datetime\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.extend_types import text_t\n\n\ndef app_style_example(\n arg1: str, arg2: int, arg3: float, arg4: bool, arg5: text_t, arg6: datetime\n):\n \"\"\"\n This example requires [PyQtDarkTheme](https://github.com/5yutan5/PyQtDarkTheme).\n Please install it before you run the example.\n\n <br />\n\n e.g. using `pip`:\n\n > `pip install pyqtdarktheme`\n\n @param arg1: arg1 description\n @param arg2: arg2 description\n @param arg3: arg3 description\n @param arg4: arg4 description\n @param arg5: arg5 description\n @param arg6: arg6 description\n @return:\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n import qdarktheme\n\n def on_app_start(app):\n # this will be called after the instantiation of QApplication.\n print(\"app started\")\n qdarktheme.setup_theme(\"dark\")\n\n adapter = GUIAdapter(on_app_start=on_app_start)\n adapter.add(app_style_example)\n adapter.run()\n
"},{"location":"style/#2qdarkstylesheet","title":"2\u3001QDarkStyleSheet","text":"\u8fd0\u884c\u793a\u4f8b\u4ee3\u7801\uff0c\u9700\u8981\u5148\u5b89\u88c5QDarkStyleSheet
\uff0c\u6bd4\u5982\uff1a
pip install qdarkstyle\n
from datetime import datetime\n\nfrom qtpy.QtWidgets import QApplication\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.extend_types import text_t\n\n\ndef app_style_example(\n arg1: str, arg2: int, arg3: float, arg4: bool, arg5: text_t, arg6: datetime\n):\n \"\"\"\n This example requires [QDarkStyleSheet](https://github.com/ColinDuquesnoy/QDarkStyleSheet).\n Please install it before you run the example.\n\n <br />\n\n e.g. using `pip`:\n\n > `pip install qdarkstyle`\n\n @param arg1: arg1 description\n @param arg2: arg2 description\n @param arg3: arg3 description\n @param arg4: arg4 description\n @param arg5: arg5 description\n @param arg6: arg6 description\n @return:\n\n @params\n [arg6]\n calendar_popup = true\n\n @end\n\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n import qdarkstyle\n\n def on_app_start(app: QApplication):\n # this will be called after the instantiation of QApplication.\n print(\"app started\")\n app.setStyleSheet(qdarkstyle.load_stylesheet())\n\n adapter = GUIAdapter(on_app_start=on_app_start)\n adapter.add(app_style_example)\n adapter.run()\n
"},{"location":"style/#3qtmodern","title":"3\u3001qtmodern","text":"\u8fd0\u884c\u793a\u4f8b\u4ee3\u7801\uff0c\u9700\u8981\u5148\u5b89\u88c5qtmodern
\uff0c\u6bd4\u5982\uff1a
pip install qtmodern\n
from datetime import datetime\n\nfrom qtpy.QtWidgets import QApplication\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.extend_types import text_t\n\n\ndef app_style_example(\n arg1: str, arg2: int, arg3: float, arg4: bool, arg5: text_t, arg6: datetime\n):\n \"\"\"\n This example requires [qtmodern](https://github.com/gmarull/qtmodern).\n Please install it before you run the example.\n\n <br />\n\n e.g. using `pip`:\n\n > `pip install qtmodern`\n\n @param arg1: arg1 description\n @param arg2: arg2 description\n @param arg3: arg3 description\n @param arg4: arg4 description\n @param arg5: arg5 description\n @param arg6: arg6 description\n @return:\n\n @params\n [arg6]\n calendar_popup = true\n\n @end\n\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n import qtmodern.styles\n\n def on_app_start(app: QApplication):\n # this will be called after the instantiation of QApplication.\n print(\"app started\")\n qtmodern.styles.light(app)\n\n adapter = GUIAdapter(on_app_start=on_app_start)\n adapter.add(app_style_example)\n adapter.run()\n
"},{"location":"style/#4qt-material","title":"4\u3001Qt-Material","text":"\u8fd0\u884c\u793a\u4f8b\u4ee3\u7801\uff0c\u9700\u8981\u5148\u5b89\u88c5Qt-Material
\uff0c\u6bd4\u5982\uff1a
pip install qt-material\n
from datetime import datetime\n\nfrom qtpy.QtWidgets import QApplication\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.extend_types import text_t, json_obj_t\n\n\ndef app_style_example(\n arg1: str,\n arg2: int,\n arg3: float,\n arg4: bool,\n arg5: text_t,\n arg6: datetime,\n arg7: json_obj_t,\n):\n \"\"\"\n This example requires [Qt-Material](https://github.com/UN-GCPDS/qt-material).\n Please install it before you run the example.\n\n <br />\n\n e.g. using `pip`:\n\n > `pip install qt-material`\n\n @param arg1: arg1 description\n @param arg2: arg2 description\n @param arg3: arg3 description\n @param arg4: arg4 description\n @param arg5: arg5 description\n @param arg6: arg6 description\n @param arg7: arg7 description\n @return:\n\n @params\n [arg6]\n calendar_popup = true\n\n @end\n\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n import qt_material\n\n def on_app_start(app: QApplication):\n # this will be called after the instantiation of QApplication.\n print(\"app started\")\n qt_material.apply_stylesheet(app, theme=\"light_teal.xml\")\n\n adapter = GUIAdapter(on_app_start=on_app_start)\n adapter.add(app_style_example)\n adapter.run()\n
"},{"location":"toolbar/","title":"\u7a97\u53e3\u5de5\u5177\u680f","text":""},{"location":"toolbar/#_1","title":"\uff08\u4e00\uff09\u6982\u8ff0","text":"BaseWindow
\u7684\u5b50\u7c7b\u7a97\u53e3\u5747\u53ef\u6dfb\u52a0\u5de5\u5177\u680f\uff0c\u5de5\u5177\u680f\u7684\u5178\u578b\u5916\u89c2\u5982\u4e0b\u56fe\u6240\u793a\uff1a
\u4e3a\u51fd\u6570\u9009\u62e9\u7a97\u53e3
\u548c\u51fd\u6570\u6267\u884c\u7a97\u53e3
\u6dfb\u52a0\u5de5\u5177\u680f\u7684\u5177\u4f53\u65b9\u6cd5\uff0c\u5728\u914d\u7f6e\u7a97\u53e3\u5c5e\u6027\u4e00\u7ae0\u5df2\u7ecf\u7ed9\u51fa\uff0c\u8fd9\u91cc\u4e0d\u518d\u8d58\u8ff0\uff0c\u672c\u7ae0\u8282\u4e3b\u8981\u4ecb\u7ecd\u5de5\u5177\u680f\u672c\u8eab\u7684\u5c5e\u6027\u3002
\u5de5\u5177\u680f\uff08ToolBar\uff09\u7684\u5c5e\u6027\u7531ToolBar\u7c7b\u5b9a\u4e49\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u5bfc\u5165\u8be5\u7c7b\uff1a
from pyguiadapter.toolbar import ToolBar\n
\u901a\u8fc7ToolBar
\u5bf9\u8c61\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u6307\u5b9a\u5de5\u5177\u680f\u7684\u521d\u59cb\u4f4d\u7f6e\u3001\u662f\u5426\u53ef\u62d6\u52a8\u3001\u662f\u5426\u53ef\u6f02\u6d6e\u3001\u52a8\u4f5c\u6309\u94ae\u7684\u5927\u5c0f\u548c\u6837\u5f0f\u4ee5\u53ca\u5305\u542b\u90a3\u4e9b\u52a8\u4f5c\u7b49\u3002
\u8981\u67e5\u770bToolBar
\u7c7b\u4e2d\u5b9a\u4e49\u4e86\u54ea\u4e9b\u5c5e\u6027\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.toolbar.ToolBar
"},{"location":"toolbar/#_2","title":"\uff08\u4e8c\uff09\u4e3b\u8981\u5c5e\u6027","text":"\u5de5\u5177\u680f\u4e0a\u7684\u52a8\u4f5c\uff08Action\uff09
\u53ef\u4ee5\u8bbe\u7f6e\u56fe\u6807\uff08icon
\uff09\u3001\u6587\u5b57\uff08text
\uff09\u3001\u5feb\u6377\u952e\uff08shortcut
\uff09\u7b49\u5c5e\u6027\uff0c\u4e5f\u53ef\u4ee5\u8bbe\u7f6eon_triggered
\u3001on_toggled
\u7b49\u4e8b\u4ef6\u76d1\u542c\u5668\u3002\u5173\u4e8eAction
\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.action.Action
\u53ef\u505c\u9760\u533a\u57df\u53ef\u4ee5\u4f7f\u7528\u5355\u4e2aToolBarArea
\u503c\uff0c\u4e5f\u53ef\u4ee5\u662fToolBarArea
\u7684\u7ec4\u5408\uff0c\u4f8b\u5982\uff1aTopToolBarArea | BottomToolBarArea
\u8868\u793a\u5de5\u5177\u680f\u53ef\u4ee5\u505c\u9760\u5728\u7a97\u53e3\u7684\u9876\u90e8\u6216\u5e95\u90e8\u3002
\u505c\u9760\u533a\u57df\u901a\u5e38\u4f7f\u7528\u4ee5\u4e0b\u5e38\u91cf\u6307\u5b9a\uff1a
-
TopToolBarArea
\uff08\u5728\u7a97\u53e3\u9876\u90e8\u653e\u7f6e\u5de5\u5177\u680f\uff09
-
BottomToolBarArea
\uff08\u5728\u7a97\u53e3\u5e95\u90e8\u653e\u7f6e\u5de5\u5177\u680f\uff09
-
LeftToolBarArea
\uff08\u5728\u7a97\u53e3\u5de6\u4fa7\u653e\u7f6e\u5de5\u5177\u680f\uff09
-
RightToolBarArea
\uff08\u5728\u7a97\u53e3\u53f3\u4fa7\u653e\u7f6e\u5de5\u5177\u680f\uff09
\u6309\u94ae\u6837\u5f0f\u4e3b\u8981\u5305\u62ec\u4ee5\u4e0b\u503c\uff1a
ToolButtonIconOnly
\uff08\u53ea\u663e\u793a\u56fe\u6807\uff09 ToolButtonTextBesideIcon
\uff08\u5728\u56fe\u6807\u65c1\u663e\u793a\u6587\u5b57\uff0c\u5373Action
\u5bf9\u8c61\u7684text
\u5c5e\u6027\uff09 ToolButtonTextUnderIcon
\uff08\u5728\u56fe\u6807\u4e0b\u65b9\u663e\u793a\u6587\u5b57\uff0c\u5373Action
\u5bf9\u8c61\u7684text
\u5c5e\u6027\uff09 ToolButtonTextOnly
\uff08\u53ea\u663e\u793a\u6587\u5b57\uff0c\u5373Action
\u5bf9\u8c61\u7684text
\u5c5e\u6027\uff09 ToolButtonFollowStyle
\uff08\u9075\u5faa\u7cfb\u7edf\u8bbe\u7f6e\uff09
"},{"location":"toolbar/#pyguiadapter.toolbar.ToolBar.actions","title":"actions: List[Union[Action, Separator]]
instance-attribute
","text":"\u8981\u6dfb\u52a0\u5230\u5de5\u5177\u680f\u4e2d\u7684\u52a8\u4f5c\uff08Action
\uff09\u6216\u5206\u9694\u7b26\uff08Separator
\uff09\u5217\u8868\u3002\u5728\u5de5\u5177\u680f\u4e2d\uff0c\u52a8\u4f5cAction
\u4ee5\u5de5\u5177\u680f\u6309\u94ae\u7684\u5f62\u5f0f\u51fa\u73b0\u3002
"},{"location":"toolbar/#pyguiadapter.toolbar.ToolBar.moveable","title":"moveable: bool = True
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u662f\u5426\u53ef\u4ee5\u79fb\u52a8\u3002
"},{"location":"toolbar/#pyguiadapter.toolbar.ToolBar.floatable","title":"floatable: bool = True
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u662f\u5426\u53ef\u4ee5\u6f02\u6d6e\u5728\u4e3b\u7a97\u53e3\u4e4b\u5916\u3002
"},{"location":"toolbar/#pyguiadapter.toolbar.ToolBar.allowed_areas","title":"allowed_areas: Optional[ToolBarAreas] = None
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u4e0a\u5141\u8bb8\u5de5\u5177\u680f\u505c\u9760\u7684\u4f4d\u7f6e\u3002
"},{"location":"toolbar/#pyguiadapter.toolbar.ToolBar.initial_area","title":"initial_area: Optional[ToolBarArea] = None
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u5728\u7a97\u53e3\u4e0a\u7684\u521d\u59cb\u4f4d\u7f6e\u3002
"},{"location":"toolbar/#pyguiadapter.toolbar.ToolBar.button_style","title":"button_style: Optional[ToolButtonStyle] = None
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u6309\u7684\u6837\u5f0f\u3002
"},{"location":"toolbar/#pyguiadapter.toolbar.ToolBar.icon_size","title":"icon_size: Union[int, Tuple[int, int], QSize, None] = None
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u6309\u94ae\u7684\u56fe\u6807\u5927\u5c0f\uff0c
"},{"location":"toolbar/#_3","title":"\uff08\u4e09\uff09\u793a\u4f8b","text":"import json\n\nfrom pyguiadapter.action import Action, Separator\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.toolbar import (\n ToolBar,\n RightToolBarArea,\n LeftToolBarArea,\n ToolButtonTextUnderIcon,\n TopToolBarArea,\n)\nfrom pyguiadapter.utils import filedialog, inputdialog, messagebox\nfrom pyguiadapter.window import SimpleWindowEventListener\nfrom pyguiadapter.windows.fnexec import FnExecuteWindow\n\n\ndef toolbar_example():\n pass\n\n\n###################Action Callbacks#########################\ndef on_action_open(window: FnExecuteWindow, _: Action):\n print(\"on_action_open()\")\n ret = filedialog.get_open_file(\n parent=window,\n title=\"Open File\",\n start_dir=\"./\",\n filters=\"JSON files(*.json);;All files(*.*)\",\n )\n if ret:\n messagebox.show_info_message(window, f\"File will be opened: {ret}\")\n\n\ndef on_action_save(window: FnExecuteWindow, _: Action):\n print(\"on_action_save()\")\n ret = filedialog.get_save_file(\n parent=window,\n title=\"Save File\",\n start_dir=\"./\",\n filters=\"JSON files(*.json);;All files(*.*)\",\n )\n if ret:\n messagebox.show_info_message(window, f\"File will be saved to: {ret}\")\n\n\ndef on_action_settings(window: FnExecuteWindow, _: Action):\n default_settings = {\n \"opt1\": 1,\n \"opt2\": \"2\",\n \"opt3\": True,\n }\n new_settings = inputdialog.input_json_object(\n parent=window,\n title=\"Settings\",\n icon=\"fa.cog\",\n size=(600, 400),\n ok_button_text=\"Save\",\n cancel_button_text=\"Cancel\",\n initial_text=json.dumps(default_settings, indent=4, ensure_ascii=False),\n auto_indent=True,\n indent_size=4,\n auto_parentheses=True,\n line_wrap_mode=inputdialog.LineWrapMode.WidgetWidth,\n line_wrap_width=88,\n )\n if isinstance(new_settings, dict):\n messagebox.show_info_message(window, f\"new settings: {new_settings}\")\n\n\ndef on_action_confirm_quit(window: FnExecuteWindow, _: Action, checked: bool):\n print(\"on_action_confirm_close(): \", checked)\n\n\ndef on_action_close(window: FnExecuteWindow, _: Action):\n print(\"on_action_close()\")\n window.close()\n\n\n###################~Action Callbacks#########################\n\n\nif __name__ == \"__main__\":\n ###################Actions#############################\n action_open = Action(\n text=\"Open\",\n icon=\"fa.folder-open\",\n on_triggered=on_action_open,\n shortcut=\"Ctrl+O\",\n )\n action_save = Action(\n text=\"Save\",\n icon=\"fa.save\",\n on_triggered=on_action_save,\n shortcut=\"Ctrl+S\",\n )\n\n action_settings = Action(\n text=\"Settings\",\n icon=\"fa.cog\",\n on_triggered=on_action_settings,\n shortcut=\"Ctrl+,\",\n )\n\n action_quit = Action(\n text=\"Quit\",\n icon=\"fa.power-off\",\n on_triggered=on_action_close,\n shortcut=\"Ctrl+Q\",\n )\n action_confirm_quit = Action(\n text=\"Confirm Quit\",\n icon=\"fa.question-circle\",\n checkable=True,\n checked=False,\n on_toggled=on_action_confirm_quit,\n )\n ###################~Actions#############################\n\n ####################ToolBar#############################\n toolbar = ToolBar(\n actions=[\n action_open,\n action_save,\n action_settings,\n Separator(),\n action_confirm_quit,\n action_quit,\n ],\n moveable=True,\n floatable=True,\n initial_area=RightToolBarArea,\n allowed_areas=RightToolBarArea | LeftToolBarArea | TopToolBarArea,\n button_style=ToolButtonTextUnderIcon,\n )\n ###################~ToolBar#############################\n\n ################Window Event Listener###################\n def on_window_create(window: FnExecuteWindow):\n print(\"on_window_create()\")\n # make action_confirm_quit checked after the select window is created\n window.set_action_state(action_confirm_quit, True)\n\n def on_window_close(window: FnExecuteWindow) -> bool:\n # get the state of action_confirm_quit\n # if it is checked, show a question message box to ask if the user really wants to close the window\n # if it is not checked, return True to close the window directly.\n state = window.get_action_state(action_confirm_quit)\n if state:\n # access the\n ret = messagebox.show_question_message(\n window,\n message=\"Do you really want to close the window?\",\n title=\"Quit\",\n buttons=messagebox.Yes | messagebox.No,\n )\n return ret == messagebox.Yes\n return True\n\n window_listener = SimpleWindowEventListener(\n on_create=on_window_create, on_close=on_window_close\n )\n #################Window Event Listener##################\n\n adapter = GUIAdapter()\n adapter.add(\n toolbar_example, window_toolbar=toolbar, window_listener=window_listener\n )\n adapter.run()\n
"},{"location":"user-interaction/","title":"\u4e0e\u7528\u6237\u4ea4\u4e92","text":""},{"location":"user-interaction/#_1","title":"\uff08\u4e00\uff09\u6982\u8ff0","text":"\u5f00\u53d1\u8005\u6709\u65f6\u9700\u8981\u5728\u51fd\u6570\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u4e0e\u7528\u6237\u8fdb\u884c\u4ea4\u4e92\uff0c\u6bd4\u5982\u5f39\u51fa\u6d88\u606f\u5bf9\u8bdd\u6846\uff0c\u5411\u7528\u6237\u5c55\u793a\u4e00\u4e9b\u4fe1\u606f\uff1b\u8bf7\u6c42\u7528\u6237\u5bf9\u67d0\u4e9b\u64cd\u4f5c\u8fdb\u884c\u786e\u8ba4\uff1b\u6216\u8005\u662f\u8981\u6c42\u7528\u6237\u8f93\u5165\u67d0\u4e9b\u6570\u636e\u3002\u5bf9\u6b64\uff0cPyGUIAdapter
\u63d0\u4f9b\u4e86\u652f\u6301\u3002
\u8fd0\u884c\u4e2d\u7684\u4ea4\u4e92\uff0c\u603b\u7684\u6765\u8bf4\uff0c\u53ef\u4ee5\u5206\u4e3a\u4e24\u7c7b\uff1a\u4e00\u662f\u5c55\u793a\u4fe1\u606f\uff0c\u4e8c\u662f\u8bf7\u6c42\u8f93\u5165\u6570\u636e\u3002\u4e0b\u9762\u5c06\u5206\u522b\u5bf9\u8fd9\u4e24\u65b9\u9762\u8fdb\u884c\u9610\u8ff0\u3002
"},{"location":"user-interaction/#_2","title":"\uff08\u4e8c\uff09\u6d88\u606f\u5bf9\u8bdd\u6846","text":"\u6d88\u606f\u5bf9\u8bdd\u6846\u76f8\u5173\u7684API\u5b9a\u4e49\u5728pyguiadapter.adapter.udialog
\u6a21\u5757\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u65b9\u5f0f\u5bfc\u5165\u8be5\u6a21\u5757
from pyguiadapter.adapter import udialog\n
\u6d88\u606f\u5bf9\u8bdd\u6846\u76f8\u5173\u7684API\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.adapter.udialog
"},{"location":"user-interaction/#1","title":"1\u3001\u6807\u51c6\u6d88\u606f\u5bf9\u8bdd\u6846","text":"PyGUIAdapter
\u63d0\u4f9b\u4e86\u56db\u79cd\u6807\u51c6\u7684\u6d88\u606f\u5bf9\u8bdd\u6846\uff0c\u53ef\u4ee5\u7528\u4e8e\u5c55\u793a\u4e0d\u540c\u7ea7\u522b\u7684\u6d88\u606f\u3002
- Information\u6d88\u606f\u5bf9\u8bdd\u6846\uff1a\u7528\u4e8e\u5c55\u793a\u4e00\u822c\u6027\u4fe1\u606f\u3002
show_info_messagebox()\n
- Warning\u6d88\u606f\u5bf9\u8bdd\u6846\uff1a\u7528\u4e8e\u5c55\u793a\u8b66\u544a\u4fe1\u606f\u3002
show_warning_messagebox()\n
- Critical\u6d88\u606f\u5bf9\u8bdd\u6846\uff1a\u7528\u4e8e\u5c55\u793a\u4e25\u91cd\u9519\u8bef\u4fe1\u606f\u3002
show_critical_messagebox()\n
- Question\u5bf9\u8bdd\u6846\uff1a\u7528\u4e8e\u5c55\u793a\u95ee\u8be2\u4fe1\u606f\uff0c\u5e76\u4e14\u53ef\u4ee5\u83b7\u5f97\u95ee\u8be2\u7ed3\u679c\u3002
show_question_messagebox()\n
\u4e0b\u9762\u662f\u4e00\u4e2a\u7efc\u5408\u7684\u793a\u4f8b\uff1a
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter import udialog\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import text_t\nfrom pyguiadapter.utils import messagebox\n\n\ndef dialog_example(\n info_message: text_t,\n warning_message: text_t,\n error_message: text_t,\n question_message: text_t,\n):\n if info_message:\n udialog.show_info_messagebox(\n text=info_message,\n title=\"Information\",\n buttons=messagebox.Ok | messagebox.No,\n default_button=messagebox.Ok,\n )\n\n if warning_message:\n udialog.show_warning_messagebox(\n text=warning_message,\n title=\"Warning\",\n buttons=messagebox.Ok | messagebox.No,\n default_button=messagebox.Ok,\n )\n\n if error_message:\n udialog.show_critical_messagebox(\n text=error_message,\n title=\"Error\",\n buttons=messagebox.Ok | messagebox.No,\n default_button=messagebox.Ok,\n )\n\n if question_message:\n answer = udialog.show_question_messagebox(\n text=question_message,\n title=\"Question\",\n buttons=messagebox.Yes | messagebox.No,\n default_button=messagebox.No,\n )\n if answer == messagebox.Yes:\n uprint(\"Your Choice: Yes\")\n udialog.show_info_messagebox(\"You Choose Yes!\", title=\"Answer\")\n else:\n uprint(\"Your Choice: No\")\n udialog.show_info_messagebox(\"You Choose No!\", title=\"Answer\")\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(dialog_example)\n adapter.run()\n
"},{"location":"user-interaction/#2","title":"2\u3001\u957f\u6587\u672c\u6d88\u606f\u5bf9\u8bdd\u6846","text":"PyGUIAdapter
\u8fd8\u63d0\u4f9b\u4e86\u4e24\u79cd\u7528\u4e8e\u5c55\u793a\u957f\u6587\u672c\u5185\u5bb9\u7684\u6d88\u606f\u5bf9\u8bdd\u6846\uff1a
- \u76f4\u63a5\u5c55\u793a\u957f\u6587\u672c\u5b57\u7b26\u4e32
show_text_content()\n
- \u5c55\u793a\u6587\u672c\u6587\u4ef6\u5185\u5bb9
show_text_file()\n
\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a
import os.path\nfrom typing import Literal\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter import udialog\nfrom pyguiadapter.exceptions import ParameterError\nfrom pyguiadapter.extend_types import text_t, file_t\nfrom pyguiadapter.utils import messagebox\n\n\ndef show_text_context_example(\n content: text_t, text_format: Literal[\"markdown\", \"plaintext\", \"html\"] = \"markdown\"\n):\n if content:\n udialog.show_text_content(\n title=\"Hello\",\n text_content=content,\n text_format=text_format,\n buttons=messagebox.DialogButtonYes | messagebox.DialogButtonNo,\n size=(600, 400),\n )\n\n\ndef show_text_file_example(\n text_file: file_t,\n text_format: Literal[\"markdown\", \"plaintext\", \"html\"] = \"markdown\",\n):\n \"\"\"\n Show text content of the file\n\n @param text_file: the path of the text file\n @param text_format: the format of the text file\n @return:\n\n @params\n [text_file]\n filters = \"Text files(*.txt);;Markdown files(*.md);;HTML files(*.html);;All files(*.*)\"\n @end\n \"\"\"\n text_file = text_file.strip()\n if not text_file:\n raise ParameterError(\"text_file\", \"text_file is empty!\")\n\n if not os.path.isfile(text_file):\n udialog.show_critical_messagebox(text=\"File not found\", title=\"Error\")\n return\n filename = os.path.basename(text_file)\n if text_file:\n udialog.show_text_file(\n text_file=text_file,\n text_format=text_format,\n title=f\"View - {filename}\",\n size=(600, 400),\n )\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(show_text_context_example)\n adapter.add(show_text_file_example)\n adapter.run()\n
"},{"location":"user-interaction/#3","title":"3\u3001\u81ea\u5b9a\u4e49\u6d88\u606f\u5bf9\u8bdd\u6846","text":"\u4e3a\u4e86\u5b9e\u73b0\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846\uff0c\u5f00\u53d1\u8005\u9700\u8981\u638c\u63e1\u4e00\u5b9apyqt
\u6216pyside
\u5f00\u53d1\u77e5\u8bc6
\u5982\u679cPyGUIAdapter
\u5185\u7f6e\u7684\u6d88\u606f\u5bf9\u8bdd\u6846\u4e0d\u80fd\u6ee1\u8db3\u9700\u8981\uff0c\u5f00\u53d1\u8005\u4e5f\u53ef\u4ee5\u81ea\u5b9a\u4e49\u6d88\u606f\u5bf9\u8bdd\u6846\u3002\u4e00\u822c\u6d41\u7a0b\u5982\u4e0b\uff1a
1\u3001\u5b50\u7c7b\u5316pyguiadater.adapter.BaseCustomDialog
\u7c7b\uff0c\u521b\u5efa\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846\u7c7b
\u5728\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846\u7c7b\u4e2d\uff0c\u5f00\u53d1\u8005\u9700\u5b9e\u73b0get_result()
\u62bd\u8c61\u65b9\u6cd5\uff0c\u540e\u7eed\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u8c03\u7528\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846\u540e\u83b7\u53d6\u8be5\u65b9\u6cd5\u7684\u8fd4\u56de\u503c\u3002
2\u3001\u8c03\u7528udialog.show_custom_dialog()
\u5f39\u51fa\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846
def show_custom_dialog(\n dialog_class: Type[BaseCustomDialog], **kwargs\n) -> Any:\n ...\n
udialog.show_custom_dialog()
\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846\u7c7b\uff0c\u7b2c\u4e00\u4e2a\u53c2\u6570\u4e4b\u540e\u7684\u5173\u952e\u5b57\u53c2\u6570\u5c06\u4f5c\u4e3a\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846__init__()
\u51fd\u6570\u7684\u53c2\u6570\u3002udialog.show_custom_dialog()
\u51fd\u6570\u5c06\u8fd4\u56deget_result()
\u65b9\u6cd5\u7684\u8fd4\u56de\u503c\u3002
\u4e0b\u9762\u7ed9\u51fa\u4e00\u4e2a\u81ea\u5b9a\u4e49\u6d88\u606f\u5bf9\u8bdd\u6846\u7684\u793a\u4f8b\uff1a
from datetime import date, datetime\nfrom typing import Any\nfrom uuid import uuid1\n\nfrom qtpy.QtWidgets import QWidget, QVBoxLayout, QLabel, QDialogButtonBox\n\nfrom pyguiadapter.adapter import GUIAdapter, BaseCustomDialog\nfrom pyguiadapter.adapter import udialog\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.exceptions import ParameterError\n\n\nclass UserInfoDialog(BaseCustomDialog):\n def __init__(\n self,\n parent: QWidget,\n username: str,\n nickname: str,\n user_id: str,\n birthdate: date,\n join_time: datetime,\n **kwargs,\n ):\n super().__init__(parent, **kwargs)\n\n self.setWindowTitle(\"Confirm\")\n\n self._confirmed = False\n self._user_info = {\n \"username\": username,\n \"nickname\": nickname,\n \"user_id\": user_id,\n \"birthdate\": birthdate,\n \"join_time\": join_time,\n }\n\n self._button_box = QDialogButtonBox(self)\n self._button_box.setStandardButtons(\n QDialogButtonBox.Ok | QDialogButtonBox.Cancel\n )\n self._button_box.accepted.connect(self._on_accepted)\n self._button_box.rejected.connect(self._on_rejected)\n\n layout = QVBoxLayout()\n username_label = QLabel(self)\n username_label.setText(f\"username: {username}\")\n layout.addWidget(username_label)\n nickname_label = QLabel(self)\n nickname_label.setText(f\"nickname: {nickname}\")\n layout.addWidget(nickname_label)\n user_id_label = QLabel(self)\n user_id_label.setText(f\"user_id: {user_id}\")\n layout.addWidget(user_id_label)\n birthdate_label = QLabel(self)\n birthdate_label.setText(f\"birthdate: {birthdate}\")\n layout.addWidget(birthdate_label)\n join_time_label = QLabel(self)\n join_time_label.setText(f\"join_time: {join_time}\")\n layout.addWidget(join_time_label)\n layout.addWidget(self._button_box)\n self.setLayout(layout)\n\n def get_result(self) -> Any:\n if self._confirmed:\n return self._user_info\n return None\n\n def _on_accepted(self) -> None:\n self._confirmed = True\n self.accept()\n\n def _on_rejected(self) -> None:\n self._confirmed = False\n self.reject()\n\n\ndef add_user_example(\n username: str,\n nickname: str,\n user_id: str,\n birth_date: date,\n join_time: datetime,\n):\n if not username:\n raise ParameterError(\"username\", \"username is empty\")\n\n if not user_id:\n udialog.show_warning_messagebox(\n \"user_id is empty, a random one will be generated!\"\n )\n user_id = uuid1().hex\n\n result = udialog.show_custom_dialog(\n UserInfoDialog,\n username=username,\n nickname=nickname,\n user_id=user_id,\n birthdate=birth_date,\n join_time=join_time,\n )\n if result is not None:\n udialog.show_info_messagebox(f\"user added!\")\n uprint(result)\n return\n udialog.show_info_messagebox(f\"user not added!\")\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(add_user_example)\n adapter.run()\n
"},{"location":"user-interaction/#_3","title":"\uff08\u4e09\uff09\u8f93\u5165\u5bf9\u8bdd\u6846","text":"\u8f93\u5165\u5bf9\u8bdd\u6846\u76f8\u5173API\u5728pyguiadapter.adapter.uinput
\u6a21\u5757\u4e2d\u5b9a\u4e49\u3002
\u8f93\u5165\u5bf9\u8bdd\u6846\u76f8\u5173\u7684API\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.adapter.uinput
"},{"location":"user-interaction/#1_1","title":"1\u3001\u5185\u7f6e\u8f93\u5165\u5bf9\u8bdd\u6846\u7c7b\u578b","text":"PyGUIAdapter
\u5185\u7f6e\u4e86\u591a\u79cd\u7c7b\u578b\u7684\u8f93\u5165\u5bf9\u8bdd\u6846\uff0c\u7528\u4ee5\u8f93\u5165\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u636e\uff0c\u5305\u62ec\uff1a
get_string()
get_text()
get_int()
get_float()
get_selected_item()
get_color()
get_json_object()
get_py_literal()
get_existing_directory()
get_open_file()
get_open_files()
get_save_file()
\u4e0b\u9762\u662f\u4e00\u4e2a\u7efc\u5408\u7684\u793a\u4f8b\uff1a
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter import uinput\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import choices_t\n\n\n# noinspection SpellCheckingInspection\ndef uinput_example(inputs: choices_t):\n \"\"\"\n Example of getting user inputs inside the function\n @param inputs: choose what you want to get from user\n @return:\n\n @params\n [inputs]\n choices = [\"int\", \"str\", \"text\", \"float\", \"item\", \"color\", \"dir\", \"file\", \"save_file\", \"files\", \"json object\", \"python literal\"]\n columns = 2\n @end\n \"\"\"\n if \"int\" in inputs:\n value = uinput.get_int(title=\"Input Integer\", label=\"Enter an integer:\")\n uprint(\"User inputs: \", value)\n if \"str\" in inputs:\n value = uinput.get_string(title=\"Input Text\", label=\"Enter a string:\")\n uprint(\"User inputs: \", value)\n if \"text\" in inputs:\n value = uinput.get_text(title=\"Input Text\", label=\"Enter a string:\")\n uprint(\"User inputs: \", value)\n if \"float\" in inputs:\n value = uinput.get_float(title=\"Input Float\", label=\"Enter a float:\")\n uprint(\"User inputs: \", value)\n\n if \"item\" in inputs:\n value = uinput.get_selected_item(\n items=[\"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\"],\n title=\"Select Item\",\n label=\"Select an item:\",\n )\n uprint(\"User inputs: \", value)\n if \"color\" in inputs:\n value = uinput.get_color(title=\"Select Color\", alpha_channel=True)\n uprint(\"User inputs: \", value)\n if \"dir\" in inputs:\n value = uinput.get_existing_directory(title=\"Select Directory\")\n uprint(\"User inputs: \", value)\n if \"file\" in inputs:\n value = uinput.get_open_file(title=\"Select File\")\n uprint(\"User inputs: \", value)\n if \"save_file\" in inputs:\n value = uinput.get_save_file(title=\"Select File\")\n uprint(\"User inputs: \", value)\n if \"files\" in inputs:\n value = uinput.get_open_files(title=\"Select Files\")\n uprint(\"User inputs: \", value)\n if \"json object\" in inputs:\n value = uinput.get_json_object(title=\"Input Json Object\")\n uprint(\"User inputs: \", value, f\" {type(value)}\")\n if \"python literal\" in inputs:\n value = uinput.get_py_literal(title=\"Input Python Literal\")\n uprint(\"User inputs: \", value, f\" {type(value)}\")\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(uinput_example)\n adapter.run()\n
"},{"location":"user-interaction/#2_1","title":"2\u3001\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846","text":"\u82e5\u5185\u7f6e\u7684\u8f93\u5165\u5bf9\u8bdd\u6846\u65e0\u6cd5\u6ee1\u8db3\u5f00\u53d1\u8005\u9700\u6c42\uff0c\u5f00\u53d1\u8005\u4e5f\u53ef\u4ee5\u521b\u5efa\u5e76\u4f7f\u7528\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u3002
"},{"location":"user-interaction/#1_2","title":"\uff081\uff09\u5927\u81f4\u6b65\u9aa4","text":"\u7b2c\u4e00\u6b65\uff1a\u5b9e\u73b0\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846
\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u7c7b\u9700\u7ee7\u627f\u81eapyguiadapter.utils.inputdialog.UniversalInputDialog
\u7c7b\u3002\u5f00\u53d1\u8005\u5fc5\u987b\u5b9e\u73b0\u4ee5\u4e0b\u4e24\u4e2a\u62bd\u8c61\u65b9\u6cd5\u3002
create_main_widget()
\u65b9\u6cd5
@abstractmethod\ndef create_main_widget(self) -> QWidget:\n pass\n
\u5f00\u53d1\u8005\u9700\u5728\u8be5\u65b9\u6cd5\u4e2d\u521b\u5efa\u8f93\u5165\u5bf9\u8bdd\u6846\u7684\u4e3b\u63a7\u4ef6\u5e76\u5c06\u5176\u8fd4\u56de\u3002\u6240\u8c13\u4e3b\u63a7\u4ef6\uff08main widget\uff09
\u662f\u6307\u4e0b\u56fe\u4e2d\u4f7f\u7528\u7ea2\u6846\u6807\u6ce8\u7684\u4f4d\u7f6e\uff1a
get_result()
\u65b9\u6cd5
\u8be5\u65b9\u6cd5\u7528\u4e8e\u8fd4\u56de\u7528\u6237\u5728\u5bf9\u8bdd\u6846\u4e2d\u8f93\u5165\u7684\u503c\u3002
@abstractmethod\n def get_result(self) -> Any:\n pass\n
\u7b2c\u4e8c\u6b65\uff1a\u5f39\u51fa\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846
\u5b9e\u73b0\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u540e\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u8c03\u7528uinput.get_custom_input()
\u51fd\u6570\u5f39\u51fa\u5bf9\u8bdd\u6846\u5e76\u83b7\u53d6\u7528\u6237\u8f93\u5165\u503c\u3002
def get_custom_input(\n input_dialog_class: Type[UniversalInputDialog],\n **input_dialog_args,\n) -> Any:\n ...\n
get_custom_input()
\u51fd\u6570\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570input_dialog_class
\u662f\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u7c7b\uff0c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u5219\u662f\u8981\u4f20\u9012\u7ed9\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u7c7b\u6784\u9020\u51fd\u6570\u7684\u53c2\u6570\u3002
\u5173\u4e8eget_custom_input()
\u51fd\u6570\u7684\u8fd4\u56de\u503c\uff0c\u5b58\u5728\u4ee5\u4e0b\u4e24\u79cd\u60c5\u51b5\uff1a
\uff081\uff09\u82e5\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u88abreject
\uff0c\u5219get_custom_input()
\u51fd\u6570\u8fd4\u56deNone
\uff082\uff09\u82e5\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u88abaccept
\uff0c\u5219get_custom_input()
\u51fd\u6570\u8fd4\u56deget_result()
\u65b9\u6cd5\u7684\u8fd4\u56de\u503c\u3002
"},{"location":"user-interaction/#2_2","title":"\uff082\uff09\u5b9e\u4f8b","text":"\u4e0b\u9762\uff0c\u901a\u8fc7\u4e00\u4e2a\u5b9e\u9645\u7684\u4f8b\u5b50\u6765\u6f14\u793a\u5982\u4f55\u521b\u5efa\u548c\u4f7f\u7528\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u3002\u8fd9\u6b21\u6211\u4eec\u9009\u62e9\u7528QT\u63d0\u4f9b\u7684\u53ef\u89c6\u5316\u8bbe\u8ba1\u5de5\u5177QT\u8bbe\u8ba1\u5e08
\u6765\u5b8c\u6210\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u7684\u4e3b\u63a7\u4ef6\u7684\u8bbe\u8ba1\u548c\u5e03\u5c40\u3002
\u5047\u8bbe\u8981\u4e3a\u4ee5\u4e0b\u7c7b\u578b\u521b\u5efa\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\uff1a
@dataclasses.dataclass\nclass UserInfo:\n username: str\n birthday: date\n address: str\n email: str\n phone: str\n description: str\n
\u7b2c\u4e00\u6b65\uff1a\u521b\u5efa\u5bf9\u5e94\u7684\u81ea\u5b9a\u4e49\u8f93\u5165\u5bf9\u8bdd\u6846\u7c7b
\uff0c\u7c7b\u540d\u4e3aUserInfoDialog
\u3002
class UserInfoDialog(UniversalInputDialog):\n\n def __init__(\n self,\n parent: Optional[QWidget],\n title: str = \"\",\n icon: IconType = None,\n size: Tuple[int, int] = (400, 300),\n ok_button_text: str = \"Ok\",\n cancel_button_text: Optional[str] = \"Cancel\",\n **kwargs\n ):\n super().__init__(\n parent,\n title=title,\n icon=icon,\n size=size,\n ok_button_text=ok_button_text,\n cancel_button_text=cancel_button_text,\n **kwargs\n )\n\n def get_result(self) -> Any:\n pass\n\n def create_main_widget(self) -> QWidget:\n pass\n
create_main_widget()
\u548cget_result()
\u76ee\u524d\u90fd\u8fd8\u662f\u672a\u5b9e\u73b0\u7684\u72b6\u6001\uff0c\u540e\u9762\u6211\u4eec\u5c06\u9010\u6b65\u5b9e\u73b0\u5b83\u4eec\u3002\u540c\u65f6\uff0c\u8bfb\u8005\u53ef\u80fd\u5df2\u7ecf\u6ce8\u610f\u5230\uff0cUserInfoDialog
\u6784\u9020\u51fd\u6570\u4e2d\u6709\u4e00\u4e9b\u53c2\u6570\uff0c\u8fd9\u4e9b\u53c2\u6570\u5747\u6765\u81ea\u5176\u7236\u7c7bUniversalInputDialog
\uff0c\u53ef\u4ee5\u76f4\u63a5\u4ece\u7236\u7c7b\u6784\u9020\u51fd\u6570\u590d\u5236\u8fc7\u6765\u3002
\u73b0\u5728\uff0c\u5411UserInfoDialog
\u7c7b\u7684\u6784\u9020\u51fd\u6570\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u53c2\u6570\uff1ainitial_user_info
\uff0c\u8fd9\u4e2a\u53c2\u6570\u8868\u793a\u521d\u59cb\u7684UserInfo
\u5bf9\u8c61\uff0c\u540e\u7eed\u5c06\u7528\u4e8e\u4e3a\u63a7\u4ef6\u8bbe\u7f6e\u521d\u59cb\u503c\u3002\u73b0\u5728UserInfoDialog
\u7684\u6784\u9020\u51fd\u6570\u5982\u4e0b\uff1a
class UserInfoDialog(UniversalInputDialog):\n def __init__(\n self,\n parent: Optional[QWidget],\n title: str = \"\",\n icon: IconType = None,\n size: Tuple[int, int] = (400, 300),\n ok_button_text: str = \"Ok\",\n cancel_button_text: Optional[str] = \"Cancel\",\n initial_user_info: Optional[UserInfo] = None,\n **kwargs\n ):\n self._initial_user_info: Optional[UserInfo] = initial_user_info\n super().__init__(\n parent,\n title=title,\n icon=icon,\n size=size,\n ok_button_text=ok_button_text,\n cancel_button_text=cancel_button_text,\n **kwargs\n )\n ...\n
\u7b2c\u4e8c\u6b65\uff1a\u521b\u5efa\u4e3b\u63a7\u4ef6
\uff0c\u5b9e\u73b0create_main_widget()
\u51fd\u6570\u3002
\u524d\u9762\u8bf4\u8fc7\uff0c\u8fd9\u6b21\u9009\u62e9\u4f7f\u7528QT\u8bbe\u8ba1\u5e08
\u800c\u4e0d\u662f\u624b\u52a8\u5199\u4ee3\u7801\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\u4e3b\u63a7\u4ef6\u3002
\u6839\u636eUserInfo
\u7684\u5b57\u6bb5\u4fe1\u606f\uff0c\u5728QT\u8bbe\u8ba1\u5e08
\u4e2d\u62d6\u62fd\u5408\u9002\u7684\u63a7\u4ef6\uff0c\u5b8c\u6210\u5e03\u5c40\uff0c\u5e76\u5c06\u5e03\u5c40\u597d\u7684\u754c\u9762\u4fdd\u5b58\u4e3a.ui
\u6587\u4ef6\uff0c\u8fd9\u91cc\u6211\u4eec\u5c06\u5176\u547d\u540d\u4e3auser_info_dialog_main_widget.ui
\uff0c\u5c06\u8be5\u6587\u4ef6\u4e0eUserInfoDialog
\u6e90\u7801\u6587\u4ef6\u653e\u5728\u540c\u4e00\u76ee\u5f55\u4e0b\u3002
\u6211\u4eec\u9700\u8981\u5728QT\u8bbe\u8ba1\u5e08
\u4e2d\u4e3a\u8f93\u5165\u63a7\u4ef6\u5408\u7406\u8bbe\u7f6e\u5bf9\u8c61\u540d\u79f0\uff08objectName\uff09\uff0c\u4ee5\u4fbf\u540e\u7eed\u5728\u4ee3\u7801\u4e2d\u5f15\u7528\u5b83\u4eec\u3002\u5728\u672c\u793a\u4f8b\u4e2d\uff0c\u8fd9\u4e9b\u63a7\u4ef6\u7684\u540d\u79f0\u5982\u4e0b\u56fe\u6240\u793a\uff1a
\u73b0\u5728\u9700\u8981\u5728create_main_widget()
\u4e2d\u52a0\u8f7d.ui
\u6587\u4ef6\uff0c\u83b7\u53d6\u5404\u5b57\u6bb5\u5bf9\u5e94\u7684\u8f93\u5165\u63a7\u4ef6\uff0c\u5e76\u6839\u636einital_user_info
\u8bbe\u7f6e\u5176\u521d\u59cb\u503c\uff0c\u6700\u540e\u8fd4\u56de\u6700\u5916\u5c42\u7684\u63a7\u4ef6\u3002
...\n def create_main_widget(self) -> QWidget:\n ui_file = \"user_info_dialog_main_widget.ui\"\n # create widget from ui file\n main_widget = loadUi(ui_file)\n\n # obtain input widgets for UserInfo fields and set its initial values from initial_user_info\n self._username_edit = main_widget.findChild(QLineEdit, \"username_edit\")\n if self._initial_user_info:\n self._username_edit.setText(self._initial_user_info.username)\n\n self._birthday_edit = main_widget.findChild(QDateEdit, \"birthday_edit\")\n if self._initial_user_info:\n self._birthday_edit.setDate(self._initial_user_info.birthday)\n\n self._address_edit = main_widget.findChild(QLineEdit, \"address_edit\")\n if self._initial_user_info:\n self._address_edit.setText(self._initial_user_info.address)\n\n self._email_edit = main_widget.findChild(QLineEdit, \"email_edit\")\n if self._initial_user_info:\n self._email_edit.setText(self._initial_user_info.email)\n\n self._phone_edit = main_widget.findChild(QLineEdit, \"phone_edit\")\n if self._initial_user_info:\n self._phone_edit.setText(self._initial_user_info.phone)\n\n self._description_edit = main_widget.findChild(QTextEdit, \"description_edit\")\n if self._initial_user_info:\n self._description_edit.setText(self._initial_user_info.description)\n\n return main_widget\n
\u4e3a\u4e86\u4ee3\u7801\u7684\u5176\u4ed6\u5730\u65b9\u5f15\u7528\u65b9\u4fbf\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u6784\u9020\u51fd\u6570\u4e2d\u9884\u5148\u5b9a\u4e49self._username_edit
\u3001self._birthday_edit
\u7b49\u6210\u5458\u53d8\u91cf\u3002\u73b0\u5728\uff0cUserInfoDialog
\u7c7b\u7684\u4ee3\u7801\u5982\u4e0b\uff1a
class UserInfoDialog(UniversalInputDialog):\n def __init__(\n self,\n parent: Optional[QWidget],\n title: str = \"\",\n icon: IconType = None,\n size: Tuple[int, int] = (400, 300),\n ok_button_text: str = \"Ok\",\n cancel_button_text: Optional[str] = \"Cancel\",\n initial_user_info: Optional[UserInfo] = None,\n **kwargs\n ):\n self._description_edit: Optional[QTextEdit] = None\n self._phone_edit: Optional[QLineEdit] = None\n self._email_edit: Optional[QLineEdit] = None\n self._address_edit: Optional[QLineEdit] = None\n self._birthday_edit: Optional[QDateEdit] = None\n self._username_edit: Optional[QLineEdit] = None\n self._initial_user_info: Optional[UserInfo] = initial_user_info\n super().__init__(\n parent,\n title=title,\n icon=icon,\n size=size,\n ok_button_text=ok_button_text,\n cancel_button_text=cancel_button_text,\n **kwargs\n )\n\n def get_result(self) -> Any:\n pass\n\n def create_main_widget(self) -> QWidget:\n ui_file = \"user_info_dialog_main_widget.ui\"\n # create widget from ui file\n main_widget = loadUi(ui_file)\n\n # obtain input widgets for UserInfo fields and set its initial values from initial_user_info\n self._username_edit = main_widget.findChild(QLineEdit, \"username_edit\")\n if self._initial_user_info:\n self._username_edit.setText(self._initial_user_info.username)\n\n self._birthday_edit = main_widget.findChild(QDateEdit, \"birthday_edit\")\n if self._initial_user_info:\n self._birthday_edit.setDate(self._initial_user_info.birthday)\n\n self._address_edit = main_widget.findChild(QLineEdit, \"address_edit\")\n if self._initial_user_info:\n self._address_edit.setText(self._initial_user_info.address)\n\n self._email_edit = main_widget.findChild(QLineEdit, \"email_edit\")\n if self._initial_user_info:\n self._email_edit.setText(self._initial_user_info.email)\n\n self._phone_edit = main_widget.findChild(QLineEdit, \"phone_edit\")\n if self._initial_user_info:\n self._phone_edit.setText(self._initial_user_info.phone)\n\n self._description_edit = main_widget.findChild(QTextEdit, \"description_edit\")\n if self._initial_user_info:\n self._description_edit.setText(self._initial_user_info.description)\n\n return main_widget\n
\u63a5\u4e0b\u6765\uff0c\u53ea\u9700\u8981\u5b9e\u73b0get_result()
\u65b9\u6cd5\u5373\u53ef\u5927\u529f\u544a\u6210\u3002
\u7b2c\u4e09\u6b65\uff1a\u5b9e\u73b0get_result()
\u65b9\u6cd5\uff0c\u8fd4\u56de\u7528\u6237\u8f93\u5165\u7ed3\u679c\u3002
\u5728\u672c\u793a\u4f8b\u4e2d\uff0cget_result()
\u5e94\u5f53\u8fd4\u56de\u4e00\u4e2aUserInfo
\u5bf9\u8c61\u3002\u8fd9\u5c06\u662f\u975e\u5e38\u7b80\u5355\u7684\u4e00\u4ef6\u4e8b\uff0c\u53ea\u9700\u4ece\u5bf9\u5e94\u7684\u63a7\u4ef6\u83b7\u53d6\u5f53\u524d\u503c\uff0c\u7528\u8fd9\u4e9b\u503c\u5b9e\u4f8b\u5316UserInfo
\uff0c\u7136\u540e\u8fd4\u56de\u8be5\u5bf9\u8c61\u5373\u53ef\uff0c\u5177\u4f53\u4ee3\u7801\u5982\u4e0b\uff1a
def get_result(self) -> UserInfo:\n username = self._username_edit.text()\n birthday = self._birthday_edit.date().toPyDate()\n address = self._address_edit.text()\n email = self._email_edit.text()\n phone = self._phone_edit.text()\n description = self._description_edit.toPlainText()\n new_user_info = UserInfo(\n username=username,\n birthday=birthday,\n address=address,\n email=email,\n phone=phone,\n description=description,\n )\n return new_user_info\n
\u73b0\u5728\uff0c\u6211\u4eec\u7684UserInfoDialog
\u5df2\u7ecf\u5b8c\u6210\u4e86\uff0c\u5b8c\u6574\u7684\u4ee3\u7801\u5982\u4e0b\uff1a
class UserInfoDialog(UniversalInputDialog):\n\n def __init__(\n self,\n parent: Optional[QWidget],\n title: str = \"\",\n icon: IconType = None,\n size: Tuple[int, int] = (400, 300),\n ok_button_text: str = \"Ok\",\n cancel_button_text: Optional[str] = \"Cancel\",\n initial_user_info: Optional[UserInfo] = None,\n **kwargs\n ):\n self._description_edit: Optional[QTextEdit] = None\n self._phone_edit: Optional[QLineEdit] = None\n self._email_edit: Optional[QLineEdit] = None\n self._address_edit: Optional[QLineEdit] = None\n self._birthday_edit: Optional[QDateEdit] = None\n self._username_edit: Optional[QLineEdit] = None\n self._initial_user_info: Optional[UserInfo] = initial_user_info\n super().__init__(\n parent,\n title=title,\n icon=icon,\n size=size,\n ok_button_text=ok_button_text,\n cancel_button_text=cancel_button_text,\n **kwargs\n )\n\n def get_result(self) -> UserInfo:\n username = self._username_edit.text()\n birthday = self._birthday_edit.date().toPyDate()\n address = self._address_edit.text()\n email = self._email_edit.text()\n phone = self._phone_edit.text()\n description = self._description_edit.toPlainText()\n new_user_info = UserInfo(\n username=username,\n birthday=birthday,\n address=address,\n email=email,\n phone=phone,\n description=description,\n )\n return new_user_info\n\n def create_main_widget(self) -> QWidget:\n ui_file = \"user_info_dialog_main_widget.ui\"\n # create widget from ui file\n main_widget = loadUi(ui_file)\n\n # obtain input widgets for UserInfo fields and set its initial values from initial_user_info\n self._username_edit = main_widget.findChild(QLineEdit, \"username_edit\")\n if self._initial_user_info:\n self._username_edit.setText(self._initial_user_info.username)\n\n self._birthday_edit = main_widget.findChild(QDateEdit, \"birthday_edit\")\n if self._initial_user_info:\n self._birthday_edit.setDate(self._initial_user_info.birthday)\n\n self._address_edit = main_widget.findChild(QLineEdit, \"address_edit\")\n if self._initial_user_info:\n self._address_edit.setText(self._initial_user_info.address)\n\n self._email_edit = main_widget.findChild(QLineEdit, \"email_edit\")\n if self._initial_user_info:\n self._email_edit.setText(self._initial_user_info.email)\n\n self._phone_edit = main_widget.findChild(QLineEdit, \"phone_edit\")\n if self._initial_user_info:\n self._phone_edit.setText(self._initial_user_info.phone)\n\n self._description_edit = main_widget.findChild(QTextEdit, \"description_edit\")\n if self._initial_user_info:\n self._description_edit.setText(self._initial_user_info.description)\n\n return main_widget\n
\u8ba9\u6211\u4eec\u5199\u4e00\u4e2a\u51fd\u6570\u6765\u6d4b\u8bd5\u4e00\u4e0b\u5b83\u5427\u3002
def user_info_example(\n initial_username: str = \"\",\n initial_birthday: date = date(1990, 1, 1),\n initial_address: str = \"\",\n initial_email: str = \"\",\n initial_phone: str = \"\",\n initial_description: text_t = \"\",\n):\n user_info = uinput.get_custom_input(\n UserInfoDialog,\n title=\"Get User Info\",\n size=(350, 400),\n ok_button_text=\"Confirm\",\n cancel_button_text=\"Dismiss\",\n initial_user_info=UserInfo(\n username=initial_username,\n birthday=initial_birthday,\n address=initial_address,\n email=initial_email,\n phone=initial_phone,\n description=initial_description,\n ),\n )\n uprint(user_info)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(user_info_example)\n adapter.run()\n
\u6548\u679c\u5982\u4e0b\uff1a
\u6700\u540e\uff0c\u8d34\u4e0a\u5b8c\u6574\u4ee3\u7801\uff1a
\u53ef\u5728examples/\u76ee\u5f55\u4e0b\u627e\u5230\u4ee5\u4e0b\u4ee3\u7801\u53ca\u76f8\u5173\u7684.ui
\u6587\u4ef6\u3002
import dataclasses\nfrom datetime import date\nfrom typing import Optional, Tuple\n\nfrom qtpy.QtWidgets import QWidget, QLineEdit, QTextEdit, QDateEdit\nfrom qtpy.uic import loadUi\n\nfrom pyguiadapter.adapter import uinput, GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.extend_types import text_t\nfrom pyguiadapter.utils import IconType\nfrom pyguiadapter.utils.inputdialog import UniversalInputDialog\n\n\n@dataclasses.dataclass\nclass UserInfo:\n username: str\n birthday: date\n address: str\n email: str\n phone: str\n description: str\n\n\nclass UserInfoDialog(UniversalInputDialog):\n\n def __init__(\n self,\n parent: Optional[QWidget],\n title: str = \"\",\n icon: IconType = None,\n size: Tuple[int, int] = (400, 300),\n ok_button_text: str = \"Ok\",\n cancel_button_text: Optional[str] = \"Cancel\",\n initial_user_info: Optional[UserInfo] = None,\n **kwargs\n ):\n self._description_edit: Optional[QTextEdit] = None\n self._phone_edit: Optional[QLineEdit] = None\n self._email_edit: Optional[QLineEdit] = None\n self._address_edit: Optional[QLineEdit] = None\n self._birthday_edit: Optional[QDateEdit] = None\n self._username_edit: Optional[QLineEdit] = None\n self._initial_user_info: Optional[UserInfo] = initial_user_info\n super().__init__(\n parent,\n title=title,\n icon=icon,\n size=size,\n ok_button_text=ok_button_text,\n cancel_button_text=cancel_button_text,\n **kwargs\n )\n\n def get_result(self) -> UserInfo:\n username = self._username_edit.text()\n birthday = self._birthday_edit.date().toPyDate()\n address = self._address_edit.text()\n email = self._email_edit.text()\n phone = self._phone_edit.text()\n description = self._description_edit.toPlainText()\n new_user_info = UserInfo(\n username=username,\n birthday=birthday,\n address=address,\n email=email,\n phone=phone,\n description=description,\n )\n return new_user_info\n\n def create_main_widget(self) -> QWidget:\n ui_file = \"user_info_dialog_main_widget.ui\"\n # create widget from ui file\n main_widget = loadUi(ui_file)\n\n # obtain input widgets for UserInfo fields and set its initial values from initial_user_info\n self._username_edit = main_widget.findChild(QLineEdit, \"username_edit\")\n if self._initial_user_info:\n self._username_edit.setText(self._initial_user_info.username)\n\n self._birthday_edit = main_widget.findChild(QDateEdit, \"birthday_edit\")\n if self._initial_user_info:\n self._birthday_edit.setDate(self._initial_user_info.birthday)\n\n self._address_edit = main_widget.findChild(QLineEdit, \"address_edit\")\n if self._initial_user_info:\n self._address_edit.setText(self._initial_user_info.address)\n\n self._email_edit = main_widget.findChild(QLineEdit, \"email_edit\")\n if self._initial_user_info:\n self._email_edit.setText(self._initial_user_info.email)\n\n self._phone_edit = main_widget.findChild(QLineEdit, \"phone_edit\")\n if self._initial_user_info:\n self._phone_edit.setText(self._initial_user_info.phone)\n\n self._description_edit = main_widget.findChild(QTextEdit, \"description_edit\")\n if self._initial_user_info:\n self._description_edit.setText(self._initial_user_info.description)\n\n return main_widget\n\n\ndef user_info_example(\n initial_username: str = \"\",\n initial_birthday: date = date(1990, 1, 1),\n initial_address: str = \"\",\n initial_email: str = \"\",\n initial_phone: str = \"\",\n initial_description: text_t = \"\",\n):\n user_info = uinput.get_custom_input(\n UserInfoDialog,\n title=\"Get User Info\",\n size=(350, 400),\n ok_button_text=\"Confirm\",\n cancel_button_text=\"Dismiss\",\n initial_user_info=UserInfo(\n username=initial_username,\n birthday=initial_birthday,\n address=initial_address,\n email=initial_email,\n phone=initial_phone,\n description=initial_description,\n ),\n )\n uprint(user_info)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(user_info_example)\n adapter.run()\n
"},{"location":"user-interaction/#toast","title":"\uff08\u56db\uff09Toast\u6d88\u606f","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7pyguiadapter.adapter.utoast\u6a21\u5757\u5c55\u793a\u3001\u6e05\u9664Toast\u6d88\u606f\u3002
Toast\u76f8\u5173\u7684API\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.adapter.utoast
- pyguiadapter.toast
\u4ee5\u4e0b\u793a\u4f8b\u5c55\u793a\u4e86Toast\u6d88\u606f\u7684\u57fa\u672c\u7528\u6cd5\uff1a
from typing import Literal\n\nfrom pyguiadapter.adapter import GUIAdapter, utoast\nfrom pyguiadapter.exceptions import ParameterError\nfrom pyguiadapter.extend_types import text_t, color_hex_t, int_slider_t\nfrom pyguiadapter.toast import ToastConfig, AlignLeft, AlignRight, AlignCenter\n\n\ndef utoast_example(\n message: text_t,\n duration: int = 3000,\n opacity: float = 0.9,\n fade_out: int = 500,\n text_align: Literal[\"left\", \"right\", \"center\"] = \"center\",\n text_padding: int = 50,\n background_color: color_hex_t = \"#323232\",\n text_color: color_hex_t = \"#FFFFFF\",\n font_size: int = 26,\n font_family: str = \"Consolas\",\n position_x: int_slider_t = 50,\n position_y: int_slider_t = 50,\n):\n \"\"\"\n Show a toast message on the screen.\n\n Args:\n message: The message to be displayed.\n duration: The duration of the toast message in milliseconds.\n opacity: The opacity of the toast message.\n fade_out: The duration of the fade out animation in milliseconds.\n text_align: The alignment of the text inside the toast message.\n text_padding: The padding of the text inside the toast message.\n background_color: The background color of the toast message.\n text_color: The text color of the toast message.\n font_size: The font size of the text inside the toast message.\n font_family: The font family of the text inside the toast message.\n position_x: The x position (by percentage) of the toast message on the screen.\n position_y: The y position (by percentage) of the toast message on the screen.\n\n @params\n [opacity]\n min_value = 0.0\n max_value = 1.0\n step = 0.01\n\n [position_x]\n min_value = 0\n max_value = 100\n prefix = \"x: \"\n suffix = \"%\"\n\n [position_y]\n min_value = 0\n max_value = 100\n prefix = \"y: \"\n suffix = \"%\"\n\n [background_color]\n alpha_channel = false\n\n [text_color]\n alpha_channel = false\n\n @end\n\n \"\"\"\n if not message or message.strip() == \"\":\n raise ParameterError(\n parameter_name=\"message\", message=\"Message cannot be empty.\"\n )\n\n if text_align == \"left\":\n align = AlignLeft\n elif text_align == \"right\":\n align = AlignRight\n else:\n align = AlignCenter\n\n position_x = float(position_x) / 100.0\n position_y = float(position_y) / 100.0\n\n toast_config = ToastConfig(\n opacity=opacity,\n background_color=background_color,\n text_color=text_color,\n text_padding=text_padding,\n text_alignment=align,\n font_size=font_size,\n font_family=font_family,\n position=(position_x, position_y),\n fade_out=fade_out,\n )\n utoast.show_toast(message, duration, toast_config)\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(utoast_example)\n adapter.run()\n
\u6548\u679c\u5982\u4e0b\uff1a
"},{"location":"user-interaction/#_4","title":"\uff08\u4e94\uff09\u5176\u5b83","text":"pyguiadapter.adapter.useful \u4e2d\u5305\u542b\u4e86\u5176\u4ed6\u4e00\u4e9b\u53ef\u4ee5\u5728\u7528\u6237\u51fd\u6570\u4e2d\u8c03\u7528\u7684\u5b9e\u7528\u51fd\u6570\u3002
"},{"location":"utility/","title":"\u5b9e\u7528\u51fd\u6570","text":""},{"location":"utility/#_1","title":"\uff08\u4e00\uff09\u6982\u8ff0","text":"PyGUIAdapter
\u63d0\u4f9b\u4e86\u5927\u91cf\u5b9e\u7528\u51fd\u6570\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u7a97\u53e3\u6216Action
\u7684\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u8c03\u7528\u8fd9\u4e9b\u51fd\u6570\uff0c\u8fdb\u4e00\u6b65\u6269\u5c55\u7a0b\u5e8f\u7684\u529f\u80fd\u3002
\u8fd9\u4e9b\u51fd\u6570\u53ef\u4ee5\u5728pyguiadapter.utils
\u5305\u4e0b\u627e\u5230\uff0c\u4e3b\u8981\u5305\u542b\u4ee5\u4e0b\u51e0\u4e2a\u6a21\u5757\uff1a
filedialog
\uff0c\u4e3b\u8981\u63d0\u4f9b\u6587\u4ef6\u9009\u62e9\u5bf9\u8bdd\u6846\u529f\u80fd\u3002 messagebox
\uff0c\u4e3b\u8981\u63d0\u4f9b\u6d88\u606f\u5bf9\u8bdd\u6846\u529f\u80fd\u3002 inputdialog
\uff0c\u4e3b\u8981\u63d0\u4f9b\u8f93\u5165\u5bf9\u8bdd\u6846\u529f\u80fd\u3002 editor
\uff0c\u4e3b\u8981\u63d0\u4f9b\u7ed3\u6784\u5316\u5bf9\u8c61\u7f16\u8f91\u5668\u529f\u80fd\u3002\u5173\u4e8e\u7ed3\u6784\u5316\u5bf9\u8c61\u53ca\u5176\u7f16\u8f91\u5668\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a \u7ed3\u6784\u5316\u5bf9\u8c61\u53ca\u5176\u7f16\u8f91\u5668
"},{"location":"utility/#_2","title":"\uff08\u4e8c\uff09\u4f7f\u7528\u65b9\u6cd5","text":""},{"location":"utility/#1","title":"1\u3001\u5bfc\u5165\u6a21\u5757","text":"\u4ee5filedialog
\u6a21\u5757\u4e3a\u4f8b\uff0c\u5bfc\u5165\u6a21\u5757\u4ee3\u7801\u5982\u4e0b\uff1a
from pyguiadapter.utils import filedialog\n
"},{"location":"utility/#2","title":"2\u3001\u8c03\u7528\u76f8\u5e94\u51fd\u6570","text":"\u6bd4\u5982\uff0c\u9700\u8981\u901a\u8fc7\u6253\u5f00\u6587\u4ef6\u5bf9\u8bdd\u6846\u9009\u62e9\u6587\u4ef6\u8def\u5f84\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u8c03\u7528filedialog.get_open_file()
\u51fd\u6570\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a
file_path = filedialog.get_open_file(window, title=\"\u6253\u5f00\u6587\u4ef6\", filters=\"\u6587\u672c\u6587\u4ef6 (*.txt);;\u6240\u6709\u6587\u4ef6 (*.*)\")\nif not file_path:\n # \u7528\u6237\u53d6\u6d88\u9009\u62e9\u6587\u4ef6\n ...\nelse:\n # \u7528\u6237\u9009\u62e9\u4e86\u6587\u4ef6\uff0c\u53ef\u4ee5\u8fdb\u884c\u540e\u7eed\u64cd\u4f5c\n ...\n
\u5176\u4e2d\uff0cwindow
\u53c2\u6570\u662f\u7a97\u53e3\u5bf9\u8c61\uff0c\u5f00\u53d1\u8005\u5728\u7a97\u53e3\u6216\u8005Action
\u7684\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u53ef\u4ee5\u8bbf\u95ee\u5230\u5f53\u524d\u7684\u7a97\u53e3\u5bf9\u8c61\u3002\u8fd9\u4e5f\u662f\u8fd9\u4e9b\u5b9e\u7528\u51fd\u6570\u7279\u522b\u9002\u5408\u5728\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u4f7f\u7528\u7684\u539f\u56e0\uff1a\u5b9e\u7528\u51fd\u6570\u4e2d\u6709\u5f88\u591a\u90fd\u9700\u8981\u4e00\u4e2a\u7a97\u53e3\u5bf9\u8c61\u4f5c\u4e3a\u53c2\u6570\uff0c\u800c\u5f00\u53d1\u8005\u57fa\u672c\u4e0a\u53ea\u6709\u5728\u5404\u79cd\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u624d\u6709\u673a\u4f1a\u83b7\u53d6\u5230\u5f53\u524d\u7a97\u53e3\u5bf9\u8c61\u3002
"},{"location":"utility/#3","title":"3\u3001\u5728\u7a97\u53e3\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u8c03\u7528\u5b9e\u7528\u51fd\u6570","text":"\u4e0b\u9762\u7684\u793a\u4f8b\u5c55\u793a\u4e86\u5982\u4f55\u5c06\u7a97\u53e3\u4e8b\u4ef6\u56de\u8c03\u4e0e\u5b9e\u7528\u51fd\u6570\u7ed3\u5408\u4f7f\u7528\uff0c\u6211\u4eec\u5c06\u5b9e\u73b0\u4e00\u4e2a\u7b80\u5355\u7684\u529f\u80fd\uff0c\u5728\u7a97\u53e3\u5173\u95ed\u65f6\u5f39\u51fa\u786e\u8ba4\u5bf9\u8bdd\u6846\uff0c\u7528\u6237\u786e\u8ba4\u540e\u518d\u5173\u95ed\u7a97\u53e3\u3002
\u57fa\u672c\u601d\u8def\u662f\uff1a\u5728\u7a97\u53e3\u7684on_close
\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u8c03\u7528messagebox
\u6a21\u5757\u7684show_question_message()
\u51fd\u6570\uff0c\u5e76\u6839\u636e\u7528\u6237\u7684\u9009\u62e9\u51b3\u5b9a\u662f\u5426\u5173\u95ed\u7a97\u53e3\u3002\u4ee3\u7801\u975e\u5e38\u7b80\u5355\uff0c\u5982\u4e0b\u6240\u793a\uff1a
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.utils import messagebox\nfrom pyguiadapter.window import SimpleWindowEventListener\nfrom pyguiadapter.windows.fnexec import FnExecuteWindow\n\n\ndef foo(arg1: int, arg2: str, arg3: bool):\n pass\n\n\ndef on_close(window: FnExecuteWindow) -> bool:\n ret = messagebox.show_question_message(\n window, message=\"Are you sure you want to quit?\"\n )\n if ret == messagebox.Yes:\n # when `on_close()` returns True, the window will be closed\n return True\n else:\n messagebox.show_info_message(window, message=\"Quit cancelled by user!\")\n # when `on_close()` returns False, the window will not be closed\n # in other words, the close event will be ignored\n return False\n\n\nif __name__ == \"__main__\":\n # create a window listener that listens for the `on_close` event\n event_listener = SimpleWindowEventListener(on_close=on_close)\n\n adapter = GUIAdapter()\n # add the `foo` function to the adapter with the `window_listener` argument set to the event_listener\n adapter.add(foo, window_listener=event_listener)\n adapter.run()\n
"},{"location":"utility/#4action","title":"4\u3001\u5728Action
\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u8c03\u7528\u5b9e\u7528\u51fd\u6570","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u63d0\u4f9b\u4ee5\u4e0b\u65b9\u5f0f\u5728Action
\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u8c03\u7528\u5b9e\u7528\u51fd\u6570\uff1a
def on_action_open(window: FnExecuteWindow, _: Action):\n ret = filedialog.get_open_file(\n window,\n title=\"Open File\",\n start_dir=\"./\",\n filters=\"JSON files(*.json);;Python files(*.py);;All files(*.*)\",\n )\n if not ret:\n return\n messagebox.show_info_message(window, f\"File will be opened: {ret}\")\n
\u5b8c\u6574\u7684\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a
from pyguiadapter.action import Action, Separator\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.menu import Menu\nfrom pyguiadapter.toolbar import ToolBar\nfrom pyguiadapter.windows.fnexec import FnExecuteWindow\nfrom pyguiadapter.utils import messagebox, filedialog\n\n\ndef on_action_about(window: FnExecuteWindow, _: Action):\n messagebox.show_info_message(\n parent=window,\n message=\"This is an example of toolbar and menu with custom actions.\",\n title=\"About\",\n )\n\n\ndef on_action_close(window: FnExecuteWindow, _: Action):\n ret = messagebox.show_question_message(\n window, \"Are you sure you want to quit?\", buttons=messagebox.Yes | messagebox.No\n )\n if ret == messagebox.Yes:\n window.close()\n\n\ndef on_action_open(window: FnExecuteWindow, _: Action):\n ret = filedialog.get_open_file(\n window,\n title=\"Open File\",\n start_dir=\"./\",\n filters=\"JSON files(*.json);;Python files(*.py);;All files(*.*)\",\n )\n if not ret:\n return\n messagebox.show_info_message(window, f\"File will be opened: {ret}\")\n\n\ndef on_action_save(window: FnExecuteWindow, _: Action):\n ret = filedialog.get_save_file(\n window,\n title=\"Save File\",\n start_dir=\"./\",\n filters=\"JSON files(*.json);;All files(*.*)\",\n )\n if not ret:\n return\n messagebox.show_info_message(window, f\"File will be saved: {ret}\")\n\n\ndef on_action_auto_theme(window: FnExecuteWindow, _: Action, checked: bool):\n if checked:\n messagebox.show_info_message(window, \"Auto theme is selected.\")\n\n\ndef on_action_light_theme(window: FnExecuteWindow, _: Action, checked: bool):\n if checked:\n messagebox.show_info_message(window, \"Light theme is selected.\")\n\n\ndef on_action_dark_theme(window: FnExecuteWindow, _: Action, checked: bool):\n if checked:\n messagebox.show_info_message(window, \"Dark theme is selected.\")\n\n\naction_about = Action(\n text=\"About\",\n icon=\"fa.info-circle\",\n on_triggered=on_action_about,\n)\n\naction_open = Action(\n text=\"Open\",\n icon=\"fa.folder-open\",\n shortcut=\"Ctrl+O\",\n on_triggered=on_action_open,\n)\n\naction_save = Action(\n text=\"Save\",\n icon=\"fa.save\",\n shortcut=\"Ctrl+S\",\n on_triggered=on_action_save,\n)\n\naction_close = Action(\n text=\"Quit\",\n icon=\"fa.close\",\n shortcut=\"Ctrl+Q\",\n on_triggered=on_action_close,\n)\n\naction_auto_them = Action(\n text=\"Auto\",\n checkable=True,\n checked=True,\n on_toggled=on_action_auto_theme,\n)\n\naction_light_theme = Action(\n text=\"Light\",\n checkable=True,\n on_toggled=on_action_light_theme,\n)\n\naction_dark_theme = Action(\n text=\"Dark\",\n checkable=True,\n on_toggled=on_action_dark_theme,\n)\n\nsubmenu_theme = Menu(\n title=\"Theme\",\n actions=[action_auto_them, action_light_theme, action_dark_theme],\n exclusive=True,\n)\nmenu_file = Menu(\n title=\"File\",\n actions=[\n action_open,\n action_save,\n Separator(),\n action_close,\n Separator(),\n submenu_theme,\n ],\n)\nmenu_help = Menu(\n title=\"Help\",\n actions=[action_about],\n)\n\n\ndef menu_toolbar_example(arg1: int, arg2: str, arg3: bool):\n \"\"\"\n This example shows how to add and config toolbar and menus to the window.\n @param arg1:\n @param arg2:\n @param arg3:\n @return:\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n menu_toolbar_example,\n window_menus=[menu_file, menu_help],\n window_toolbar=ToolBar(\n actions=[action_open, action_save, Separator(), action_close]\n ),\n )\n adapter.run()\n
\u4e0a\u8ff0\u4ee3\u7801\u8fd0\u884c\u7ed3\u679c\u5982\u4e0b\uff1a
"},{"location":"widget-config/","title":"\u914d\u7f6e\u63a7\u4ef6\u5c5e\u6027","text":""},{"location":"widget-config/#_1","title":"\u4e00\u3001\u4ec0\u4e48\u51b3\u5b9a\u4e86\u51fd\u6570\u53c2\u6570\u7684\u63a7\u4ef6\u7c7b\u578b\uff1f","text":""},{"location":"widget-config/#_2","title":"\uff08\u4e00\uff09\u4e00\u822c\u89c4\u5219\uff1a\u51fd\u6570\u53c2\u6570\u7c7b\u578b\u4fe1\u606f","text":"\u4e00\u822c\u800c\u8a00\uff0c\u51fd\u6570\u53c2\u6570\u6240\u5bf9\u5e94\u7684\u8f93\u5165\u63a7\u4ef6\u7531\u8be5\u53c2\u6570\u7684\u6570\u636e\u7c7b\u578b\u51b3\u5b9a\uff0c\u800c\u51fd\u6570\u53c2\u6570\u7684\u7c7b\u578b\u5219\u4e3b\u8981\u7531Python\u7c7b\u578b\u6807\u6ce8\u786e\u5b9a\u3002
def f1(a: str, b: int, c: float):\n pass\n
\u4f8b\u5982\uff0c\u5728\u4e0a\u9762\u7684\u51fd\u6570f1
\u4e2d\uff0c\u53c2\u6570a
\u3001b
\u3001c
\u7684\u7c7b\u578b\u5206\u522b\u88ab\u6807\u6ce8\u4e3astr
\u3001int
\u3001float
\u3002\u5728\u8fd0\u884c\u65f6\uff0cPyGUIAdapter
\u5c06\u8bfb\u53d6\u8fd9\u4e00\u4fe1\u606f\uff0c\u5206\u522b\u4e3aa
\u3001b
\u3001c
\u751f\u6210LineEdit
\u3001IntSpinBox
\u3001FloatSpinBox
\uff0c\u4f5c\u4e3a\u5176\u8f93\u5165\u63a7\u4ef6\u3002
\u5728PyGUIAdapter
\u5185\u90e8\uff0c\u5b9e\u73b0\u4e86\u4e00\u5957\u6620\u5c04\u673a\u5236\uff0c\u53ef\u4ee5\u5c06\u7279\u5b9a\u7684\u6570\u636e\u7c7b\u578b\u4e0e\u7279\u5b9a\u7684\u63a7\u4ef6\u7c7b\u578b\u5173\u8054\u8d77\u6765\uff0c\u5728\u5224\u65ad\u5e94\u5f53\u4e3a\u67d0\u4e2a\u51fd\u6570\u53c2\u6570\u751f\u6210\u4f55\u79cd\u7c7b\u578b\u7684\u63a7\u4ef6\u65f6\uff0c\u53ea\u9700\u6309\u56fe\u7d22\u9aa5\u5373\u53ef\u3002\u56e0\u6b64\uff0c\u6b63\u786e\u5730\u4e3a\u51fd\u6570\u7684\u53c2\u6570\u6807\u6ce8\u6570\u636e\u7c7b\u578b\u81f3\u5173\u91cd\u8981\uff0c\u5bf9\u4e8ePyGUIAdapter
\u800c\u8a00\uff0c\u51fd\u6570\u53c2\u6570\u7684\u7c7b\u578b\u6807\u6ce8\u4e0d\u662f\u90a3\u79cd\u53ef\u6709\u53ef\u3001\u65e0\u9526\u4e0a\u6dfb\u82b1\u7684\u4e1c\u897f\uff01
PyGUIAdapter
\u9664\u4e86\u4ece\u51fd\u6570\u53c2\u6570\u7684\u7c7b\u578b\u6ce8\u89e3\u4e2d\u83b7\u53d6\u53c2\u6570\u7684\u6570\u636e\u7c7b\u578b\u4fe1\u606f\uff0c\u5b83\u8fd8\u5b9e\u73b0\u4e86\u4e00\u4e9b\u201c\u7c7b\u578b\u63a8\u65ad\u201d
\u673a\u5236\u3002\u6bd4\u5982\uff0c\u53ef\u4ee5\u4ece\u51fd\u6570\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u63a8\u65ad\u51fa\u5176\u7c7b\u578b\u3002
def f2(a=10, b=0.5, c=\"hello\", e=True, f=(1, 2, 3)):\n pass\n
\u6216\u8005\uff0c\u53ef\u4ee5\u901a\u8fc7\u6587\u6863\u5b57\u7b26\u4e32(docstring
)\u4e2d\u53c2\u6570\u7684\u63cf\u8ff0\u63a8\u65ad\u5176\u7c7b\u578b\u3002\u6bd4\u5982\u5728\u4e0b\u9762\u7684\u4ee3\u7801\u7247\u6bb5\u4e2d\uff0c\u4f7f\u7528\u6587\u6863\u5b57\u7b26\u4e32\u4e2d\u63cf\u8ff0\u4e86\u51fd\u6570f3()
\u5404\u4e2a\u53c2\u6570\u7684\u7c7b\u578b\u4fe1\u606f\uff1a
def f3(a, b, c):\n \"\"\"\n \u8fd9\u662f\u4e00\u4e2a\u793a\u4f8b\u51fd\u6570.\n\n Args:\n a (int): \u53c2\u6570a\u7684\u63cf\u8ff0.\n b (str): \u53c2\u6570b\u7684\u63cf\u8ff0.\n c (list): \u53c2\u6570c\u7684\u63cf\u8ff0.\n\n Returns:\n bool: \u51fd\u6570\u8fd4\u56de\u7684\u7ed3\u679c\u63cf\u8ff0.\n \"\"\"\n pass\n
\u4f46\u662f\uff0c\u5fc5\u987b\u8981\u6307\u51fa\u7684\u662f\uff0c\u6240\u8c13\u7684\u201c\u7c7b\u578b\u63a8\u65ad\u201d
\u673a\u5236\u4ec5\u4ec5\u662f\u4e00\u79cd\u8f85\u52a9\u7684\u624b\u6bb5\uff0c\u5e76\u4e0d\u603b\u662f\u51c6\u786e\uff0c\u4e5f\u4e0d\u4fdd\u8bc1\u53ef\u9760\uff0c\u901a\u8fc7\u7c7b\u578b\u6807\u6ce8\u8bed\u6cd5\u51c6\u786e\u3001\u60c5\u5f62\u3001\u65e0\u6b67\u4e49\u5730\u6307\u660e\u51fd\u6570\u53c2\u6570\u7684\u7c7b\u578b\uff0c\u6c38\u8fdc\u662f\u66f4\u4f18\u7684\u9009\u62e9\u3002
PyGUIAdapter
\u5df2\u7ecf\u4e3aPython\u4e2d\u5e38\u7528\u6570\u636e\u7c7b\u578b\u5b9e\u73b0\u4e86\u5bf9\u5e94\u7684\u8f93\u5165\u63a7\u4ef6\uff0c\u80fd\u591f\u8986\u76d6\u7edd\u5927\u591a\u6570\u9700\u6c42\u3002\u56e0\u6b64\uff0c\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u5f00\u53d1\u8005\u7684\u4e3b\u8981\u5de5\u4f5c\u5c31\u662f\u6b63\u786e\u5730\u6807\u6ce8\u51fd\u6570\u5404\u4e2a\u53c2\u6570\u7684\u7c7b\u578b\uff0c\u8fd9\u662f\u8bb8\u591aPython\u7a0b\u5e8f\u5458\u5df2\u7ecf\u4e60\u60ef\u7684\u505a\u6cd5\u3002
\u5173\u4e8ePyGUIAdapter
\u652f\u6301\u7684\u6570\u636e\u7c7b\u578b\u53ca\u5176\u6240\u5bf9\u5e94\u7684\u63a7\u4ef6\uff0c\u53ef\u4ee5\u53c2\u8003\uff1a\u63a7\u4ef6\u4e0e\u53c2\u6570\u6570\u636e\u7c7b\u578b\u3002\u3002
\u5f53\u7136\uff0c\u5982\u679c\u5f00\u53d1\u8005\u9700\u8981\u5c06\u67d0\u4e2a\u590d\u6742\u7684\u81ea\u5b9a\u4e49\u6570\u636e\u7c7b\u578b\u4f5c\u4e3a\u53c2\u6570\uff0c\u800c\u5185\u7f6e\u7684\u63a7\u4ef6\u53c8\u65e0\u6cd5\u6ee1\u8db3\u9700\u6c42\uff0c\u90a3\u4e48PyGUIAdapter
\u4e5f\u63d0\u4f9b\u4e86\u81ea\u5b9a\u4e49\u63a7\u4ef6
\u63a5\u53e3\uff0c\u5e76\u4e14\u5141\u8bb8\u5f00\u53d1\u8005\u5728\u81ea\u5b9a\u4e49\u6570\u636e\u7c7b\u578b\u4e0e\u81ea\u5b9a\u4e49\u63a7\u4ef6\u4e4b\u95f4\u5efa\u7acb\u6620\u5c04\u5173\u7cfb\uff0c\u8fd9\u610f\u5473\u7740\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u50cf\u4f7f\u7528\u5185\u7f6e\u63a7\u4ef6\u4e00\u6837\u4f7f\u7528\u81ea\u5b9a\u4e49\u63a7\u4ef6\u3002
\u5173\u4e8e\u5982\u4f55\u5b9e\u73b0\u81ea\u5b9a\u4e49\u63a7\u4ef6\uff0c\u53ef\u4ee5\u53c2\u8003\uff1a\u8fd9\u7bc7\u6587\u6863\u3002
"},{"location":"widget-config/#_3","title":"\uff08\u4e8c\uff09\u4f8b\u5916\u89c4\u5219\uff1a\u624b\u52a8\u6307\u5b9a\u53c2\u6570\u7684\u63a7\u4ef6\u7c7b\u578b","text":"\u867d\u7136PyGUIAdapter
\u63a8\u8350\u5f00\u53d1\u8005\u4f7f\u7528\u7c7b\u578b\u6ce8\u89e3\u6765\u786e\u5b9a\u51fd\u6570\u53c2\u6570\u7684\u63a7\u4ef6\u7c7b\u578b\uff0c\u4f46\u5e76\u4e0d\u5f3a\u5236\u8fd9\u4e48\u505a\u3002PyGUIAdapter
\u63d0\u4f9b\u4e86\u624b\u52a8\u6307\u5b9a\u51fd\u6570\u53c2\u6570\u63a7\u4ef6\u7c7b\u578b\u7684\u65b9\u6cd5\u3002\u5176\u4e2d\uff0c\u6700\u7b80\u5355\u7684\u4e00\u79cd\u65b9\u6cd5\u662f\u5728\u8c03\u7528GUIAdapter.add()
\u51fd\u6570\u65f6\uff0c\u901a\u8fc7widget_configs
\u53c2\u6570\u6307\u5b9a\u53c2\u6570\u7684\u63a7\u4ef6\u914d\u7f6e\u7c7b
\u3002
\u6bcf\u79cd\u7c7b\u578b\u7684\u63a7\u4ef6\u90fd\u6709\u4e00\u4e2a\u4e0e\u4e4b\u5173\u8054\u7684\u63a7\u4ef6\u914d\u7f6e\u7c7b
\uff0c\u63a7\u4ef6\u914d\u7f6e\u7c7b\u4e2d\u4e0d\u4ec5\u5b9a\u4e49\u4e86\u63a7\u4ef6\u7c7b\u7684\u5c5e\u6027\uff0c\u800c\u4e14\u5305\u542b\u63a7\u4ef6\u7c7b\u672c\u8eab\u7684\u4fe1\u606f\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u901a\u8fc7\u63a7\u4ef6\u914d\u7f6e\u7c7b
\u53ef\u4ee5\u83b7\u53d6\u5176\u5173\u8054\u7684\u63a7\u4ef6\u7c7b\uff08\u5f53\u7136\u53cd\u8fc7\u6765\u4e5f\u6210\u7acb\uff0c\u901a\u8fc7\u63a7\u4ef6\u7c7b\u6211\u4eec\u4e5f\u53ef\u4ee5\u8bbf\u95ee\u5230\u5176\u5173\u8054\u7684\u914d\u7f6e\u7c7b\uff09\u3002
\u4f8b\u5982\uff0cIntSpinBox
\u63a7\u4ef6\u7c7b\u4e0e\u5176\u914d\u7f6e\u7c7bIntSpinBoxConfig
\u7684\u5173\u7cfb\u5982\u4e0b\uff1a
IntSpinBox.ConfigClass
== IntSpinBoxConfig
IntSpinBoxConfig.target_widget_class()
== IntSpinBox
\u8fd9\u610f\u5473\u7740\uff0c\u5f53\u5f00\u53d1\u8005\u6307\u5b9a\u4e86\u67d0\u4e2a\u53c2\u6570\u7684\u63a7\u4ef6\u914d\u7f6e\u7c7b\u5bf9\u8c61
\uff0c\u90a3\u4e48\u4ed6\u5b9e\u9645\u4e0a\u4e5f\u5c31\u540c\u65f6\u6307\u5b9a\u4e86\u8be5\u53c2\u6570\u6240\u4f7f\u7528\u7684\u63a7\u4ef6\u7684\u7c7b\u578b\u3002
\u6bd4\u5982\uff0c\u5728\u4e0b\u9762\u7684\u4f8b\u5b50\u4e2d\uff0c\u51fd\u6570foo()
\u7684\u53c2\u6570a
\u3001b
\u3001c
\u867d\u7136\u6ca1\u6709\u901a\u8fc7\u7c7b\u578b\u6ce8\u89e3\u8bed\u6cd5\u6807\u6ce8\u7c7b\u578b\u4fe1\u606f\uff0c\u4f46\u7531\u4e8e\u5206\u522b\u4e3a\u5b83\u4eec\u6307\u5b9a\u4e86\u914d\u7f6e\u7c7b\u5bf9\u8c61\uff1aIntSpinBoxConfig
\u3001FloatSpinBoxConfig
\u3001BoolBoxConfig
\uff0c\u8fd9\u4f7f\u5f97PyGUIAdapter
\u4e5f\u80fd\u591f\u4e3a\u5176\u521b\u5efa\u5bf9\u5e94\u7684\u63a7\u4ef6\u2014\u2014\u53c2\u6570a
\u3001b
\u3001c
\u5c06\u5206\u522b\u4f7f\u7528IntSpinBox
\u3001FloatSpinBox
\u3001BoolBox
\u4f5c\u4e3a\u5176\u63a7\u4ef6\u3002
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.widgets import IntSpinBoxConfig, FloatSpinBoxConfig, BoolBoxConfig\n\n\ndef foo(a, b, c):\n pass\n\n\nconfigs = {\n \"a\": IntSpinBoxConfig(),\n \"b\": FloatSpinBoxConfig(),\n \"c\": BoolBoxConfig(),\n}\n\nadapter = GUIAdapter()\nadapter.add(foo, widget_configs=configs)\nadapter.run()\n
\u9664\u4e86\u5728\u4ee3\u7801\u91cc\u6307\u5b9a\u53c2\u6570\u7684\u63a7\u4ef6\u914d\u7f6e\uff0c\u4e5f\u53ef\u4ee5\u5229\u7528PyGUIAdapter
\u63d0\u4f9b\u4e86\u53e6\u4e00\u4e2a\u673a\u5236\u505a\u5230\u8fd9\u4e00\u70b9\uff1aPyGUIAdapter
\u5c06\u51fd\u6570\u6587\u6863\u5b57\u7b26\u4e32\uff08docstring\uff09\u4e2d@params
\u6807\u8bb0\u4e0e@end
\u6807\u8bb0\u4e4b\u95f4\u7684\u6587\u672c\u5757\u89c6\u4e3a\u8be5\u51fd\u6570\u7684\u63a7\u4ef6\u914d\u7f6e\u533a\uff0c\u5728\u8be5\u533a\u57df\u4e2d\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528TOML\u8bed\u6cd5\u914d\u7f6e\u51fd\u6570\u53c2\u6570\u7684\u63a7\u4ef6\u7c7b\u578b\u53ca\u5176\u5c5e\u6027\u3002
from pyguiadapter.adapter import GUIAdapter\n\ndef bar(a, b, c):\n \"\"\"\n bar\n @param a:\n @param b:\n @param c:\n @return:\n\n @params\n [a]\n widget_class = \"IntSpinBox\"\n\n [b]\n widget_class = \"FloatSpinBox\"\n\n [c]\n widget_class = \"BoolBox\"\n\n @end\n \"\"\"\n pass\n\nadapter = GUIAdapter()\nadapter.add(bar)\nadapter.run()\n
\u5982\u679c\u5f00\u53d1\u8005\u5728@params-@end
\u4e2d\u914d\u7f6e\u4e86\u53c2\u6570\u7684\u63a7\u4ef6\uff0c\u540c\u65f6\u53c8\u5411GUIAdapter.run()
\u4f20\u5165\u4e86widget_configs
\uff0c\u90a3\u4e48PyGUIAdapter
\u4f1a\u5c06\u4e24\u5904\u914d\u7f6e\u5408\u5e76\uff0c\u5bf9\u4e8e\u53d1\u751f\u51b2\u7a81\u7684\u5c5e\u6027\uff0c\u5c06\u4ee5widget_configs
\u4e2d\u8bbe\u7f6e\u7684\u4e3a\u51c6\u3002
"},{"location":"widget-config/#_4","title":"\u4e8c\u3001\u914d\u7f6e\u7684\u63a7\u4ef6\u5c5e\u6027","text":"\u63a7\u4ef6\u5c5e\u6027\u63a7\u5236\u7740\u63a7\u4ef6\u7684\u5916\u89c2\u548c\u884c\u4e3a\uff0c\u4e0d\u540c\u7c7b\u578b\u7684\u63a7\u4ef6\u65e2\u5171\u4eab\u90e8\u5206\u5171\u6709\u7684\u5c5e\u6027\uff0c\u4e5f\u62e5\u6709\u5404\u81ea\u4e13\u5c5e\u7684\u5c5e\u6027\u3002
\u4f8b\u5982\uff1a
- \u6240\u6709\u7c7b\u578b\u7684\u63a7\u4ef6
default_value
\u3001label
\u3001description
\u3001default_value_description
\u3001group
\u3001stylesheet
\u7b49\u5c5e\u6027\uff1b
IntSpinBox
\u989d\u5916\u5b9a\u4e49\u4e86min_value
\u3001display_integer_base
\u7b49\u5c5e\u6027\uff1b BoolBox
\u989d\u5916\u5b9a\u4e49\u4e86true_text
\u3001false_text
\u7b49\u5c5e\u6027\uff1b LineEdit
\u989d\u5916\u5177\u6709echo_mode
\u3001placeholder
\u7b49\u5c5e\u6027\uff1b - ......
\u63a7\u4ef6\u7684\u5c5e\u6027\u5b9a\u4e49\u5728\u63a7\u4ef6\u5bf9\u5e94\u7684\u914d\u7f6e\u7c7b\u4e2d\uff0c\u5176\u4e2d\uff0c\u516c\u5171\u5c5e\u6027\u6765\u81ea\u5171\u540c\u7684\u7236\u7c7b\uff08\u57fa\u7c7b\uff09BaseParameterWidgetConfig
\uff0c\u800c\u72ec\u6709\u5c5e\u6027\u5219\u5728\u5404\u914d\u7f6e\u7c7b\u5b50\u7c7b\u4e2d\u5b9a\u4e49\u3002
\u5bf9\u63a7\u4ef6\u5c5e\u6027\u8fdb\u884c\u914d\u7f6e\uff0c\u53ef\u4ee5\u5b9e\u73b0\u66f4\u52a0\u7cbe\u7ec6\u5316\u7684\u63a7\u5236\uff0c\u6bd4\u5982\uff1a\u8bbe\u7f6e\u6570\u5b57\u8f93\u5165\u7684\u4e0a\u4e0b\u9650\uff0c\u8bbe\u7f6e\u6587\u672c\u6846\u7684\u8f93\u5165\u63a9\u7801\u7b49\u7b49\u3002\u5f88\u591a\u65f6\u5019\uff0c\u5408\u9002\u7684\u914d\u7f6e\u4e0d\u4ec5\u53ef\u4ee5\u63d0\u9ad8\u7528\u6237\u4f53\u9a8c\uff0c\u8fd8\u53ef\u4ee5\u589e\u5f3a\u7a0b\u5e8f\u7684\u5065\u58ee\u6027\u3002
\u4e3a\u4ec0\u4e48\u5408\u7406\u914d\u7f6e\u63a7\u4ef6\u5c5e\u6027\u80fd\u589e\u5f3a\u7a0b\u5e8f\u7684\u5065\u58ee\u6027\uff1f
\u5176\u5b9e\u5f88\u597d\u7406\u89e3\uff0c\u5982\u679c\u80fd\u591f\u63d0\u524d\u5c06\u7528\u6237\u7684\u8f93\u5165\u503c\u9650\u5b9a\u5728\u67d0\u4e2a\u7279\u5b9a\u7684\u8303\u56f4\u5185\uff0c\u5c31\u53ef\u4ee5\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u907f\u514d\u51fa\u73b0\u90a3\u4e2a\u8457\u540d\u7684\u7a0b\u5e8f\u5458\u7b11\u8bdd\u91cc\u7684\u573a\u666f\uff1a\u201c\u4e00\u4e2a\u987e\u5ba2\u8d70\u8fdb\u4e00\u95f4\u9152\u5427\uff0c\u4e00\u5207\u90fd\u8fd0\u884c\u6b63\u5e38\uff0c\u76f4\u5230\u4ed6\u70b9\u4e86\u4e00\u4efd\u7092\u996d......\u201d\u3002
\u5728\u672c\u6587\u7684\u7b2c\u4e00\u90e8\u5206\u5176\u5b9e\u5df2\u7ecf\u6f14\u793a\u8fc7\u914d\u7f6e\u53c2\u6570\u63a7\u4ef6\u5c5e\u6027\u7684\u65b9\u6cd5\uff0c\u53ea\u4e0d\u8fc7\u5f53\u65f6\u8ba8\u8bba\u7684\u91cd\u5fc3\u662f\u5982\u4f55\u624b\u52a8\u6307\u5b9a\u53c2\u6570\u63a7\u4ef6\u7684\u7c7b\u578b\u3002\u4e0b\u9762\uff0c\u8ba9\u6211\u4eec\u805a\u7126\u53c2\u6570\u63a7\u4ef6\u5c5e\u6027\u7684\u914d\u7f6e\u3002
"},{"location":"widget-config/#_5","title":"\uff08\u4e00\uff09\u4f7f\u7528\u914d\u7f6e\u7c7b\u5bf9\u8c61\u914d\u7f6e\u63a7\u4ef6\u5c5e\u6027","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7\u5411GUIAdapter.run()
\u51fd\u6570\u4f20\u5165widget_configs
\u6765\u5b9e\u73b0\u63a7\u4ef6\u5c5e\u6027\u7684\u914d\u7f6e\u3002
"},{"location":"widget-config/#1","title":"1\u3001\u4f7f\u7528\u914d\u7f6e\u7c7b\u5bf9\u8c61","text":"\u5b9e\u9645\u4e0a\uff0c\u4f20\u5165\u914d\u7f6e\u7c7b\u5bf9\u8c61\u7684\u540c\u65f6\u4e5f\u6307\u5b9a\u4e86\u53c2\u6570\u63a7\u4ef6\u7684\u7c7b\u578b\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u53c2\u6570\u7684\u63a7\u4ef6\u5c06\u4e0d\u518d\u7531\u5176\u7c7b\u578b\u6ce8\u89e3\u51b3\u5b9a\u3002\u56e0\u6b64\uff0c\u5f00\u53d1\u8005\u5e94\u5f53\u6ce8\u610f\u907f\u514d\u51fd\u6570\u53c2\u6570\u7684\u7c7b\u578b\u6ce8\u89e3\u4e0e\u5176\u914d\u7f6e\u7c7b\u5bf9\u8c61\u4e0d\u517c\u5bb9\u7684\u60c5\u51b5\uff08\u8fd9\u79cd\u4e0d\u517c\u5bb9\u4e3b\u8981\u662f\u6307\u8bed\u4e49\u4e0a\u7684\u4e0d\u517c\u5bb9\uff0c\u6bd4\u5982\uff1a\u4e3a\u7c7b\u578b\u6807\u6ce8\u4e3aint
\u7684\u53c2\u6570\u6307\u5b9a\u4e00\u4e2aLineEditConfig
\u7c7b\u578b\u7684\u5bf9\u8c61\uff0c\u8fd9\u4f1a\u628a\u8be5\u53c2\u6570\u7684\u63a7\u4ef6\u53d8\u6210\u4e00\u4e2a\u8f93\u5165str
\u7684\u5355\u884c\u6587\u672c\u8f93\u5165\u6846\uff09\u3002
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.widgets import (\n IntSpinBoxConfig,\n SliderConfig,\n TextEditConfig,\n)\n\n\ndef foo(a: int, b: int, c: str = \"hello world!\"):\n pass\n\n\nfoo_configs = {\n \"a\": IntSpinBoxConfig(\n default_value=1,\n min_value=0,\n max_value=10,\n step=1,\n label=\"a\",\n description=\"parameter a\",\n ),\n \"b\": SliderConfig(\n default_value=50,\n min_value=0,\n max_value=100,\n label=\"b\",\n description=\"parameter b\",\n ),\n \"c\": TextEditConfig(\n default_value=\"Hello PyGUIAdapter!\",\n label=\"c\",\n description=\"parameter c\",\n ),\n }\n\nadapter = GUIAdapter()\nadapter.add(foo, widget_configs=foo_configs)\nadapter.run()\n
"},{"location":"widget-config/#2","title":"2\u3001\u4f7f\u7528\u914d\u7f6e\u9879\u5b57\u5178","text":"\u4f7f\u7528\u914d\u7f6e\u9879\u5b57\u5178\u4e0e\u4e0a\u4e00\u79cd\u65b9\u6cd5\u672c\u8d28\u4e0a\u662f\u7b49\u4ef7\u7684\uff0c\u53ea\u4e0d\u8fc7\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0cPyGUIAdapter
\u4f1a\u9996\u5148\u786e\u5b9a\u53c2\u6570\u63a7\u4ef6\u7684\u7c7b\u578b\uff08\u901a\u8fc7\u53c2\u6570\u7684\u7c7b\u578b\u6ce8\u89e3\uff09\uff0c\u7136\u540e\u83b7\u53d6\u5bf9\u5e94\u7684\u914d\u7f6e\u7c7b\uff0c\u6700\u540e\u7528\u914d\u7f6e\u9879\u5b57\u5178\u5b9e\u4f8b\u5316\u8be5\u914d\u7f6e\u7c7b\u5f97\u5230\u914d\u7f6e\u7c7b\u7684\u5bf9\u8c61\u3002
from pyguiadapter.adapter import GUIAdapter\n\ndef foo2(a: int, b: int, c: str = \"hello world!\"):\n pass\n\nfoo2_configs = {\n \"a\": {\n \"default_value\": 1,\n \"min_value\": 0,\n \"max_value\": 10,\n \"step\": 1,\n \"label\": \"a\",\n \"description\": \"parameter a\",\n },\n \"b\": {\n \"default_value\": 50,\n \"min_value\": 0,\n \"max_value\": 100,\n \"label\": \"b\",\n \"description\": \"parameter b\",\n },\n \"c\": {\n \"default_value\": \"Hello PyGUIAdapter!\",\n \"label\": \"c\",\n \"description\": \"parameter c\",\n },\n}\n\n\nadapter = GUIAdapter()\nadapter.add(foo2, widget_configs=foo2_configs)\nadapter.run()\n
"},{"location":"widget-config/#params-end","title":"\uff08\u4e8c\uff09\u5728@params-@end
\u5757\u4e2d\u914d\u7f6e\u63a7\u4ef6\u5c5e\u6027","text":"\u524d\u6587\u63d0\u8fc7\uff0cPyGUIAdapter
\u5c06\u51fd\u6570\u6587\u6863\u5b57\u7b26\u4e32\uff08docstring\uff09\u4e2d@params
\u6807\u8bb0\u4e0e@end
\u6807\u8bb0\u4e4b\u95f4\u7684\u6587\u672c\u5757\u89c6\u4e3a\u8be5\u51fd\u6570\u7684\u63a7\u4ef6\u914d\u7f6e\u533a\uff0c\u5728\u8be5\u533a\u57df\u4e2d\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528TOML\u8bed\u6cd5\u914d\u7f6e\u8be5\u51fd\u6570\u7684\u53c2\u6570\u63a7\u4ef6\u7c7b\u578b\u53ca\u5176\u5c5e\u6027\u3002
\u5f00\u53d1\u8005\u53ef\u4ee5\u5728@params-@end
\u5757\u4e2d\u540c\u65f6\u6307\u5b9a\u53c2\u6570\u7684\u63a7\u4ef6\u7c7b\u578b\u53ca\u5176\u5c5e\u6027\uff1a
from pyguiadapter.adapter import GUIAdapter\n\n\ndef foo(a: int, b: int, c: str = \"hello world!\"):\n \"\"\"\n foo\n @params\n [a]\n widget_class=\"IntSpinBox\"\n default_value=1\n min_value=0\n max_value=10\n step=1\n label=\"a\"\n description=\"parameter a\"\n\n [b]\n widget_class=\"Slider\"\n default_value=50\n min_value=0\n max_value=100\n label=\"b\"\n description=\"parameter b\"\n\n [c]\n widget_class=\"TextEdit\"\n default_value=\"Hello PyGUIAdapter!\"\n label=\"c\"\n description=\"parameter c\"\n @end\n \"\"\"\n\n\nadapter = GUIAdapter()\nadapter.add(foo)\nadapter.run()\n
\u4e5f\u53ef\u4ee5\u4ec5\u6307\u5b9a\u63a7\u4ef6\u7684\u5c5e\u6027\uff0c\u5c06\u63a7\u4ef6\u7684\u7c7b\u578b\u4ea4\u7531\u7c7b\u578b\u6ce8\u89e3\u51b3\u5b9a\uff1a
from pyguiadapter.adapter import GUIAdapter\n\ndef foo(a: int, b: int, c: str = \"hello world!\"):\n \"\"\"\n @params\n [a]\n default_value=1\n min_value=0\n max_value=10\n step=1\n label=\"a\"\n description=\"parameter a\"\n\n [b]\n default_value=50\n min_value=0\n max_value=100\n label=\"b\"\n description=\"parameter b\"\n\n [c]\n default_value=\"Hello PyGUIAdapter!\"\n label=\"c\"\n description=\"parameter c\"\n @end\n \"\"\"\n\n\nadapter = GUIAdapter()\nadapter.add(foo)\nadapter.run()\n
"},{"location":"widget-config/#_6","title":"\uff08\u4e09\uff09\u7279\u6b8a\u63a7\u4ef6\u5c5e\u6027","text":"\u6709\u51e0\u4e2a\u7279\u6b8a\u7684\u63a7\u4ef6\u5c5e\u6027\uff0c\u82e5\u5f00\u53d1\u8005\u672a\u5bf9\u8fd9\u4e9b\u5c5e\u6027\u8fdb\u884c\u914d\u7f6e\uff0cPyGUIAdapter
\u5c06\u5c1d\u8bd5\u4ece\u5176\u4ed6\u5730\u65b9\u83b7\u53d6\u5408\u9002\u7684\u503c\u3002
"},{"location":"widget-config/#1label","title":"1\u3001label","text":"\u5982\u679c\u5f00\u53d1\u8005\u672a\u6307\u5b9a\u63a7\u4ef6\u7684label
\uff0c\u5219PyGUIAdapter
\u5c06\u4f7f\u7528\u53c2\u6570\u7684\u540d\u79f0\u4f5c\u4e3a\u5176label
\u3002
from pyguiadapter.adapter import GUIAdapter\n\n\ndef foo(a: int, b: int):\n \"\"\"\n @params\n [b]\n label = \"Parameter b\"\n @end\n \"\"\"\n pass\n\nadapter = GUIAdapter()\nadapter.add(foo)\nadapter.run()\n
"},{"location":"widget-config/#2default_value","title":"2\u3001default_value","text":"\u5982\u679c\u5f00\u53d1\u8005\u672a\u6307\u5b9a\u63a7\u4ef6\u7684default_value
\u5c5e\u6027\uff0c\u90a3\u4e48PyGUIAdapter
\u5c06\u5c1d\u8bd5\u4ece\u51fd\u6570\u7b7e\u540d\u4e2d\u83b7\u53d6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u4f5c\u4e3adefault_value
\u5c5e\u6027\u7684\u503c
from pyguiadapter.adapter import GUIAdapter\n\n\ndef foo(a: int = -100, b: int = 1 + 1):\n pass\n\n\nadapter = GUIAdapter()\nadapter.add(foo)\nadapter.run()\n
"},{"location":"widget-config/#3description","title":"3\u3001description","text":"\u5982\u679c\u5f00\u53d1\u8005\u672a\u6307\u5b9a\u63a7\u4ef6\u7684description
\u5c5e\u6027\uff0c\u90a3\u4e48PyGUIAdapter
\u5c06\u5c1d\u8bd5\u4ece\u51fd\u6570\u7684\u6587\u6863\u5b57\u7b26\u4e32\uff08docstring\uff09\u4e2d\u83b7\u53d6\u53c2\u6570\u7684\u63cf\u8ff0\u4fe1\u606f\u4f5c\u4e3adescription
\u5c5e\u6027\u7684\u503c\u3002
\u652f\u6301\u591a\u79cd\u98ce\u683c\u7684docstring\uff0c\u5305\u62ec\uff1a ReST\u3001Google\u3001Numpydoc-style \u3001Epydoc
from pyguiadapter.adapter import GUIAdapter\n\n\ndef foo(a: int = -100, b: int = 1 + 1):\n \"\"\"\n @param a: this is parameter a\n @param b: this is parameter b\n @return:\n \"\"\"\n\n\nadapter = GUIAdapter()\nadapter.add(foo)\nadapter.run()\n
"},{"location":"widget-config/#_7","title":"\u4e09\u3001\u603b\u7ed3","text":"PyGUIAdapter
\u5185\u7f6e\u4e86\u4e30\u5bcc\u7684\u53c2\u6570\u63a7\u4ef6\uff0c\u5e76\u4e14\u5efa\u7acb\u4e86\u4e00\u79cd\u7b80\u5355\u4ece\u6570\u636e\u7c7b\u578b\u5230\u63a7\u4ef6\u7c7b\u578b\u6620\u5c04\u673a\u5236\u3002\u5f00\u53d1\u8005\u53ea\u9700\u4f7f\u7528\u7c7b\u578b\u6807\u6ce8\u8bed\u6cd5\u4e3a\u51fd\u6570\u53c2\u6570\u6807\u6ce8\u6b63\u786e\u7684\u7c7b\u578b\uff0cPyGUIAdapter
\u5c31\u80fd\u81ea\u52a8\u4e3a\u5176\u751f\u6210\u5408\u9002\u7684\u8f93\u5165\u63a7\u4ef6\u3002
\u4e0e\u6b64\u540c\u65f6\uff0cPyGUIAdapter
\u5145\u5206\u8003\u8651\u5230\u4e86\u5f00\u53d1\u8005\u7684\u81ea\u5b9a\u4e49\u9700\u6c42\uff0c\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u591a\u79cd\u914d\u7f6e\u63a7\u4ef6\u5c5e\u6027\u7684\u673a\u5236\u3002\u901a\u8fc7\u5bf9\u53c2\u6570\u63a7\u4ef6\u7684\u5408\u7406\u914d\u7f6e\uff0c\u5f00\u53d1\u8005\u4e0d\u4ec5\u53ef\u4ee5\u6784\u5efa\u7528\u6237\u4f53\u9a8c\u66f4\u52a0\u53cb\u597d\u7684GUI\u5e94\u7528\u7a0b\u5e8f\uff0c\u800c\u4e14\u53ef\u4ee5\u589e\u5f3a\u7a0b\u5e8f\u7684\u5065\u58ee\u6027\u3002
"},{"location":"widget-map/","title":"\u63a7\u4ef6\u7c7b\u578b\u6620\u5c04\u8868","text":""},{"location":"widget-map/#_1","title":"\u5185\u7f6e\u53c2\u6570\u63a7\u4ef6\u4e00\u89c8","text":""},{"location":"widget-map/#python","title":"\uff08\u4e00\uff09Python\u5185\u7f6e\u7c7b\u578b\u7684\u9ed8\u8ba4\u63a7\u4ef6","text":"\u63a7\u4ef6\u7c7b\u578b \u63a7\u4ef6\u914d\u7f6e\u7c7b\u578b \u5bf9\u5e94\u53c2\u6570\u7c7b\u578b \u8bf4\u660e \u5916\u89c2 IntSpinBox
IntSpinBoxConfig
int
\u7528\u4e8e\u8f93\u5165int
\u7c7b\u578b\u6570\u636e\u3002 FloatSpinBox
FloatSpinBoxConfig
float
\u7528\u4e8e\u8f93\u5165float
\u7c7b\u578b\u6570\u636e\u3002 BoolBox
BoolBoxConfig
bool
\u7528\u4e8e\u8f93\u5165bool
\u7c7b\u578b\u6570\u636e\u3002 LineEdit
LineEditConfig
str
\u7528\u4e8e\u8f93\u5165str
\u7c7b\u578b\u6570\u636e\u3002 DictEdit
DictEditConfig
dict
\u3001typing.Dict
\u3001Mapping
\u3001MutableMapping
\u7528\u4e8e\u5b57\u5178\u7c7b\u578b\u6570\u636e\u7684\u8f93\u5165\u3002 ListEdit
ListEditConfig
list
\u3001typing.List
\u7528\u4e8e\u5217\u8868\u7c7b\u578b\u6570\u636e\u7684\u8f93\u5165\u3002 TupleEdit
TupleEditConfig
tuple
\u3001typing.Tuple
\u7528\u4e8e\u5143\u7ec4\u7c7b\u578b\u6570\u636e\u7684\u8f93\u5165\u3002 SetEdit
SetEditConfig
set
\u3001typing.Set
\u3001MutableSet
\u7528\u4e8e\u96c6\u5408\u7c7b\u578b\u6570\u636e\u7684\u8f93\u5165\u3002 DateEdit
DateEditConfig
date
\u8be5\u63a7\u4ef6\u7528\u4e8e\u8f93\u5165\u65e5\u671f\uff0c\u662fpython\u5185\u7f6edatetime.date
\u7c7b\u578b\u53c2\u6570\u7684\u9ed8\u8ba4\u8f93\u5165\u63a7\u4ef6\u3002 TimeEdit
TimeEditConfig
time
\u8be5\u63a7\u4ef6\u7528\u4e8e\u8f93\u5165\u65e5\u671f\uff0c\u662fpython\u5185\u7f6edatetime.time
\u7c7b\u578b\u53c2\u6570\u7684\u9ed8\u8ba4\u8f93\u5165\u63a7\u4ef6\u3002 DateTimeEdit
DateTimeEditConfig
datetime
\u8be5\u63a7\u4ef6\u7528\u4e8e\u8f93\u5165\u65e5\u671f\u65f6\u95f4\uff0c\u662fpython\u5185\u7f6edatetime.datetime
\u7c7b\u578b\u53c2\u6570\u7684\u9ed8\u8ba4\u8f93\u5165\u63a7\u4ef6\u3002 ExclusiveChoiceBox
ExclusiveChoiceBoxConfig
typing.Literal
\u7528\u4e8e\u4ece\u4e00\u7ec4\u9009\u9879\u4e2d\u9009\u62e9\u4e00\u4e2a\u9009\u9879\uff0c\u662ftyping.Literal
\u7c7b\u578b\u7684\u9ed8\u8ba4\u63a7\u4ef6\uff0c\u53ef\u4ee5\u81ea\u52a8\u63d0\u53d6Literal
\u6240\u6709\u7ed9\u5b9a\u7684\u5b57\u9762\u91cf\u5e76\u5c06\u5176\u4f5c\u4e3a\u53ef\u9009\u9879\u3002 PyLiteralEdit
PyLiteralEditConfig
typing.Any
\u3001object
\u3001Union[str,bytes,bool,int,float,list,tuple,set,dict,None]
PyLiteralEdit
\u4e3b\u8981\u7528\u4e8ePython\u5b57\u9762\u91cf\u7684\u8f93\u5165\uff0c\u662fAny
\u3001object
\u3001Union
\u7b49\u7c7b\u578b\u53c2\u6570\u7684\u9ed8\u8ba4\u8f93\u5165\u63a7\u4ef6\u3002 Python\u5b57\u9762\u91cf
\u662f\u6307ast.eval_literal()
\u652f\u6301\u7684\u4efb\u610fPython\u5b57\u9762\u91cf\uff0c\u5305\u62ec\uff1a\u5b57\u7b26\u4e32\u3001\u5b57\u8282\u5bf9\u8c61\u3001\u6570\u503c\u3001\u5143\u7ec4\u3001\u5217\u8868\u3001\u5b57\u5178\u3001\u96c6\u5408\u3001\u5e03\u5c14\u503c\u7b49\u3002 EnumSelect
EnumSelectConfig
enum.Enum
\u7528\u4e8eEnum
\uff08\u679a\u4e3e\u7c7b\u578b\uff09\u503c\u7684\u8f93\u5165"},{"location":"widget-map/#_2","title":"\uff08\u4e8c\uff09\u8bed\u4e49\u5316\u7c7b\u578b\uff08\u6269\u5c55\u7c7b\u578b\uff09\u53ca\u5176\u63a7\u4ef6","text":"\u8bed\u4e49\u5316\u7c7b\u578b
\u662f\u4ece\u5185\u7f6e\u7c7b\u578b\u4e2d\u6269\u5c55\u800c\u6765\u7684\u7c7b\u578b\uff0c\u5f88\u591a\u65f6\u5019\uff0c\u53ef\u4ee5\u770b\u4f5c\u662f\u5bf9\u5e94\u5185\u7f6e\u7c7b\u578b\u7684\u201c\u522b\u540d\u201d
\uff0c\u5728\u4f7f\u7528\u4e0a\u4e0e\u5bf9\u5e94\u5185\u7f6e\u7c7b\u578b\u6ca1\u6709\u533a\u522b\u3002
\u8bed\u4e49\u5316\u7c7b\u578b\uff08\u6269\u5c55\u7c7b\u578b\uff09\u7684\u4e3b\u8981\u4f5c\u7528\u5728\u4e8e\uff0c\u63d0\u4f9b\u533a\u522b\u4e8e\u5bf9\u5e94\u5185\u7f6e\u7c7b\u578b\u9ed8\u8ba4\u63a7\u4ef6\u7684\u4e13\u7528\u63a7\u4ef6\uff0c\u4ee5\u6ee1\u8db3\u7279\u5b9a\u573a\u666f\u4e0b\u7684\u8f93\u5165\u9700\u6c42\u3002\u6bd4\u5982int_slider_t
\u662fint
\u7c7b\u578b\u7684\u8bed\u4e49\u5316\u7c7b\u578b\uff08\u6269\u5c55\u7c7b\u578b\uff09\uff0c\u5728\u4f7f\u7528\u4e0a\u4e0eint
\u7c7b\u578b\u4e00\u81f4\uff0c\u4f46\u5b83\u5bf9\u5e94\u7684\u8f93\u5165\u63a7\u4ef6\u662f\u4e00\u4e2aSlider
\uff08\u6ed1\u52a8\u6761\uff09\uff0c\u800c\u4e0d\u662f\u4e00\u4e2aSpinBox
\u3002
\u901a\u8fc7\u5408\u7406\u4f7f\u7528\u8bed\u4e49\u5316\u7c7b\u578b\uff08\u6269\u5c55\u7c7b\u578b\uff09\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u6784\u5efa\u51fa\u754c\u9762\u66f4\u52a0\u4e30\u5bcc\uff0c\u7528\u6237\u4ea4\u4e92\u4f53\u9a8c\u66f4\u52a0\u826f\u597d\u7684\u5e94\u7528\u7a0b\u5e8f\u3002\u4ee5\u4e0b\u662fPyGUIAdapter
\u63d0\u4f9b\u7684\u8bed\u4e49\u5316\u7c7b\u578b\uff08\u6269\u5c55\u7c7b\u578b\uff09\u53ca\u5176\u5bf9\u5e94\u7684\u63a7\u4ef6\u3002
\u6240\u6709\u7684\u8bed\u4e49\u5316\u7c7b\u578b\uff08\u6269\u5c55\u7c7b\u578b\uff09\u5747\u5728pyguiadapter.extend_types
\u6a21\u5757\u4e2d\u5b9a\u4e49\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u5bfc\u5165\uff1a
from pyguiadapter.extend_types import TYPE_NAME\n
\u5176\u4e2d\uff0cTYPE_NAME
\u662f\u9700\u8981\u5bfc\u5165\u7684\u7c7b\u578b\u540d\u79f0\u3002\u6bd4\u5982\uff0c\u5bf9\u4e8eint_slider_t
\uff0c\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u65b9\u5f0f\u5bfc\u5165\uff1a
from pyguiadapter.extend_types import int_slider_t\n
\u63a7\u4ef6\u7c7b\u578b \u63a7\u4ef6\u914d\u7f6e\u7c7b\u578b \u5bf9\u5e94\u6570\u636e\u7c7b\u578b \u8bf4\u660e \u5916\u89c2 IntLineEdit
IntLineEditConfig
int_t
int_t
\u6269\u5c55\u81eaint
\uff0c\u53ef\u4ee5\u770b\u4f5c\u662fint
\u7c7b\u578b\u7684\u522b\u540d\u3002PyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5355\u884c\u6587\u672c\u8f93\u5165\u6846\u6837\u5f0f\u7684\u8f93\u5165\u7ec4\u4ef6\uff0c\u4f46\u4e8e\u4e0e\u4e00\u822c\u5355\u884c\u6587\u672c\u8f93\u5165\u6846\uff0c\u8be5\u7c7b\u578b\u7684\u8f93\u5165\u7ec4\u4ef6\u53ea\u5141\u8bb8\u7528\u6237\u8f93\u5165\u6574\u6570\u6587\u672c\u3002 FloatLineEdit
FloatLineEditConfig
float_t
float_t
\u6269\u5c55\u81eafloat
\uff0c\u53ef\u4ee5\u770b\u4f5c\u662ffloat
\u7c7b\u578b\u7684\u522b\u540d\u3002PyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5355\u884c\u6587\u672c\u8f93\u5165\u6846\u6837\u5f0f\u7684\u8f93\u5165\u7ec4\u4ef6\uff0c\u4f46\u4e8e\u4e0e\u4e00\u822c\u5355\u884c\u6587\u672c\u8f93\u5165\u6846\u6807\u9898\uff0c\u8be5\u7c7b\u578b\u7684\u8f93\u5165\u7ec4\u4ef6\u53ea\u5141\u8bb8\u7528\u6237\u8f93\u5165\u6d6e\u70b9\u6570\u6587\u672c\u3002 TextEdit
TextEditConfig
text_t
text_t
\u6269\u5c55\u81eastr
\uff0c\u53ef\u4ee5\u770b\u4f5c\u662fstr
\u7c7b\u578b\u7684\u522b\u540d\u3002PyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u4e00\u4e2a\u591a\u884c\u6587\u672c\u8f93\u5165\u6846\uff0c\u5141\u8bb8\u7528\u6237\u8f93\u5165\u591a\u884c\u6587\u672c\u3002 Slider
SliderConfig
int_slider_t
int_slider_t
\u6269\u5c55\u81eaint
\uff0c\u53ef\u4ee5\u770b\u4f5c\u662fint
\u7c7b\u578b\u7684\u522b\u540d\u3002\u4e0e\u5176\u4ed6int
\u4e0d\u540c\uff0cPyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u6ed1\u52a8\u6761\u5f62\u5f0f\u7684\u8f93\u5165\u63a7\u4ef6\u3002 Dial
DialConfig
int_dial_t
int_dial_t
\u6269\u5c55\u81eaint
\uff0c\u53ef\u4ee5\u770b\u4f5c\u662fint
\u7c7b\u578b\u7684\u522b\u540d\u3002\u4e0e\u5176\u4ed6int
\u4e0d\u540c\uff0cPyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u523b\u5ea6\u76d8\u5f62\u5f0f\u7684\u8f93\u5165\u63a7\u4ef6\u3002 ColorPicker
ColorPickerConfig
color_t\u3001color_hex_t\u3001color_tuple_t
color_t
\u6269\u5c55\u81eaobject
\uff0c\u4ee3\u8868\u989c\u8272\u7c7b\u578b\u7684\u6570\u636e\uff0c\u5b9e\u9645\u652f\u6301\u7684\u7c7b\u578b\u5305\u62ectuple
\uff083\u5143\u7d20\u62164\u5143\u7d20\u5143\u7ec4\uff09\u3001str
\u3001QColor
\uff0c\u53d1\u8005\u53ef\u4ee5\u9009\u62e9\u989c\u8272\u7684\u8868\u793a\u65b9\u5f0f\u3002PyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u4e00\u4e2a\u989c\u8272\u9009\u62e9\u5668\u3002 ChoiceBox
ChoiceBoxConfig
choice_t
\u8be5\u7c7b\u578b\u6269\u5c55\u81eaobject
\uff0cPyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u4e00\u4e2a\u4e0b\u62c9\u9009\u62e9\u6846\uff0c\u7528\u6237\u53ef\u4ee5\u4ece\u4e00\u7ec4\u9009\u9879\u4e2d\u9009\u62e9\u5176\u4e2d\u4e00\u4e2a\u3002 MultiChoiceBox
MultiChoiceBoxConfig
choices_t
\u8be5\u7c7b\u578b\u6269\u5c55\u81ealist
\uff0c\u7528\u4e8e\u4ece\u4e00\u7ec4\u5bf9\u8c61\u4e2d\u9009\u62e9\u591a\u4e2a\u5bf9\u8c61\u3002 KeySequenceEdit
KeySequenceEditConfig
key_sequence_t
key_sequence_t
\u6269\u5c55\u81eastr
\uff0c\u4ee3\u8868\u5feb\u6377\u952e\u3002 PlainDictEdit
PlainDictEditConfig
plain_dict_t
plain_dict_t
\u7c7b\u578b\u6269\u5c55\u81eadict
\uff0c\u7528\u4e8eDict[key, int|bool|float|str|list|dict]
\u7c7b\u578b\u6570\u636e\u7684\u8f93\u5165\u3002 StringListEdit
StringListEditConfig
string_list_t
string_list_t
\u6269\u5c55\u81ealist
\uff0c\u7528\u4e8eList[str]
\u7c7b\u578b\u6570\u636e\u7684\u8f93\u5165\u3002 JsonEdit
JsonEditConfig
json_obj_t
json_obj_t
\u6269\u5c55\u81eaobject
\uff0c\u7528\u4e8ejson\u7c7b\u578b\u6570\u636e\u7684\u8f93\u5165\u3002\u7528\u6237\u5728\u63a7\u4ef6\u4e0a\u8f93\u5165\u7684\u6587\u672c\u5c06\u901a\u8fc7json.loads
\u8f6c\u6362\u4e3a\u5bf9\u5e94\u7684Python\u5bf9\u8c61\u3002 DirSelect
DirSelectConfig
directory_t
\u3001dir_t
directory_t
\u6269\u5c55\u81eastr
\uff0c\u4ee3\u8868\u4e00\u4e2a\u76ee\u5f55\u8def\u5f84\uff0cPyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6587\u4ef6\u9009\u62e9\u5bf9\u8bdd\u6846\u7528\u4e8e\u9009\u62e9\u76ee\u5f55\u3002 FileSelect
FileSelectConfig
file_t
file
\u6269\u5c55\u81eastr
\uff0c\u4ee3\u8868\u4e00\u4e2a\u6587\u4ef6\u8def\u5f84\uff0cPyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6587\u4ef6\u9009\u62e9\u5bf9\u8bdd\u6846\u7528\u4e8e\u9009\u62e9\u6587\u4ef6\u3002 MultiFileSelect
MultiFileSelectConfig
files_t
files
\u6269\u5c55\u81ealist
\uff0c\u4ee3\u8868\u4e00\u7ec4\u6587\u4ef6\u8def\u5f84\uff0cPyGUIAdapter
\u4e3a\u8be5\u7c7b\u578b\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6587\u4ef6\u9009\u62e9\u5bf9\u8bdd\u6846\u7528\u4e8e\u9009\u62e9\u591a\u4e2a\u6587\u4ef6\u3002 PathListEdit
PathListEditConfig
path_list_t
List[str]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u8def\u5f84\u5217\u8868\uff0c\u652f\u6301\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u548c\u6587\u4ef6\u5939\u8def\u5f84\u3002 FileListEdit
FileListEditConfig
file_list_t
List[str]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u8def\u5f84\u5217\u8868\uff0c\u652f\u6301\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u3002 DirectoryListEdit
DirectoryListEditConfig
dir_list_t
List[str]
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u8def\u5f84\u5217\u8868\uff0c\u652f\u6301\u6dfb\u52a0\u6587\u4ef6\u5939\u8def\u5f84\u3002 FontSelect
FontSelectConfig
font_t
str
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u5b57\u4f53\u540d\u79f0\uff0c\u63d0\u4f9b\u4e0b\u62c9\u6846\u4f9b\u7528\u6237\u9009\u62e9\u5f53\u524d\u7cfb\u7edf\u5df2\u5b89\u88c5\u5b57\u4f53\u3002 IntQuantityBox
IntQuantityBoxConfig
int_quantity_t
tuple
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u5177\u4f53\u4e3a\u4e00\u4e2a\u4e8c\u5143\u7d20\u5143\u7ec4Tuple[int, str |None]
\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u6574\u6570\u578b\u7684\u6570\u91cf
\uff08\u6240\u8c13\u6570\u91cf\u5373\u5e26\u5355\u4f4d\u7684\u91cf\uff09\uff0c\u7b2c\u4e00\u4e2a\u5143\u7d20\u4e3a\u6570\u91cf\u7684\u503c\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20\u4e3a\u6570\u91cf\u7684\u5355\u4f4d\u3002\u5b9e\u73b0\u4e86\u4e13\u95e8\u7684\u8f93\u5165\u63a7\u4ef6\uff0c\u5141\u8bb8\u7528\u6237\u8f93\u5165\u6570\u91cf\u7684\u503c\u548c\u9009\u62e9\u6570\u91cf\u7684\u5355\u4f4d\u3002 FloatQuantityBox
FloatQuantityBoxConfig
float_quantity_t
tuple
\u7c7b\u578b\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u5177\u4f53\u4e3a\u4e00\u4e2a\u4e8c\u5143\u7d20\u5143\u7ec4Tuple[float, str |None]
\uff0c\u8bed\u4e49\u4e0a\u4ee3\u8868\u4e00\u4e2a\u6d6e\u70b9\u578b\u7684\u6570\u91cf
\uff08\u6240\u8c13\u6570\u91cf\u5373\u5e26\u5355\u4f4d\u7684\u91cf\uff09\uff0c\u7b2c\u4e00\u4e2a\u5143\u7d20\u4e3a\u6570\u91cf\u7684\u503c\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20\u4e3a\u6570\u91cf\u7684\u5355\u4f4d\u3002\u5b9e\u73b0\u4e86\u4e13\u95e8\u7684\u8f93\u5165\u63a7\u4ef6\uff0c\u5141\u8bb8\u7528\u6237\u8f93\u5165\u6570\u91cf\u7684\u503c\u548c\u9009\u62e9\u6570\u91cf\u7684\u5355\u4f4d\u3002 PathsEditor
PathsEditorConfig
paths_t
List[str]
\u7684\u6269\u5c55\u7c7b\u578b\uff0c\u8bed\u4e49\u4e0a\u8868\u793a\u4e00\u7ec4\u8def\u5f84\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u529f\u80fd\u4e30\u5bcc\u7684\u5916\u7f6e\u8def\u5f84\u7f16\u8f91\u5668\uff0c\u901a\u8fc7\u8be5\u7f16\u8f91\u5668\uff0c\u7528\u6237\u53ef\u4ee5\u65b9\u4fbf\u5730\u7ba1\u7406\u4e00\u7ec4\u8def\u5f84\uff0c\u5305\u62ec\u6dfb\u52a0\u3001\u5220\u9664\u4ee5\u53ca\u6539\u53d8\u8def\u5f84\u7684\u987a\u5e8f\u3002"},{"location":"window/","title":"\u914d\u7f6e\u7a97\u53e3\u5c5e\u6027","text":""},{"location":"window/#_1","title":"\uff08\u4e00\uff09\u7a97\u53e3\u6982\u8ff0","text":"PyGUIAdapter
\u4e2d\u4e3b\u8981\u6709\u4e24\u79cd\u7c7b\u578b\u7684\u7a97\u53e3\uff1a\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\u548c\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow\uff09
\uff0c\u5b83\u4eec\u90fd\u7ee7\u627f\u81ea\u7a97\u53e3\u7236\u7c7bBaseWindow
\u3002BaseWindow
\u5b9a\u4e49\u4e86\u5b50\u7c7b\u7a97\u53e3\u7684\u5171\u540c\u884c\u4e3a\uff0c\u6bd4\u5982\uff1a
- \u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528
\u7a97\u53e3\u914d\u7f6e\u7c7b
\u914d\u7f6e\u7a97\u53e3\u7684\u67d0\u4e9b\u5c5e\u6027 - \u5f00\u53d1\u8005\u53ef\u4ee5\u5411\u7a97\u53e3\u4e2d\u6dfb\u52a0\u5de5\u5177\u680f\u548c\u83dc\u5355\u680f
- \u5f00\u53d1\u8005\u53ef\u4ee5\u76d1\u542c\u7a97\u53e3\u7684\u67d0\u4e9b\u4e8b\u4ef6
- \u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u7a97\u53e3\u4e8b\u4ef6\u56de\u8c03\u4e2d\u83b7\u53d6/\u6539\u53d8\u6dfb\u52a0\u5230\u5de5\u5177\u680f\uff08\u83dc\u5355\u680f\uff09\u4e2d\u7684
\u52a8\u4f5c\uff08Action\uff09
\u7684\u72b6\u6001 - ......
"},{"location":"window/#1","title":"1\u3001\u7a97\u53e3\u7684\u57fa\u672c\u63a5\u53e3","text":"\u540c\u65f6\uff0c BaseWindow
\u4e2d\u5b9a\u4e49\u5e76\u5b9e\u73b0\u4e86\u4e00\u7ec4\u57fa\u672c\u63a5\u53e3\uff0c\u8fd9\u4e9b\u63a5\u53e3\u53ef\u4ee5\u5bf9\u7a97\u53e3\u8fdb\u884c\u64cd\u4f5c\u6216\u8005\u662f\u5b9e\u73b0\u4e86\u5176\u4ed6\u6709\u7528\u7684\u529f\u80fd\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u52a8\u4f5c\uff08Action\uff09
\u6216\u7a97\u53e3\u4e8b\u4ef6\u7684\u56de\u8c03\u51fd\u6570\u4e2d\u8c03\u7528\u8fd9\u4e9b\u63a5\u53e3\u3002\u53ef\u4ee5\u53c2\u8003\u8fd9\u4e2a\u6587\u6863pyguiadapter.window.BaseWindow
\u4ee5\u83b7\u53d6\u8fd9\u4e9b\u63a5\u53e3\u7684\u8be6\u7ec6\u4fe1\u606f\u3002
"},{"location":"window/#2","title":"2\u3001\u7a97\u53e3\u7684\u5171\u540c\u5c5e\u6027","text":"\u7a97\u53e3\u7684\u5c5e\u6027\uff0c\u5982\u6807\u9898\u3001\u56fe\u6807\u3001\u5927\u5c0f\u3001\u4f4d\u7f6e\u3001\u5b57\u4f53\u3001\u6837\u5f0f\u7b49\uff0c\u5747\u7531\u7a97\u53e3\u7684\u914d\u7f6e\u7c7b\u5b9a\u4e49\uff0cBaseWindowConfig
\u662f\u6240\u6709\u7a97\u53e3\u914d\u7f6e\u7c7b\u7684\u7236\u7c7b\uff0c\u5b9a\u4e49\u4e86\u4e00\u7ec4\u6240\u6709\u7a97\u53e3\u5747\u9002\u7528\u7684\u5171\u540c\u5c5e\u6027\uff0c\u53ef\u4ee5\u53c2\u8003\u8fd9\u4e2a\u6587\u6863pyguiadapter.window.BaseWindowConfig
\u4ee5\u83b7\u53d6\u8fd9\u4e9b\u5c5e\u6027\u7684\u8be6\u7ec6\u4fe1\u606f\u3002
BaseWindow
\u7684\u5b50\u7c7b\u7a97\u53e3\u901a\u5e38\u7ee7\u627fBaseWindowConfig
\u5b9e\u73b0\u4e13\u7528\u7684\u7a97\u53e3\u914d\u7f6e\u7c7b\uff0c\u5e76\u8986\u76d6BaseWindowConfig
\u4e2d\u67d0\u4e9b\u5c5e\u6027\u7684\u9ed8\u8ba4\u503c\u6216\u6dfb\u52a0\u4e13\u95e8\u9002\u7528\u4e8e\u5b50\u7c7b\u7a97\u53e3\u7684\u65b0\u5c5e\u6027\u3002
"},{"location":"window/#3","title":"3\u3001\u7a97\u53e3\u4e8b\u4ef6\u76d1\u542c","text":"\u7a97\u53e3\u7684\u521b\u5efa\u3001\u663e\u793a\u3001\u5173\u95ed\u3001\u9500\u6bc1\u3001\u9690\u85cf\u5747\u88ab\u89c6\u4e3a\u4e00\u79cd\u4e8b\u4ef6\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u76d1\u542c\u8fd9\u4e9b\u4e8b\u4ef6\uff0c\u5e76\u5728\u8fd9\u4e9b\u4e8b\u4ef6\u53d1\u751f\u65f6\u6267\u884c\u7279\u5b9a\u7684\u4ee3\u7801\u3002\u5bf9\u7a97\u53e3\u4e8b\u4ef6\u7684\u76d1\u542c\uff0c\u9700\u8981\u901a\u8fc7BaseWindowEventListener
\u5bf9\u8c61\u6765\u5b8c\u6210\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5b50\u7c7b\u5316\u8be5\u7c7b\uff0c\u6216\u8005\u4f7f\u7528\u4e00\u4e2a\u5b83\u7684\u4e00\u4e2a\u73b0\u6210\u5b50\u7c7bSimpleWindowEventListener
\u3002
\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\u83b7\u53d6\u7a97\u53e3\u4e8b\u4ef6\u76d1\u542c\u5668\u7684\u8be6\u7ec6\u4fe1\u606f\uff1a
pyguiadapter.window.BaseWindowEventListener
pyguiadapter.window.SimpleWindowEventListener
"},{"location":"window/#fnselectwindow","title":"\uff08\u4e8c\uff09\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09","text":""},{"location":"window/#1_1","title":"1\u3001\u6982\u8ff0","text":"\u5728\u5411GUIAdapter
\u5b9e\u4f8b\u4e2d\u6dfb\u52a0\u4e86\u591a\u4e2a\u51fd\u6570\u540e\uff0cPyGUIAdapter
\u5c06\u521b\u5efa\u4e00\u4e2a\u51fd\u6570\u9009\u62e9\u7a97\u53e3
\uff0c\u8be5\u7a97\u53e3\u4f1a\u663e\u793a\u6240\u6709\u5df2\u6dfb\u52a0\u7684\u51fd\u6570\u3002\u5728\u4ec5\u6dfb\u52a0\u4e86\u4e00\u4e2a\u51fd\u6570\u65f6\uff0c\u51fd\u6570\u9009\u62e9\u7a97\u53e3
\u5c06\u4e0d\u4f1a\u663e\u793a\uff0c\u800c\u662f\u76f4\u63a5\u663e\u793a\u8be5\u51fd\u6570\u7684\u6267\u884c\u7a97\u53e3\uff0c\u5f53\u7136\uff0c\u5f00\u53d1\u8005\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u65b9\u5f0f\uff0c\u5f3a\u5236\u663e\u793a\u51fd\u6570\u9009\u62e9\u7a97\u53e3
\uff1a
adapter.run(show_select_window=True)\n
\u51fd\u6570\u9009\u62e9\u7a97\u53e3
\u4e3b\u8981\u5206\u6210\u4e09\u4e2a\u533a\u57df\uff1a
- \u2460
\u51fd\u6570\u5217\u8868\u533a\u57df
- \u2461
\u51fd\u6570\u6587\u6863\u533a\u57df
- \u2462
\u51fd\u6570\u9009\u62e9\u6309\u94ae
"},{"location":"window/#2_1","title":"2\u3001\u914d\u7f6e\u7a97\u53e3\u5c5e\u6027","text":"\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\u7684\u53ef\u914d\u7f6e\u5c5e\u6027\u7531FnSelectWindowConfig
\u7c7b\u5b9a\u4e49\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\u914d\u7f6e\u7a97\u53e3\u5c5e\u6027\uff1a
\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.windows import DocumentBrowserConfig\nfrom pyguiadapter.windows.fnselect import FnSelectWindowConfig\n\n\ndef fn1():\n \"\"\"\n This example shows how config the **function select window**\n \"\"\"\n pass\n\n\ndef fn2():\n \"\"\"\n This example shows how config the **function select window**\n \"\"\"\n pass\n\n\ndef fn3():\n \"\"\"\n This example shows how config the **function select window**\n \"\"\"\n pass\n\n\ndef fn4():\n \"\"\"\n This example shows how config the **function select window**\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n\n select_window_config = FnSelectWindowConfig(\n title=\"My Tool Kit\",\n icon=\"fa5s.tools\",\n default_fn_group_name=\"Group 1\",\n default_fn_group_icon=\"fa.desktop\",\n fn_group_icons={\n \"Group 2\": \"fa.mobile\",\n \"Group 3\": \"fa.cloud\",\n },\n size=(600, 400),\n icon_size=32,\n icon_mode=True,\n select_button_text=\"Go!\",\n document_browser_width=400,\n document_browser_config=DocumentBrowserConfig(),\n always_on_top=True,\n )\n\n adapter = GUIAdapter()\n adapter.add(fn1)\n adapter.add(fn2)\n adapter.add(fn3, group=\"Group 2\")\n adapter.add(fn4, group=\"Group 3\")\n adapter.run(select_window_config=select_window_config)\n
\u5173\u4e8e\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\u7684\u53ef\u914d\u7f6e\u5c5e\u6027\uff0c\u53ef\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.windows.fnselect.FnSelectWindowConfig
"},{"location":"window/#3_1","title":"3\u3001\u76d1\u542c\u7a97\u53e3\u4e8b\u4ef6","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u5bf9\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\u7684\u4e8b\u4ef6\u8fdb\u884c\u76d1\u542c\u3002\u65b9\u6cd5\u5982\u4e0b\uff1a
\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.utils import messagebox\nfrom pyguiadapter.window import SimpleWindowEventListener\nfrom pyguiadapter.windows.fnselect import FnSelectWindow\n\n\ndef on_window_create(window: FnSelectWindow):\n print(\"on_create\")\n\n\ndef on_window_show(window: FnSelectWindow):\n print(\"on_show\")\n\n\ndef on_window_hide(window: FnSelectWindow):\n print(\"on_hide\")\n\n\ndef on_window_close(window: FnSelectWindow) -> bool:\n print(\"on_close\")\n ret = messagebox.show_question_message(\n window,\n title=\"Confirm Quit\",\n message=\"Are you sure to quit?\",\n buttons=messagebox.Yes | messagebox.No,\n )\n if ret == messagebox.Yes:\n return True\n return False\n\n\ndef on_window_destroy(window: FnSelectWindow):\n print(\"on_destroy\")\n\n\ndef event_example_3():\n pass\n\n\nif __name__ == \"__main__\":\n event_listener = SimpleWindowEventListener(\n on_create=on_window_create,\n on_show=on_window_show,\n on_hide=on_window_hide,\n on_close=on_window_close,\n on_destroy=on_window_destroy,\n )\n adapter = GUIAdapter()\n adapter.add(event_example_3)\n adapter.run(show_select_window=True, select_window_listener=event_listener)\n
\u4ee3\u7801\u8fd0\u884c\u6548\u679c\u5982\u4e0b\uff1a
\u63a7\u5236\u53f0\u8f93\u51fa\u5982\u4e0b\uff1a
"},{"location":"window/#4","title":"4\u3001\u6dfb\u52a0\u5de5\u5177\u680f","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u5411\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\u4e2d\u6dfb\u52a0\u5de5\u5177\u680f\uff0c\u65b9\u6cd5\u5982\u4e0b\uff1a
\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a
from pyguiadapter.action import Action\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.toolbar import ToolBar, ToolButtonTextUnderIcon\nfrom pyguiadapter.utils import messagebox\nfrom pyguiadapter.windows.fnselect import FnSelectWindow\n\n\ndef on_action_test(window: FnSelectWindow, action: Action):\n messagebox.show_info_message(\n window, message=f\"Action Triggered!(Action: {action.text})\"\n )\n\n\ndef on_action_close(window: FnSelectWindow, _: Action):\n ret = messagebox.show_question_message(\n window,\n message=\"Are you sure to close the application?\",\n buttons=messagebox.Yes | messagebox.No,\n )\n if ret == messagebox.Yes:\n window.close()\n\n\naction_test = Action(\n text=\"Test\", icon=\"fa.folder-open\", on_triggered=on_action_test, shortcut=\"Ctrl+O\"\n)\naction_close = Action(\n text=\"Close\", icon=\"fa.close\", on_triggered=on_action_close, shortcut=\"Ctrl+Q\"\n)\n\ntoolbar = ToolBar(\n actions=[action_test, action_close],\n floatable=True,\n button_style=ToolButtonTextUnderIcon,\n)\n\n\ndef foo():\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(foo)\n adapter.run(show_select_window=True, select_window_toolbar=toolbar)\n
\u6548\u679c\u5982\u4e0b\uff1a
"},{"location":"window/#5","title":"5\u3001\u6dfb\u52a0\u7a97\u53e3\u83dc\u5355","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u5411\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff08FnSelectWindow\uff09
\u4e2d\u6dfb\u52a0\u83dc\u5355\u680f\uff0c\u65b9\u6cd5\u5982\u4e0b\uff1a
\u5b8c\u6574\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a
from pyguiadapter.action import Action, Separator\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.menu import Menu\nfrom pyguiadapter.utils import messagebox\nfrom pyguiadapter.windows.fnselect import FnSelectWindow\n\n\ndef on_action_test(window: FnSelectWindow, action: Action):\n messagebox.show_info_message(\n window, message=f\"Action Triggered!(Action: {action.text})\"\n )\n\n\ndef on_action_close(window: FnSelectWindow, _: Action):\n ret = messagebox.show_question_message(\n window,\n message=\"Are you sure to close the application?\",\n buttons=messagebox.Yes | messagebox.No,\n )\n if ret == messagebox.Yes:\n window.close()\n\n\naction_test = Action(\n text=\"Test\", icon=\"fa.folder-open\", on_triggered=on_action_test, shortcut=\"Ctrl+O\"\n)\naction_close = Action(\n text=\"Close\", icon=\"fa.close\", on_triggered=on_action_close, shortcut=\"Ctrl+Q\"\n)\n\n\nmenu_file = Menu(\n title=\"File\",\n actions=[action_test, Separator(), action_close],\n)\n\n\ndef foo():\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(foo)\n adapter.run(show_select_window=True, select_window_menus=[menu_file])\n
\u6548\u679c\u5982\u4e0b\uff1a
"},{"location":"window/#6","title":"6\u3001\u4e3b\u8981\u63a5\u53e3","text":"\u53c2\u8003\uff1apyguiadapter.windows.fnselect.FnSelectWindow\u3002
"},{"location":"window/#fnexecutewindow","title":"\uff08\u4e09\uff09\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow\uff09","text":""},{"location":"window/#1_2","title":"1\u3001\u6982\u8ff0","text":"\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow\uff09
\u662f\u7528\u6237\u4e0e\u7a0b\u5e8f\u8fdb\u884c\u4ea4\u4e92\u7684\u4e3b\u8981\u754c\u9762\u3002\u4e00\u4e2a\u5178\u578b\u7684\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow\uff09
\u7531\u4ee5\u4e0b\u51e0\u4e2a\u90e8\u5206\u7ec4\u6210\uff1a
\u5176\u4e2d\uff1a
- \u6587\u6863\u6d4f\u89c8\u5668\u7528\u4e8e\u663e\u793a\u51fd\u6570\u8bf4\u660e\u6587\u6863\u3002
- \u8f93\u51fa\u6d4f\u89c8\u5668\u7528\u4e8e\u663e\u793a\u51fd\u6570\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u4f7f\u7528\u8f93\u51fa\u7684\u6d88\u606f\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u51fd\u6570\u7684\u8fd4\u56de\u503c\u3001\u51fd\u6570\u7684\u5f02\u5e38\u4fe1\u606f\u5747\u4f1a\u663e\u793a\u5728\u6b64\u533a\u57df\u3002
"},{"location":"window/#2_2","title":"2\u3001\u914d\u7f6e\u7a97\u53e3\u5c5e\u6027","text":"\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow\uff09
\u7684\u7a97\u53e3\u5c5e\u6027\u7531\u914d\u7f6e\u7c7bFnExecuteWindowConfig
\u5b9a\u4e49\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7GUIAdapter.add()
\u65b9\u6cd5\u7684window_config
\u914d\u7f6e\u7a97\u53e3\u7684\u5c5e\u6027\uff0c\u6bcf\u4e2a\u51fd\u6570\u90fd\u53ef\u4ee5\u6839\u636e\u9700\u8981\u914d\u7f6e\u81ea\u5df1\u7684\u7a97\u53e3\u5c5e\u6027\uff0c\u4f8b\u5982\uff0c\u5728\u4e0b\u9762\u7684\u4f8b\u5b50\u4e2d\uff0cfunction_1
\u548cfunction_2
\u5206\u522b\u914d\u7f6e\u4e86\u4e0d\u540c\u7684\u7a97\u53e3\u5c5e\u6027\uff1a
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.windows.fnexec import FnExecuteWindowConfig\n\n\ndef function_1(arg1: int, arg2: str, arg3: bool) -> None:\n pass\n\n\ndef function_2(arg1: int, arg2: str, arg3: bool) -> None:\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n function_1,\n # set window config for function_1\n window_config=FnExecuteWindowConfig(\n title=\"Function 1\", clear_checkbox_visible=True\n ),\n )\n adapter.add(\n function_2,\n # set window config for function_2\n window_config=FnExecuteWindowConfig(\n title=\"Function 2\",\n size=(400, 600),\n clear_checkbox_visible=False,\n clear_checkbox_checked=False,\n document_dock_visible=False,\n ),\n )\n adapter.run()\n
\u4e0b\u9762\u662f\u4e00\u4e2a\u66f4\u52a0\u590d\u6742\u4e00\u4e9b\u7684\u4f8b\u5b50\uff0c\u6f14\u793a\u4e86\u66f4\u591a\u53ef\u914d\u7f6e\u5c5e\u6027\u7684\u6548\u679c\uff1a
from typing import Optional\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.exceptions import ParameterError\nfrom pyguiadapter.windows.fnexec import FnExecuteWindowConfig\n\n\ndef equation_solver(a: float, b: float, c: float) -> Optional[tuple]:\n \"\"\"\n Solving Equations: ax^2 + bx + c = 0 (a,b,c \u2208 R, a \u2260 0)\n @param a: a \u2208 R, a \u2260 0\n @param b: b \u2208 R\n @param c: c \u2208 R\n @return:\n \"\"\"\n if a == 0:\n raise ParameterError(parameter_name=\"a\", message=\"a cannot be zero!\")\n\n delta = b**2 - 4 * a * c\n if delta < 0:\n return None\n x1 = (-b + delta**0.5) / (2 * a)\n if delta == 0:\n return x1, x1\n x2 = (-b - delta**0.5) / (2 * a)\n return x1, x2\n\n\nif __name__ == \"__main__\":\n window_config = FnExecuteWindowConfig(\n title=\"Equation Solver\",\n icon=\"mdi6.function-variant\",\n execute_button_text=\"Solve\",\n size=(350, 450),\n document_dock_visible=False,\n output_dock_visible=False,\n clear_button_visible=False,\n clear_checkbox_visible=False,\n show_function_result=True,\n function_result_message=\"real roots: {}\",\n default_parameter_group_name=\"Equation Parameters\",\n print_function_error=False,\n print_function_result=False,\n )\n adapter = GUIAdapter()\n adapter.add(equation_solver, window_config=window_config)\n adapter.run()\n
\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow\uff09
\u62e5\u6709\u4e30\u5bcc\u7684\u53ef\u914d\u7f6e\u9009\u9879\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\u83b7\u5f97\u8fd9\u4e9b\u9009\u9879\u7684\u8be6\u7ec6\u4fe1\u606f\uff1a
- pyguiadapter.windows.fnexec.FnExecuteWindowConfig\u3002
\u5173\u4e8e\u6587\u6863\u6d4f\u89c8\u5668\u7684\u914d\u7f6e\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.windows.DocumentBrowserConfig\u3002
\u5173\u4e8e\u8f93\u51fa\u6d4f\u89c8\u5668\u7684\u914d\u7f6e\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\uff1a
- pyguiadapter.windows.fnexec.OutputBrowserConfig\u3002
Q&A\uff1a \u4e3a\u4ec0\u4e48\u8bbe\u7f6e\u4e86DocumentBrowserConfig
\u548cOutputBrowserConfig
\uff0c\u4f46\u6709\u65f6\u4e0d\u751f\u6548\uff1f
\u8fd9\u79cd\u60c5\u51b5\u5e38\u89c1\u4e8e\u5f00\u53d1\u8005\u4e3a\u7a97\u53e3\u8bbe\u7f6e\u4e86\u6837\u5f0f\u8868\uff08QSS\uff09\u6216\u4f7f\u7528\u4e86\u7b2c\u4e09\u65b9\u7f8e\u5316\u5e93\u65f6\u3002\u7531\u4e8e\u6837\u5f0f\u8868\u7684\u4f18\u5148\u7ea7\u8981\u9ad8\u4e8eDocumentBrowserConfig
\u548cOutputBrowserConfig
\uff0c\u56e0\u6b64\u53ef\u80fd\u4f1a\u53d1\u751fDocumentBrowserConfig
\u6216OutputBrowserConfig
\u4e2d\u8bbe\u7f6e\u7684\u6837\u5f0f\uff08\u5982\u6587\u5b57\u989c\u8272\u3001\u80cc\u666f\u8272\u7b49\uff09\u88ab\u6837\u5f0f\u8868\u8986\u76d6\u6389\u7684\u60c5\u51b5\u3002\u8fd9\u79cd\u8bbe\u8ba1\u7684\u76ee\u7684\u662f\u4e3a\u4e86\u8ba9\u754c\u9762\u7684\u6574\u4f53\u98ce\u683c\u4fdd\u6301\u4e00\u81f4\u3002
\u6bd4\u5982\u4e0b\u9762\u8fd9\u4e2a\u4f8b\u5b50\uff0c\u901a\u8fc7\u7b2c\u4e09\u65b9\u5e93\u8bbe\u7f6e\u4e86\u7a97\u53e3\u4e3b\u9898\u540e\uff0c\u6587\u6863\u6d4f\u89c8\u5668\u548c\u8f93\u51fa\u6d4f\u89c8\u5668\u7684\u6587\u5b57\u989c\u8272\u3001\u80cc\u666f\u989c\u8272\u4e5f\u4f1a\u88ab\u8c03\u6574\u5230\u5408\u9002\u7684\u72b6\u6001\u3002
\"\"\"\nThis example requires PyQtDarkTheme. Please install it before you run this example.\n\"\"\"\n\nfrom datetime import datetime\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.extend_types import text_t\n\n\ndef app_style_example(\n arg1: str, arg2: int, arg3: float, arg4: bool, arg5: text_t, arg6: datetime\n):\n \"\"\"\n This example requires [PyQtDarkTheme](https://github.com/5yutan5/PyQtDarkTheme).\n Please install it before you run the example.\n\n <br />\n \n e.g. using `pip`:\n \n > `pip install pyqtdarktheme`\n \n @param arg1: arg1 description\n @param arg2: arg2 description\n @param arg3: arg3 description\n @param arg4: arg4 description\n @param arg5: arg5 description\n @param arg6: arg6 description\n @return:\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n import qdarktheme\n\n def on_app_start(app):\n # this will be called after the instantiation of QApplication.\n print(\"app started\")\n qdarktheme.setup_theme(\"dark\")\n \n adapter = GUIAdapter(on_app_start=on_app_start)\n adapter.add(app_style_example)\n adapter.run()\n```\n
\u5982\u679c\u5f00\u53d1\u8005\u786e\u5b9e\u9700\u8981\u8bbe\u7f6e\u6587\u6863\u6d4f\u89c8\u5668\u6216\u8f93\u51fa\u6d4f\u89c8\u5668\u7684\u6837\u5f0f\uff0c\u800c\u4e0d\u5e0c\u671b\u5b83\u88ab\u7b2c\u4e09\u65b9\u5e93\u8986\u76d6\uff0c\u53ef\u4ee5\u901a\u8fc7DocumentBrowserConfig
\u6216OutputBrowserConfig
\u7684stylesheet
\u5c5e\u6027\u6307\u5b9a\u5176\u6837\u5f0f\u8868\u5185\u5bb9\uff0c\u901a\u8fc7stylesheet
\u8bbe\u7f6e\u7684\u6837\u5f0f\u4e00\u822c\u4e0d\u4f1a\u88ab\u7b2c\u4e09\u65b9\u5e93\u8986\u76d6\u3002\u6bd4\u5982\u4e0b\u9762\u7684\u793a\u4f8b\uff1a
\"\"\"\nThis example requires PyQtDarkTheme. Please install it before you run this example.\n\"\"\"\n\nfrom datetime import datetime\n\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.extend_types import text_t\nfrom pyguiadapter.windows.fnexec import FnExecuteWindowConfig, OutputBrowserConfig\n\n\ndef app_style_example(\n arg1: str, arg2: int, arg3: float, arg4: bool, arg5: text_t, arg6: datetime\n):\n \"\"\"\n This example requires [PyQtDarkTheme](https://github.com/5yutan5/PyQtDarkTheme).\n Please install it before you run the example.\n <br />\n\n e.g. using `pip`:\n\n > `pip install pyqtdarktheme`\n\n <br />\n\n The style of output browser will be overridden with **OutputBrowserConfig.stylesheet**\n\n @param arg1: arg1 description\n @param arg2: arg2 description\n @param arg3: arg3 description\n @param arg4: arg4 description\n @param arg5: arg5 description\n @param arg6: arg6 description\n @return:\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n import qdarktheme\n\n def on_app_start(app):\n # this will be called after the instantiation of QApplication.\n print(\"app started\")\n qdarktheme.setup_theme(\"dark\")\n\n adapter = GUIAdapter(on_app_start=on_app_start)\n adapter.add(\n app_style_example,\n window_config=FnExecuteWindowConfig(\n output_browser_config=OutputBrowserConfig(\n stylesheet=\"\"\"\n background-color: \"#380C2A\";\n color: \"#FFFFFF\";\n font-family: \"Consolas\";\n font-size: 12pt;\n \"\"\"\n )\n ),\n )\n adapter.run()\n
"},{"location":"window/#3_2","title":"3\u3001\u76d1\u542c\u7a97\u53e3\u4e8b\u4ef6","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u5bf9\uff08\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff09FnExecuteWindow
\u7684\u4e8b\u4ef6\u8fdb\u884c\u76d1\u542c\u5e76\u505a\u51fa\u54cd\u5e94\uff0c\u4e00\u4e2a\u6bd4\u8f83\u5e38\u89c1\u7684\u573a\u666f\u662f\uff0c\u5728\u7528\u6237\u5173\u95ed\u7a97\u53e3\u65f6\u518d\u6b21\u5411\u7528\u6237\u8fdb\u884c\u786e\u8ba4\u3002\u76d1\u542c\u7a97\u53e3\u4e8b\u4ef6\u7684\u65b9\u6cd5\u5982\u4e0b\uff1a
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.window import SimpleWindowEventListener\nfrom pyguiadapter.windows.fnexec import FnExecuteWindow\nfrom pyguiadapter.utils import messagebox\n\n\ndef on_window_create(window: FnExecuteWindow):\n print(\"on_create\")\n\n\ndef on_window_show(window: FnExecuteWindow):\n print(\"on_show\")\n\n\ndef on_window_hide(window: FnExecuteWindow):\n print(\"on_hide\")\n\n\ndef on_window_close(window: FnExecuteWindow) -> bool:\n print(\"on_close\")\n ret = messagebox.show_question_message(\n window,\n title=\"Confirm Quit\",\n message=\"Are you sure to quit?\",\n buttons=messagebox.Yes | messagebox.No,\n )\n if ret == messagebox.Yes:\n return True\n return False\n\n\ndef on_window_destroy(window: FnExecuteWindow):\n print(\"on_destroy\")\n\n\ndef event_example_2():\n pass\n\n\nif __name__ == \"__main__\":\n event_listener = SimpleWindowEventListener(\n on_create=on_window_create,\n on_show=on_window_show,\n on_hide=on_window_hide,\n on_close=on_window_close,\n on_destroy=on_window_destroy,\n )\n adapter = GUIAdapter()\n adapter.add(event_example_2, window_listener=event_listener)\n adapter.run()\n
\u4e0a\u8ff0\u793a\u4f8b\u6548\u679c\u5982\u4e0b\uff1a
\u63a7\u5236\u53f0\u8f93\u51fa\u5982\u4e0b\uff1a
\u9664\u4e86\u53ef\u4ee5\u4f7f\u7528BaseWindowEventListener
\u6216SimpleWindowEventListener
\u5bf9\u51fd\u6570\u6267\u884c\u7a97\u53e3\u7684\u4e8b\u4ef6\u8fdb\u884c\u76d1\u542c\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528\u51fd\u6570\u6267\u884c\u7a97\u53e3\u4e13\u7528\u7684\u4e8b\u4ef6\u76d1\u542c\u5668\u7c7b\uff1aFnExecuteWindowEventListener
\u6216SimpleFnExecuteWindowEventListener
\u3002\u9664\u4e86\u53ef\u4ee5\u76d1\u542c\u4e00\u822c\u7684\u7a97\u53e3\u4e8b\u4ef6\uff0c\u5b83\u4eec\u8fd8\u80fd\u5bf9\u51fd\u6570\u6267\u884c\u72b6\u6001\u8fdb\u884c\u76d1\u542c\uff0c\u5305\u62ec\uff1a
- \u51fd\u6570\u5f00\u59cb\u6267\u884c\uff0c\u6b64\u65f6\u5c06\u4f1a\u56de\u8c03
on_execute_start()
- \u51fd\u6570\u6b63\u5e38\u8fd4\u56de\uff0c\u6b64\u65f6\u5c06\u4f1a\u56de\u8c03
on_execute_result()
- \u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u53d1\u751f\u5f02\u5e38\uff0c\u51fd\u6570\u672a\u6b63\u5e38\u8fd4\u56de\uff0c\u6b64\u65f6\u5c06\u56de\u8c03
on_execute_error()
- \u51fd\u6570\u6267\u884c\u5b8c\u6bd5\uff0c\u6b64\u65f6\u5c06\u4f1a\u56de\u8c03
on_execute_finish()
\uff0c\u7531\u4e8e\u4e0d\u7ba1\u51fd\u6570\u662f\u5426\u6b63\u5e38\u8fd4\u56de\uff0c\u5176\u6700\u7ec8\u90fd\u4f1a\u56de\u5230\u8be5\u72b6\u6001\uff0c \u56e0\u6b64\uff0c\u53ef\u4ee5\u4fdd\u8bc1\u5728on_execute_result()
\u6216on_execute_error()
\u56de\u8c03\u4e4b\u540eon_execute_finish()
\u4e00\u5b9a\u4f1a\u88ab\u56de\u8c03
\u5728\u4e0a\u8ff0\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\uff0c\u6bd4\u8f83\u7279\u6b8a\u7684\u662fon_execute_result()
\u548con_execute_error()
\u3002\u8fd9\u4e24\u4e2a\u56de\u8c03\u51fd\u6570\u8fd4\u56de\u4e00\u4e2abool
\u503c\uff0c\u5176\u4f5c\u7528\u662f\u544a\u8bc9PyGUIAdapter
\u662f\u5426\u8981\u5bf9\u51fd\u6570\u7684\u8fd4\u56de\u503c\u6216\u5f02\u5e38\u6267\u884c\u9ed8\u8ba4\u7684\u5904\u7406\u903b\u8f91\u3002\u82e5\u8fd4\u56deTrue
\uff0c\u5219PyGUIAdapter
\u5c06\u5728\u51fd\u6570\u8fd4\u56de\u6216\u53d1\u751f\u5f02\u5e38\u540e\u6267\u884c\u9ed8\u8ba4\u7684\u64cd\u4f5c\uff0c\u6bd4\u5982\u6253\u5370\u6216\u5f39\u7a97\u663e\u793a\u8fd4\u56de\u503c\u6216\u5f02\u5e38\u4fe1\u606f\u3002\u82e5\u8fd4\u56deFalse
\uff0c\u5219\u8868\u793a\u5f00\u53d1\u8005\u5df2\u7ecf\u5728\u56de\u8c03\u51fd\u6570\u4e2d\u5b8c\u6210\u4e86\u5bf9\u51fd\u6570\u8fd4\u56de\u503c/\u5f02\u5e38\u5904\u7406\uff0c\u65e0\u9700PyGUIAdapter
\u518d\u6b21\u8fdb\u884c\u5904\u7406\u3002
\u5f00\u53d1\u8005\u53ef\u4ee5\u67e5\u770b\u4ee5\u4e0b\u6587\u6863\uff0c\u83b7\u53d6FnExecuteWindowEventListener
\u6216SimpleFnExecuteWindowEventListener
\u7684\u8be6\u7ec6\u4fe1\u606f\uff1a
FnExecuteWindowEventListener
SimpleFnExecuteWindowEventListener
\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.utils import messagebox\nfrom pyguiadapter.windows.fnexec import (\n FnExecuteWindow,\n SimpleFnExecuteWindowEventListener,\n)\n\n\ndef on_execute_start(window: FnExecuteWindow):\n print(\"on_execute_start()\")\n\n\ndef on_execute_result(window: FnExecuteWindow, result) -> bool:\n print(f\"on_execute_result(): {result}\")\n messagebox.show_info_message(window, message=f\"Result: {result}\", title=\"Result\")\n return False\n\n\ndef on_execute_error(window: FnExecuteWindow, error) -> bool:\n print(f\"on_execute_error(): {error}\")\n messagebox.show_exception_messagebox(window, error)\n return False\n\n\ndef on_execute_finish(window: FnExecuteWindow):\n print(\"on_execute_finish()\")\n\n\ndef event_example_3(a: int = 1, b: int = 1):\n return a / b\n\n\nif __name__ == \"__main__\":\n event_listener = SimpleFnExecuteWindowEventListener(\n on_execute_start=on_execute_start,\n on_execute_result=on_execute_result,\n on_execute_error=on_execute_error,\n on_execute_finish=on_execute_finish,\n )\n adapter = GUIAdapter()\n adapter.add(event_example_3, window_listener=event_listener)\n adapter.run()\n
\u6ce8\u610f\u5230\uff0c\u5728\u672c\u793a\u4f8b\u4e2d\uff0con_execute_result()
\u548con_execute_error()
\u56de\u8c03\u51fd\u6570\u5747\u8fd4\u56de\u4e86False
\u3002
\u8fd9\u8868\u793a\u5c06\u7531\u5f00\u53d1\u8005\u81ea\u884c\u5904\u7406\u51fd\u6570\u8fd4\u56de\u7ed3\u679c\u6216\u51fd\u6570\u6267\u884c\u5f02\u5e38\uff0c\u800c\u4e0d\u4f1a\u6267\u884c\u9ed8\u8ba4\u7684\u5904\u7406\u903b\u8f91\uff0c\u5177\u4f53\u800c\u8a00\uff0cPyGUIAdapter
\u5c06\u4e0d\u4f1a\u628a\u51fd\u6570\u6267\u884c\u7ed3\u679c\u6216\u51fd\u6570\u5f02\u5e38\u4fe1\u606f\u6253\u5370\u5230\u8f93\u51fa\u6d4f\u89c8\u5668\u4e2d\u3002
\u4e0b\u9762\u662f\u8be5\u7a0b\u5e8f\u7684\u8fd0\u884c\u6548\u679c\uff1a
\uff081\uff09\u5f53\u51fd\u6570\u6b63\u5e38\u8fd4\u56de\u65f6
\uff082\uff09\u5f53\u51fd\u6570\u53d1\u751f\u5f02\u5e38\u65f6
"},{"location":"window/#4_1","title":"4\u3001\u6dfb\u52a0\u83dc\u5355\u548c\u5de5\u5177\u680f","text":"\u5f00\u53d1\u8005\u53ef\u4ee5\u4e3aFnExecuteWindow
\u6dfb\u52a0\u5de5\u5177\u680f\u548c\u83dc\u5355\u680f\uff0c\u5177\u4f53\u65b9\u6cd5\u5982\u4e0b\uff1a
from pyguiadapter.action import Action, Separator\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.menu import Menu\nfrom pyguiadapter.toolbar import ToolBar\nfrom pyguiadapter.windows.fnexec import FnExecuteWindow\nfrom pyguiadapter.utils import messagebox, filedialog\n\n\ndef on_action_about(window: FnExecuteWindow, _: Action):\n messagebox.show_info_message(\n parent=window,\n message=\"This is an example of toolbar and menu with custom actions.\",\n title=\"About\",\n )\n\n\ndef on_action_close(window: FnExecuteWindow, _: Action):\n ret = messagebox.show_question_message(\n window, \"Are you sure you want to quit?\", buttons=messagebox.Yes | messagebox.No\n )\n if ret == messagebox.Yes:\n window.close()\n\n\ndef on_action_open(window: FnExecuteWindow, _: Action):\n ret = filedialog.get_open_file(\n window,\n title=\"Open File\",\n start_dir=\"./\",\n filters=\"JSON files(*.json);;Python files(*.py);;All files(*.*)\",\n )\n if not ret:\n return\n messagebox.show_info_message(window, f\"File will be opened: {ret}\")\n\n\ndef on_action_save(window: FnExecuteWindow, _: Action):\n ret = filedialog.get_save_file(\n window,\n title=\"Save File\",\n start_dir=\"./\",\n filters=\"JSON files(*.json);;All files(*.*)\",\n )\n if not ret:\n return\n messagebox.show_info_message(window, f\"File will be saved: {ret}\")\n\n\ndef on_action_auto_theme(window: FnExecuteWindow, _: Action, checked: bool):\n if checked:\n messagebox.show_info_message(window, \"Auto theme is selected.\")\n\n\ndef on_action_light_theme(window: FnExecuteWindow, _: Action, checked: bool):\n if checked:\n messagebox.show_info_message(window, \"Light theme is selected.\")\n\n\ndef on_action_dark_theme(window: FnExecuteWindow, _: Action, checked: bool):\n if checked:\n messagebox.show_info_message(window, \"Dark theme is selected.\")\n\n\naction_about = Action(\n text=\"About\",\n icon=\"fa.info-circle\",\n on_triggered=on_action_about,\n)\n\naction_open = Action(\n text=\"Open\",\n icon=\"fa.folder-open\",\n shortcut=\"Ctrl+O\",\n on_triggered=on_action_open,\n)\n\naction_save = Action(\n text=\"Save\",\n icon=\"fa.save\",\n shortcut=\"Ctrl+S\",\n on_triggered=on_action_save,\n)\n\naction_close = Action(\n text=\"Quit\",\n icon=\"fa.close\",\n shortcut=\"Ctrl+Q\",\n on_triggered=on_action_close,\n)\n\naction_auto_them = Action(\n text=\"Auto\",\n checkable=True,\n checked=True,\n on_toggled=on_action_auto_theme,\n)\n\naction_light_theme = Action(\n text=\"Light\",\n checkable=True,\n on_toggled=on_action_light_theme,\n)\n\naction_dark_theme = Action(\n text=\"Dark\",\n checkable=True,\n on_toggled=on_action_dark_theme,\n)\n\nsubmenu_theme = Menu(\n title=\"Theme\",\n actions=[action_auto_them, action_light_theme, action_dark_theme],\n exclusive=True,\n)\nmenu_file = Menu(\n title=\"File\",\n actions=[\n action_open,\n action_save,\n Separator(),\n action_close,\n Separator(),\n submenu_theme,\n ],\n)\nmenu_help = Menu(\n title=\"Help\",\n actions=[action_about],\n)\n\n\ndef menu_toolbar_example(arg1: int, arg2: str, arg3: bool):\n \"\"\"\n This example shows how to add and config toolbar and menus to the window.\n @param arg1:\n @param arg2:\n @param arg3:\n @return:\n \"\"\"\n pass\n\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(\n menu_toolbar_example,\n window_menus=[menu_file, menu_help],\n window_toolbar=ToolBar(\n actions=[action_open, action_save, Separator(), action_close]\n ),\n )\n adapter.run()\n
\u6548\u679c\u5982\u4e0b\uff1a
"},{"location":"window/#5_1","title":"5\u3001\u4e3b\u8981\u63a5\u53e3","text":"\u51fd\u6570\u6267\u884c\u7a97\u53e3\uff08FnExecuteWindow\uff09
\u63d0\u4f9b\u4e86\u5927\u91cf\u63a5\u53e3\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u52a8\u4f5c\uff08Action\uff09
\u56de\u8c03\u51fd\u6570\u6216\u7a97\u53e3\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u8c03\u7528\u8fd9\u4e9b\u63a5\u53e3\u3002\u501f\u52a9\u8fd9\u4e9b\u63a5\u53e3\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5b9e\u73b0\u76f8\u5f53\u590d\u6742\u7684\u529f\u80fd\uff0c\u6bd4\u5982\u52a8\u6001\u8bbe\u7f6e/\u83b7\u53d6\u53c2\u6570\u7684\u5f53\u524d\u503c\uff0c\u8bbe\u7f6e\u662f\u52a8\u6001\u589e\u52a0/\u5220\u9664\u53c2\u6570\u63a7\u4ef6\u3002
\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u6587\u6863\u83b7\u53d6\u8fd9\u4e9b\u63a5\u53e3\u7684\u5177\u4f53\u4fe1\u606f\uff1a
- pyguiadapter.windows.fnexec.FnExecuteWindow\u3002
\u4e0b\u9762\uff0c\u901a\u8fc7\u4e00\u4e9b\u793a\u4f8b\u6765\u8bf4\u660e\u8fd9\u4e9b\u63a5\u53e3\u7684\u4f7f\u7528\u3002
"},{"location":"window/#1_3","title":"\uff081\uff09\u793a\u4f8b\uff1a\u52a0\u8f7d\u548c\u4fdd\u5b58\u5f53\u524d\u53c2\u6570","text":"\u4e0b\u9762\u7ed3\u5408\u83dc\u5355\u7684\u4f7f\u7528\uff0c\u5b9e\u73b0\u53c2\u6570\u7684\u4fdd\u5b58\u548c\u52a0\u8f7d\u7684\u6548\u679c\u3002
import json\n\nfrom typing import Dict, Any\n\nfrom pyguiadapter.action import Action\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import uprint\nfrom pyguiadapter.exceptions import ParameterError\nfrom pyguiadapter.extend_types import color_t\nfrom pyguiadapter.menu import Menu\nfrom pyguiadapter.utils import messagebox, filedialog\nfrom pyguiadapter.windows.fnexec import FnExecuteWindow\n\n\ndef simple_load_save_example(\n arg1: int,\n arg2: float,\n arg3: bool,\n arg4: str,\n arg5: color_t,\n):\n \"\"\"\n This example shows how to save current parameter values to a json file and load a parameter values from a json file.\n @param arg1:\n @param arg2:\n @param arg3:\n @param arg4:\n @param arg5:\n @return:\n \"\"\"\n uprint(\"arg1=\", arg1)\n uprint(\"arg2=\", arg2)\n uprint(\"arg3=\", arg3)\n uprint(\"arg4=\", arg4)\n uprint(\"arg5=\", arg5)\n\n\ndef on_save_params(window: FnExecuteWindow, _: Action):\n # Step 1: obtain current parameter values from widgets\n #\n # if the current input in the widgets of some parameter is invalid, the get_parameter_values() method may raise a\n # exception. A good practice is to catch the exception and handle it properly:\n # - for ParameterError, the FnExecuteWindow has a builtin logic to deal with it, so just call the\n # process_parameter_error() method and let the window do the job.\n #\n # - for other exceptions, we need handle it by ourselves. Here we choose to show the exception message with a\n # message box to the user.\n\n try:\n params: Dict[str, Any] = window.get_parameter_values()\n except ParameterError as e:\n window.process_parameter_error(e)\n return\n except Exception as e:\n messagebox.show_exception_messagebox(\n window, e, message=\"Unable to get the parameters: \"\n )\n return\n\n # Step2: serialize the parameter values and save them to a json file\n #\n # In this example, because we don't use any complex types, we can use simply json.dump() to do the serialization.\n # However, If your function contains parameters of complex types, such as list, tuple, set, dict, enum, then\n # serialization and deserialization must be considered very carefully.\n #\n save_file = filedialog.get_save_file(\n window, \"Save Parameters\", filters=\"JSON files(*.json)\"\n )\n if not save_file:\n return\n try:\n with open(save_file, \"w\") as f:\n json.dump(params, f)\n except Exception as e:\n messagebox.show_exception_messagebox(\n window, e, message=\"Unable to save the parameters: \"\n )\n else:\n messagebox.show_info_message(window, \"Parameters have been saved!\")\n\n\ndef on_load_params(window: FnExecuteWindow, _: Action):\n # Step 1: load the parameter values from a json file\n file = filedialog.get_open_file(\n window, \"Load Parameters\", filters=\"JSON files(*.json)\"\n )\n if not file:\n return\n try:\n with open(file, \"r\") as f:\n params: Dict[str, Any] = json.load(f)\n except Exception as e:\n messagebox.show_exception_messagebox(\n window, e, message=\"Unable to load the parameters: \"\n )\n return\n if not isinstance(params, dict):\n messagebox.show_critical_message(window, message=\"Invalid parameters format!\")\n return\n\n # Step2: set the parameter values to the widgets\n try:\n window.set_parameter_values(params)\n except ParameterError as e:\n window.process_parameter_error(e)\n return\n except Exception as e:\n messagebox.show_exception_messagebox(\n window, e, message=\"Unable to set the parameters: \"\n )\n else:\n messagebox.show_info_message(window, \"Parameters have been loaded!\")\n\n\nif __name__ == \"__main__\":\n action_save_params = Action(\n text=\"Save Parameters\",\n icon=\"fa.save\",\n shortcut=\"Ctrl+S\",\n on_triggered=on_save_params,\n )\n\n action_load_params = Action(\n text=\"Load Parameters\",\n icon=\"fa.folder-open\",\n shortcut=\"Ctrl+L\",\n on_triggered=on_load_params,\n )\n\n menu = Menu(\n title=\"File\",\n actions=[action_save_params, action_load_params],\n )\n\n adapter = GUIAdapter()\n adapter.add(simple_load_save_example, window_menus=[menu])\n adapter.run()\n
\u9700\u8981\u8bf4\u660e\u7684\u662f\uff0c\u4e0a\u9762\u6f14\u793a\u7684\u53ea\u662f\u6bd4\u8f83\u7b80\u5355\u7684\u60c5\u5f62\uff0c\u51fd\u6570\u53ea\u5305\u542b\u4e00\u4e9b\u7b80\u5355\u7c7b\u578b\u7684\u53c2\u6570\uff0c\u56e0\u6b64\u53ef\u4ee5\uff08\u51e0\u4e4e\uff09\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528json
\u5bf9get_parameter_values()
\u83b7\u53d6\u5230\u7684\u503c\u8fdb\u884c\u5e8f\u5217\u5316\u548c\u53cd\u5e8f\u5217\u5316\u3002\u7136\u800c\uff0c\u4e00\u65e6\u5305\u542b\u66f4\u4e3a\u590d\u6742\u7684\u7c7b\u578b\uff0c\u4f8b\u5982dict
\u3001list
\u3001tuple
\u3001set
\u3001Enum
\u7b49\uff0c\u90a3\u4e48\u5c31\u9700\u8981\u8ba4\u771f\u8003\u8651\u5e8f\u5217\u5316\u548c\u53cd\u5e8f\u5217\u5316\u7684\u95ee\u9898\u4e86\u3002\u5f53\u7136\uff0c\u65b9\u6848\u6709\u5f88\u591a\uff0c\u5982pickle
\u3001jsonpickle
\u7b49\uff0c\u5177\u4f53\u7684\u505a\u6cd5\u4e00\u5b9a\u662f\u548c\u5177\u4f53\u7684\u573a\u666f\u7ed3\u5408\u8d77\u6765\u7684\uff0c\u8fd9\u91cc\u65e0\u6cd5\u5c55\u5f00\uff0c\u4ec5\u4ec5\u662f\u505a\u4e00\u4e2a\u63d0\u793a\u3002
\u53e6\u5916\uff0c\u5728\u4ee5\u4e0a\u4ee3\u7801\u4e2d\uff0c\u6709\u5f88\u5927\u4e00\u90e8\u5206\u662f\u5728\u505a\u5f02\u5e38\u5904\u7406\uff0c\u8fd9\u4e00\u65b9\u9762\u8fd9\u662f\u4e3a\u4e86\u8bf4\u660e\u5f02\u5e38\u5904\u7406\u7684\u91cd\u8981\u6027\uff0c\u53e6\u4e00\u65b9\u9762\u4e5f\u662f\u4e3a\u4e86\u6f14\u793a\u5982\u4f55\u8fd0\u7528utils
\u5305\u63d0\u4f9b\u7684\u5b9e\u7528\u51fd\u6570\u3002
\u5173\u4e8eParameterError
\uff1a\u51fa\u73b0\u8fd9\u7c7b\u5f02\u5e38\u4e3b\u8981\u662f\u56e0\u4e3a\u4ece\u63a7\u4ef6\u83b7\u53d6/\u8bbe\u7f6e\u53c2\u6570\u503c\u65f6\u9047\u5230\u4e86\u975e\u6cd5\u7684\u8f93\u5165\u3002\u56e0\u4e3a\u8fd9\u79cd\u9519\u8bef\u6bd4\u8f83\u5e38\u89c1\uff0c\u6240\u4ee5FnExecuteWindow
\u4e3a\u5176\u5185\u5efa\u4e86\u4e00\u5957\u5904\u7406\u6d41\u7a0b\uff0c\u5f53\u6355\u83b7\u5230\u6b64\u7c7b\u5f02\u5e38\u65f6\uff0c\u5982\u65e0\u9700\u8fdb\u884c\u7279\u522b\u5904\u7406\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528process_parameter_error()
\u3002
"},{"location":"window/#2dock","title":"\uff082\uff09\u793a\u4f8b\uff1a\u8c03\u6574Dock\u7a97\u53e3\uff08\u9690\u85cf/\u663e\u793a/\u8c03\u6574\u4f4d\u7f6e......\uff09","text":"from pyguiadapter.action import Action, Separator\nfrom pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.menu import Menu\nfrom pyguiadapter.windows.fnexec import (\n FnExecuteWindow,\n BottomDockWidgetArea,\n)\n\n\ndef dock_operation_example() -> None:\n pass\n\n\ndef on_toggle_document_dock(win: FnExecuteWindow, action: Action):\n win.set_document_dock_property(visible=not win.is_document_dock_visible())\n\n\ndef on_toggle_output_dock(win: FnExecuteWindow, action: Action):\n win.set_output_dock_property(visible=not win.is_output_dock_visible())\n\n\ndef on_tabify_docks(win: FnExecuteWindow, action: Action):\n win.tabify_docks()\n\n\ndef on_move_output_area(win: FnExecuteWindow, action: Action):\n if win.is_output_dock_floating():\n win.set_output_dock_property(floating=False)\n win.set_output_dock_property(area=BottomDockWidgetArea)\n\n\ndef on_float_output_dock(win: FnExecuteWindow, action: Action):\n win.set_output_dock_property(floating=True)\n\n\ndef main():\n action_document_dock = Action(\n text=\"Toggle Document Dock\",\n on_triggered=on_toggle_document_dock,\n )\n action_output_dock = Action(\n text=\"Toggle Output Dock\",\n on_triggered=on_toggle_output_dock,\n )\n action_tabify_docks = Action(\n text=\"Tabify Docks\",\n on_triggered=on_tabify_docks,\n )\n action_move_output_area = Action(\n text=\"Move Output Area\",\n on_triggered=on_move_output_area,\n )\n action_float_output_dock = Action(\n text=\"Float Output Dock\",\n on_triggered=on_float_output_dock,\n )\n menu_views = Menu(\n title=\"Views\",\n actions=[\n action_document_dock,\n action_output_dock,\n Separator(),\n action_tabify_docks,\n action_move_output_area,\n action_float_output_dock,\n ],\n )\n ##########\n adapter = GUIAdapter()\n adapter.add(dock_operation_example, window_menus=[menu_views])\n adapter.run()\n\n\nif __name__ == \"__main__\":\n main()\n
"},{"location":"apis/pyguiadapter.action/","title":"pyguiadapter.action","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action","title":"Action
dataclass
","text":" Bases: object
\u8be5\u7c7b\u7528\u4e8e\u521b\u5efa\u52a8\u4f5c\uff08Action
\uff09\uff0c\u5728\u5de5\u5177\u680f\uff08ToolBar
\uff09\u4e2d\u4e00\u4e2aAction
\u4ee3\u8868\u4e00\u4e2a\u5de5\u5177\u680f\u6309\u94ae\uff0c\u5728\u83dc\u5355\uff08Menu
\uff09\u4e2d\uff0c\u4e00\u4e2aAction
\u4ee3\u8868\u4e00\u4e2a\u83dc\u5355\u9879\u3002
Source code in pyguiadapter\\action.py
@dataclasses.dataclass\nclass Action(object):\n \"\"\"\u8be5\u7c7b\u7528\u4e8e\u521b\u5efa\u52a8\u4f5c\uff08`Action`\uff09\uff0c\u5728\u5de5\u5177\u680f\uff08`ToolBar`\uff09\u4e2d\u4e00\u4e2a`Action`\u4ee3\u8868\u4e00\u4e2a\u5de5\u5177\u680f\u6309\u94ae\uff0c\u5728\u83dc\u5355\uff08`Menu`\uff09\u4e2d\uff0c\u4e00\u4e2a`Action`\u4ee3\u8868\u4e00\u4e2a\u83dc\u5355\u9879\u3002\"\"\"\n\n text: str\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u7684\u63cf\u8ff0\u6027\u6587\u672c\u3002\"\"\"\n\n on_triggered: Optional[ActionTriggeredCallback] = None\n \"\"\"\u56de\u8c03\u51fd\u6570\uff0c\u5728\u52a8\u4f5c\uff08`Action`\uff09\u88ab\u89e6\u53d1\u65f6\u56de\u8c03\u3002\"\"\"\n\n on_toggled: Optional[ActionToggledCallback] = None\n \"\"\"\u56de\u8c03\u51fd\u6570\uff0c\u5728\u52a8\u4f5c\uff08`Action`\uff09\u7684`checked`\u72b6\u6001\u53d1\u751f\u5207\u6362\u65f6\u56de\u8c03\u3002\"\"\"\n\n icon: IconType = None\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u7684\u56fe\u6807\u3002\"\"\"\n\n icon_text: Optional[str] = None\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u7684\u56fe\u6807\u6587\u672c\u3002\"\"\"\n\n auto_repeat: bool = True\n \"\"\"\u6b64\u5c5e\u6027\u8868\u793a\u52a8\u4f5c\uff08`Action`\uff09\u662f\u5426\u53ef\u4ee5\u81ea\u52a8\u91cd\u590d\u3002\u5982\u679c\u8bbe\u7f6e\u4e3a`True`\uff0c\u5e76\u4e14\u7cfb\u7edf\u542f\u7528\u4e86\u952e\u76d8\u81ea\u52a8\u91cd\u590d\u529f\u80fd\uff0c\u90a3\u4e48\u5f53\u7528\u6237\u6301\u7eed\u6309\u4e0b\u952e\u76d8\u5feb\u6377\u952e\u7ec4\u5408\u65f6\uff0c\u8be5\u52a8\u4f5c\u5c06\u81ea\u52a8\u91cd\u590d\u3002\"\"\"\n\n enabled: bool = True\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u662f\u5426\u5904\u4e8e\u542f\u7528\u72b6\u6001\u3002\"\"\"\n\n checkable: bool = False\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u662f\u5426\u4e3a**`\u53ef\u9009\u4e2d\u52a8\u4f5c`**\u3002`\u53ef\u9009\u4e2d\u52a8\u4f5c`\u5177\u6709`\u9009\u4e2d`\u548c`\u672a\u9009\u4e2d`\u4e24\u79cd\u72b6\u6001\uff0c\u5728\u72b6\u6001\u53d1\u751f\u5207\u6362\u65f6\uff0c\u5c06\u89e6\u53d1`on_toggled`\u56de\u8c03\u51fd\u6570\u3002\"\"\"\n\n checked: bool = False\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u662f\u5426\u5904\u4e8e`\u9009\u4e2d`\u72b6\u6001\u3002\"\"\"\n\n shortcut: Optional[str] = None\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u7684\u5feb\u6377\u952e\u3002\"\"\"\n\n shortcut_context: Optional[ShortcutContext] = None\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u5feb\u6377\u952e\u7684\u4e0a\u4e0b\u6587\u3002\"\"\"\n\n tooltip: Optional[str] = None\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u7684\u5de5\u5177\u63d0\u793a\uff0c\u5de5\u5177\u63d0\u793a\u662f\u5728\u7528\u6237\u5c06\u9f20\u6807\u60ac\u505c\u5728\u52a8\u4f5c\u4e0a\u65f6\u663e\u793a\u7684\u989d\u5916\u4fe1\u606f\u3002\"\"\"\n\n whats_this: Optional[str] = None\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u7684\u201cWhat\u2019s This?\u201d \u5e2e\u52a9\u6587\u672c\u3002\"\"\"\n\n status_tip: Optional[str] = None\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u7684\u72b6\u6001\u63d0\u793a\u6587\u672c\uff0c\u72b6\u6001\u63d0\u793a\u6587\u672c\u5c06\u663e\u793a\u5728\u52a8\u4f5c\u6240\u5728\u7a97\u53e3\u7684\u72b6\u6001\u680f\u4e2d\u3002\"\"\"\n\n priority: Optional[Priority] = None\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u5728\u7528\u6237\u754c\u9762\u7684\u4f18\u5148\u7ea7\u3002\"\"\"\n\n menu_role: Optional[MenuRole] = None\n \"\"\"\u52a8\u4f5c\uff08`Action`\uff09\u83dc\u5355\u89d2\u8272\uff08menu role\uff09\u3002\u5728macOS\u5e94\u7528\u7a0b\u5e8f\u83dc\u5355\u4e2d\uff0c\u6bcf\u4e2a\u52a8\u4f5c\u90fd\u6709\u4e00\u4e2a\u89d2\u8272\uff0c\u8be5\u89d2\u8272\u6307\u793a\u4e86\u52a8\u4f5c\u5728\u83dc\u5355\u4e2d\u7684\u7528\u9014\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u6240\u6709\u52a8\u4f5c\n \u90fd\u5177\u6709TextHeuristicRole\u89d2\u8272\uff0c\u8fd9\u610f\u5473\u7740\u52a8\u4f5c\u662f\u6839\u636e\u5176\u6587\u672c\u5185\u5bb9\u88ab\u6dfb\u52a0\u5230\u83dc\u5355\u4e2d\u7684\"\"\"\n\n data: Optional[object] = None\n \"\"\"\u7528\u6237\u81ea\u5b9a\u4e49\u6570\u636e\u3002\"\"\"\n
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.auto_repeat","title":"auto_repeat: bool = True
class-attribute
instance-attribute
","text":"\u6b64\u5c5e\u6027\u8868\u793a\u52a8\u4f5c\uff08Action
\uff09\u662f\u5426\u53ef\u4ee5\u81ea\u52a8\u91cd\u590d\u3002\u5982\u679c\u8bbe\u7f6e\u4e3aTrue
\uff0c\u5e76\u4e14\u7cfb\u7edf\u542f\u7528\u4e86\u952e\u76d8\u81ea\u52a8\u91cd\u590d\u529f\u80fd\uff0c\u90a3\u4e48\u5f53\u7528\u6237\u6301\u7eed\u6309\u4e0b\u952e\u76d8\u5feb\u6377\u952e\u7ec4\u5408\u65f6\uff0c\u8be5\u52a8\u4f5c\u5c06\u81ea\u52a8\u91cd\u590d\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.checkable","title":"checkable: bool = False
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u662f\u5426\u4e3a\u53ef\u9009\u4e2d\u52a8\u4f5c
\u3002\u53ef\u9009\u4e2d\u52a8\u4f5c
\u5177\u6709\u9009\u4e2d
\u548c\u672a\u9009\u4e2d
\u4e24\u79cd\u72b6\u6001\uff0c\u5728\u72b6\u6001\u53d1\u751f\u5207\u6362\u65f6\uff0c\u5c06\u89e6\u53d1on_toggled
\u56de\u8c03\u51fd\u6570\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.checked","title":"checked: bool = False
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u662f\u5426\u5904\u4e8e\u9009\u4e2d
\u72b6\u6001\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.data","title":"data: Optional[object] = None
class-attribute
instance-attribute
","text":"\u7528\u6237\u81ea\u5b9a\u4e49\u6570\u636e\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.enabled","title":"enabled: bool = True
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u662f\u5426\u5904\u4e8e\u542f\u7528\u72b6\u6001\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.icon","title":"icon: IconType = None
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u7684\u56fe\u6807\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.icon_text","title":"icon_text: Optional[str] = None
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u7684\u56fe\u6807\u6587\u672c\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.menu_role","title":"menu_role: Optional[MenuRole] = None
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u83dc\u5355\u89d2\u8272\uff08menu role\uff09\u3002\u5728macOS\u5e94\u7528\u7a0b\u5e8f\u83dc\u5355\u4e2d\uff0c\u6bcf\u4e2a\u52a8\u4f5c\u90fd\u6709\u4e00\u4e2a\u89d2\u8272\uff0c\u8be5\u89d2\u8272\u6307\u793a\u4e86\u52a8\u4f5c\u5728\u83dc\u5355\u4e2d\u7684\u7528\u9014\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u6240\u6709\u52a8\u4f5c \u90fd\u5177\u6709TextHeuristicRole\u89d2\u8272\uff0c\u8fd9\u610f\u5473\u7740\u52a8\u4f5c\u662f\u6839\u636e\u5176\u6587\u672c\u5185\u5bb9\u88ab\u6dfb\u52a0\u5230\u83dc\u5355\u4e2d\u7684
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.on_toggled","title":"on_toggled: Optional[ActionToggledCallback] = None
class-attribute
instance-attribute
","text":"\u56de\u8c03\u51fd\u6570\uff0c\u5728\u52a8\u4f5c\uff08Action
\uff09\u7684checked
\u72b6\u6001\u53d1\u751f\u5207\u6362\u65f6\u56de\u8c03\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.on_triggered","title":"on_triggered: Optional[ActionTriggeredCallback] = None
class-attribute
instance-attribute
","text":"\u56de\u8c03\u51fd\u6570\uff0c\u5728\u52a8\u4f5c\uff08Action
\uff09\u88ab\u89e6\u53d1\u65f6\u56de\u8c03\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.priority","title":"priority: Optional[Priority] = None
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u5728\u7528\u6237\u754c\u9762\u7684\u4f18\u5148\u7ea7\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.shortcut","title":"shortcut: Optional[str] = None
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u7684\u5feb\u6377\u952e\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.shortcut_context","title":"shortcut_context: Optional[ShortcutContext] = None
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u5feb\u6377\u952e\u7684\u4e0a\u4e0b\u6587\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.status_tip","title":"status_tip: Optional[str] = None
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u7684\u72b6\u6001\u63d0\u793a\u6587\u672c\uff0c\u72b6\u6001\u63d0\u793a\u6587\u672c\u5c06\u663e\u793a\u5728\u52a8\u4f5c\u6240\u5728\u7a97\u53e3\u7684\u72b6\u6001\u680f\u4e2d\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.text","title":"text: str
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u7684\u63cf\u8ff0\u6027\u6587\u672c\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.tooltip","title":"tooltip: Optional[str] = None
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u7684\u5de5\u5177\u63d0\u793a\uff0c\u5de5\u5177\u63d0\u793a\u662f\u5728\u7528\u6237\u5c06\u9f20\u6807\u60ac\u505c\u5728\u52a8\u4f5c\u4e0a\u65f6\u663e\u793a\u7684\u989d\u5916\u4fe1\u606f\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Action.whats_this","title":"whats_this: Optional[str] = None
class-attribute
instance-attribute
","text":"\u52a8\u4f5c\uff08Action
\uff09\u7684\u201cWhat\u2019s This?\u201d \u5e2e\u52a9\u6587\u672c\u3002
"},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Separator","title":"Separator
dataclass
","text":" Bases: object
\u4ee3\u8868\u4e86\u4e00\u4e2a\u5206\u5272\u7b26\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u7528\u5176\u6765\u5206\u5272\u5de5\u5177\u680f\u4e0a\u548c\u83dc\u5355\u680f\u4e0a\u7684\u52a8\u4f5c\uff08Action
\uff09
Source code in pyguiadapter\\action.py
@dataclasses.dataclass(frozen=True)\nclass Separator(object):\n \"\"\"\u4ee3\u8868\u4e86\u4e00\u4e2a\u5206\u5272\u7b26\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u7528\u5176\u6765\u5206\u5272\u5de5\u5177\u680f\u4e0a\u548c\u83dc\u5355\u680f\u4e0a\u7684\u52a8\u4f5c\uff08`Action`\uff09\"\"\"\n\n pass\n
"},{"location":"apis/pyguiadapter.action/#_1","title":"\u7c7b\u578b\u4e0e\u5e38\u91cf","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.ActionTriggeredCallback","title":"ActionTriggeredCallback = Callable[[BaseWindow_, Action_], None]
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.ActionToggledCallback","title":"ActionToggledCallback = Callable[[BaseWindow_, Action_, bool], None]
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.Priority","title":"Priority = QAction.Priority
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.HighPriority","title":"HighPriority = QAction.HighPriority
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.NormalPriority","title":"NormalPriority = QAction.NormalPriority
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.LowPriority","title":"LowPriority = QAction.LowPriority
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.MenuRole","title":"MenuRole = QAction.MenuRole
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.NoRole","title":"NoRole = QAction.NoRole
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.TextHeuristicRole","title":"TextHeuristicRole = QAction.TextHeuristicRole
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.ApplicationSpecificRole","title":"ApplicationSpecificRole = QAction.ApplicationSpecificRole
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.AboutQtRole","title":"AboutQtRole = QAction.AboutQtRole
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.AboutRole","title":"AboutRole = QAction.AboutRole
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.PreferencesRole","title":"PreferencesRole = QAction.PreferencesRole
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.QuitRole","title":"QuitRole = QAction.QuitRole
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.ShortcutContext","title":"ShortcutContext = Qt.ShortcutContext
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.WidgetShortcut","title":"WidgetShortcut = Qt.WidgetShortcut
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.WidgetWithChildrenShortcut","title":"WidgetWithChildrenShortcut = Qt.WidgetWithChildrenShortcut
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.WindowShortcut","title":"WindowShortcut = Qt.WindowShortcut
module-attribute
","text":""},{"location":"apis/pyguiadapter.action/#pyguiadapter.action.ApplicationShortcut","title":"ApplicationShortcut = Qt.ApplicationShortcut
module-attribute
","text":""},{"location":"apis/pyguiadapter.adapter.adapter/","title":"pyguiadapter.adapter.adapter","text":""},{"location":"apis/pyguiadapter.adapter.adapter/#pyguiadapter.adapter.GUIAdapter","title":"GUIAdapter
","text":" Bases: object
GUI\u9002\u914d\u5668\u7c7b\uff0c\u8d1f\u8d23\u7ba1\u7406\u51fd\u6570\u548c\u542f\u52a8GUI\u5e94\u7528\u3002
"},{"location":"apis/pyguiadapter.adapter.adapter/#pyguiadapter.adapter.GUIAdapter.__init__","title":"__init__(*, hdpi_mode: bool = True, global_stylesheet: Union[str, Callable[[], str], None] = None, on_app_start: Optional[Callable[[QApplication], None]] = None, on_app_shutdown: Optional[Callable] = None)
","text":"GUIAdapter
\u6784\u9020\u51fd\u6570\u3002\u7528\u4e8e\u521b\u5efaGUIAdapter
\u5b9e\u4f8b\u3002
Parameters:
Name Type Description Default hdpi_mode
bool
\u542f\u7528\u9ad8DPI\u6a21\u5f0f\u3002\u67d0\u4e9bQt\u7248\u672c\u4e0a\uff0c\u8be5\u53c2\u6570\u4e0d\u751f\u6548\u3002
True
global_stylesheet
Union[str, Callable[[], str], None]
\u5e94\u7528\u5168\u5c40\u6837\u5f0f\u3002\u53ef\u4ee5\u4e3a\u6837\u5f0f\u8868\u5b57\u7b26\u4e32\uff0c\u4e5f\u53ef\u4ee5\u4e3a\u4e00\u4e2a\u8fd4\u56de\u5168\u5c40\u6837\u5f0f\u8868\u5b57\u7b26\u4e32\u7684\u51fd\u6570\u3002
None
on_app_start
Optional[Callable[[QApplication], None]]
\u5e94\u7528\u542f\u52a8\u56de\u8c03\u51fd\u6570\u3002\u5728\u5e94\u7528\u542f\u52a8\u65f6\u8c03\u7528\u3002
None
on_app_shutdown
Optional[Callable]
\u5e94\u7528\u505c\u6b62\u56de\u8c03\u51fd\u6570\u3002\u5728\u5e94\u7528\u505c\u6b62\u65f6\u8c03\u7528\u3002
None
Examples:
from pyguiadapter.adapter import GUIAdapter\n\ndef foo(a: int, b: int, c: str):\n pass\n\nadapter = GUIAdapter()\nadapter.add(foo)\nadapter.run()\n
"},{"location":"apis/pyguiadapter.adapter.adapter/#pyguiadapter.adapter.GUIAdapter.add","title":"add(fn: Callable, display_name: Optional[str] = None, group: Optional[str] = None, icon: IconType = None, document: Optional[str] = None, document_format: Literal['markdown', 'html', 'plaintext'] = 'markdown', cancelable: bool = False, *, widget_configs: Optional[Dict[str, Union[BaseParameterWidgetConfig, dict]]] = None, window_config: Optional[FnExecuteWindowConfig] = None, window_listener: Optional[BaseWindowEventListener] = None, window_toolbar: Optional[ToolBar] = None, window_menus: Optional[List[Union[Menu, Separator]]] = None) -> None
","text":"\u6dfb\u52a0\u4e00\u4e2a\u51fd\u6570\u3002
Parameters:
Name Type Description Default fn
Callable
\u5f85\u6dfb\u52a0\u7684\u51fd\u6570\u3002
required display_name
Optional[str]
\u51fd\u6570\u7684\u663e\u793a\u540d\u79f0\u3002\u5982\u679c\u4e0d\u6307\u5b9a\uff0c\u5219\u4f7f\u7528\u51fd\u6570\u7684\u540d\u79f0\u3002
None
group
Optional[str]
\u51fd\u6570\u6240\u5c5e\u7684\u5206\u7ec4\u3002\u5982\u679c\u4e0d\u6307\u5b9a\uff0c\u5219\u5c06\u51fd\u6570\u6dfb\u52a0\u5230\u9ed8\u8ba4\u5206\u7ec4\u3002
None
icon
IconType
\u51fd\u6570\u7684\u56fe\u6807\u3002\u53ef\u4ee5\u4e3a\u6587\u4ef6\u8def\u5f84\uff0c\u4e5f\u53ef\u4f7f\u7528QtAwesome\u652f\u6301\u7684\u56fe\u6807\u540d\u79f0\u3002
None
document
Optional[str]
\u51fd\u6570\u7684\u8bf4\u660e\u6587\u6863\u3002\u82e5\u4e0d\u6307\u5b9a\uff0c\u5219\u5c1d\u8bd5\u63d0\u53d6\u51fd\u6570\u7684docstring\u4f5c\u4e3a\u6587\u6863\u3002
None
document_format
Literal['markdown', 'html', 'plaintext']
\u51fd\u6570\u8bf4\u660e\u6587\u6863\u7684\u683c\u5f0f\u3002\u53ef\u4ee5\u4e3a\"markdown\"\u3001\"html\"\u6216\"plaintext\"\u3002
'markdown'
cancelable
bool
\u51fd\u6570\u662f\u5426\u53ef\u53d6\u6d88\u3002
False
widget_configs
Optional[Dict[str, Union[BaseParameterWidgetConfig, dict]]]
\u51fd\u6570\u53c2\u6570\u63a7\u4ef6\u914d\u7f6e\u3002\u952e\u4e3a\u53c2\u6570\u540d\uff0c\u503c\u4e3a\u53c2\u6570\u63a7\u4ef6\u914d\u7f6e\u3002
None
window_config
Optional[FnExecuteWindowConfig]
\u7a97\u53e3\u914d\u7f6e\u3002
None
window_listener
Optional[BaseWindowEventListener]
\u7a97\u53e3\u4e8b\u4ef6\u76d1\u542c\u5668\u3002
None
window_toolbar
Optional[ToolBar]
\u7a97\u53e3\u7684\u5de5\u5177\u680f\u3002
None
window_menus
Optional[List[Union[Menu, Separator]]]
\u7a97\u53e3\u83dc\u5355\u5217\u8868\u3002
None
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.adapter/#pyguiadapter.adapter.GUIAdapter.exists","title":"exists(fn: Callable) -> bool
","text":"\u5224\u65ad\u51fd\u6570\u662f\u5426\u5df2\u6dfb\u52a0\u3002
Parameters:
Name Type Description Default fn
Callable
\u76ee\u6807\u51fd\u6570
required Returns:
Type Description bool
\u51fd\u6570\u662f\u5426\u5df2\u6dfb\u52a0
"},{"location":"apis/pyguiadapter.adapter.adapter/#pyguiadapter.adapter.GUIAdapter.remove","title":"remove(fn: Callable) -> None
","text":"\u79fb\u9664\u4e00\u4e2a\u5df2\u6dfb\u52a0\u7684\u51fd\u6570\u3002
Parameters:
Name Type Description Default fn
Callable
\u5f85\u79fb\u9664\u7684\u51fd\u6570\u3002
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.adapter/#pyguiadapter.adapter.GUIAdapter.run","title":"run(argv: Optional[Sequence[str]] = None, *, show_select_window: bool = False, select_window_config: Optional[FnSelectWindowConfig] = None, select_window_listener: Optional[BaseWindowEventListener] = None, select_window_toolbar: Optional[ToolBar] = None, select_window_menus: Optional[List[Union[Menu, Separator]]] = None) -> None
","text":"\u542f\u52a8GUI\u5e94\u7528\u3002
Parameters:
Name Type Description Default argv
Optional[Sequence[str]]
\u4f20\u9012\u7ed9QApplication\u7684\u547d\u4ee4\u884c\u53c2\u6570\u3002
None
show_select_window
bool
\u662f\u5426\u5f3a\u5236\u663e\u793a\u51fd\u6570\u9009\u62e9\u7a97\u53e3\uff0c\u5f53\u6dfb\u52a0\u7684\u51fd\u6570\u6570\u91cf\u5927\u4e8e1\u65f6\uff0c\u9ed8\u8ba4\u663e\u793a\u3002
False
select_window_config
Optional[FnSelectWindowConfig]
\u51fd\u6570\u9009\u62e9\u7a97\u53e3\u914d\u7f6e\u3002
None
select_window_listener
Optional[BaseWindowEventListener]
\u51fd\u6570\u9009\u62e9\u7a97\u53e3\u4e8b\u4ef6\u76d1\u542c\u5668\u3002
None
select_window_toolbar
Optional[ToolBar]
\u51fd\u6570\u9009\u62e9\u7a97\u53e3\u7684\u5de5\u5177\u680f\u3002
None
select_window_menus
Optional[List[Union[Menu, Separator]]]
\u51fd\u6570\u9009\u62e9\u7a97\u53e3\u83dc\u5355\u5217\u8868\u3002
None
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.ubeep/","title":"pyguiadapter.adapter.ubeep","text":""},{"location":"apis/pyguiadapter.adapter.ubeep/#_1","title":"\u6a21\u5757\u7ea7\u65b9\u6cd5","text":""},{"location":"apis/pyguiadapter.adapter.ubeep/#pyguiadapter.adapter.ubeep.beep","title":"beep() -> None
","text":"\u53d1\u51fa\u8702\u9e23\u58f0\u3002
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uclipboard/","title":"pyguiadapter.adapter.uclipboard","text":""},{"location":"apis/pyguiadapter.adapter.uclipboard/#_1","title":"\u6a21\u5757\u7ea7\u65b9\u6cd5","text":""},{"location":"apis/pyguiadapter.adapter.uclipboard/#pyguiadapter.adapter.uclipboard.get_text","title":"get_text() -> Optional[str]
","text":"\u83b7\u53d6\u7cfb\u7edf\u526a\u8d34\u677f\u4e2d\u7684\u6587\u672c\u5185\u5bb9\u3002
Returns:
Type Description Optional[str]
\u7cfb\u7edf\u526a\u8d34\u677f\u4e2d\u5f53\u524d\u6587\u672c\uff0c\u5982\u679c\u526a\u8d34\u677f\u4e3a\u7a7a\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uclipboard/#pyguiadapter.adapter.uclipboard.set_text","title":"set_text(text: str) -> None
","text":"\u8bbe\u7f6e\u7cfb\u7edf\u526a\u8d34\u677f\u4e2d\u5f53\u524d\u6587\u672c\u3002
Parameters:
Name Type Description Default text
str
\u8981\u8bbe\u7f6e\u7684\u6587\u672c
required Returns: \u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.ucontext/","title":"pyguiadapter.adapter.ucontext","text":""},{"location":"apis/pyguiadapter.adapter.ucontext/#_1","title":"\u6a21\u5757\u7ea7\u65b9\u6cd5","text":""},{"location":"apis/pyguiadapter.adapter.ucontext/#pyguiadapter.adapter.ucontext.is_function_cancelled","title":"is_function_cancelled() -> bool
","text":"\u68c0\u6d4b\u51fd\u6570\u662f\u5426\u88ab\u7528\u6237\u53d6\u6d88\u3002
Returns:
Type Description bool
\u68c0\u6d4b\u5230\u7528\u6237\u53d1\u51fa\u53d6\u6d88\u51fd\u6570\u6267\u884c\u7684\u8bf7\u6c42\u65f6\u8fd4\u56deTrue
\uff0c\u5426\u5219\u8fd4\u56deFalse
"},{"location":"apis/pyguiadapter.adapter.udialog/","title":"pyguiadapter.adapter.udialog","text":""},{"location":"apis/pyguiadapter.adapter.udialog/#_1","title":"\u6a21\u5757\u7ea7\u65b9\u6cd5","text":""},{"location":"apis/pyguiadapter.adapter.udialog/#pyguiadapter.adapter.udialog.show_info_messagebox","title":"show_info_messagebox(text: str, title: str = 'Information', buttons: Union[StandardButton, int] = Ok, default_button: Union[StandardButton, int] = Ok, **kwargs) -> Union[int, StandardButton]
","text":"\u5f39\u51faInformation\u6d88\u606f\u5bf9\u8bdd\u6846\u3002
Parameters:
Name Type Description Default text
str
\u6d88\u606f\u6587\u672c
required title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Information'
buttons
Union[StandardButton, int]
\u5bf9\u8bdd\u6846\u7684\u6309\u94ae
Ok
default_button
Union[StandardButton, int]
\u9ed8\u8ba4\u6309\u94ae
Ok
**kwargs
\u5176\u4ed6\u53c2\u6570
{}
Returns:
Type Description Union[int, StandardButton]
\u8fd4\u56de\u7528\u6237\u6309\u4e0b\u7684\u6309\u94ae\u3002
"},{"location":"apis/pyguiadapter.adapter.udialog/#pyguiadapter.adapter.udialog.show_warning_messagebox","title":"show_warning_messagebox(text: str, title: str = 'Warning', buttons: Union[StandardButton, int] = Ok, default_button: Union[StandardButton, int] = Ok, **kwargs) -> Union[int, StandardButton]
","text":"\u5f39\u51faWarning\u6d88\u606f\u5bf9\u8bdd\u6846\u3002
Parameters:
Name Type Description Default text
str
\u6d88\u606f\u6587\u672c
required title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Warning'
buttons
Union[StandardButton, int]
\u5bf9\u8bdd\u6846\u7684\u6309\u94ae
Ok
default_button
Union[StandardButton, int]
\u9ed8\u8ba4\u6309\u94ae
Ok
**kwargs
\u5176\u4ed6\u53c2\u6570
{}
Returns:
Type Description Union[int, StandardButton]
\u8fd4\u56de\u7528\u6237\u6309\u4e0b\u7684\u6309\u94ae\u3002
"},{"location":"apis/pyguiadapter.adapter.udialog/#pyguiadapter.adapter.udialog.show_critical_messagebox","title":"show_critical_messagebox(text: str, title: str = 'Critical', buttons: Union[StandardButton, int] = Ok, default_button: Union[StandardButton, int] = NoButton, **kwargs) -> Union[int, StandardButton]
","text":"\u5f39\u51faCritical\u6d88\u606f\u5bf9\u8bdd\u6846\u3002
Parameters:
Name Type Description Default text
str
\u6d88\u606f\u6587\u672c
required title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Critical'
buttons
Union[StandardButton, int]
\u5bf9\u8bdd\u6846\u7684\u6309\u94ae
Ok
default_button
Union[StandardButton, int]
\u9ed8\u8ba4\u6309\u94ae
NoButton
**kwargs
\u5176\u4ed6\u53c2\u6570
{}
Returns:
Type Description Union[int, StandardButton]
\u8fd4\u56de\u7528\u6237\u6309\u4e0b\u7684\u6309\u94ae\u3002
"},{"location":"apis/pyguiadapter.adapter.udialog/#pyguiadapter.adapter.udialog.show_question_messagebox","title":"show_question_messagebox(text: str, title: str = 'Question', buttons: Union[StandardButton, int] = Yes | No, default_button: Union[StandardButton, int] = NoButton, **kwargs) -> Union[int, StandardButton]
","text":"\u5f39\u51faQuestion\u6d88\u606f\u5bf9\u8bdd\u6846\u3002
Parameters:
Name Type Description Default text
str
\u6d88\u606f\u6587\u672c
required title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Question'
buttons
Union[StandardButton, int]
\u5bf9\u8bdd\u6846\u7684\u6309\u94ae
Yes | No
default_button
Union[StandardButton, int]
\u9ed8\u8ba4\u6309\u94ae
NoButton
**kwargs
\u5176\u4ed6\u53c2\u6570
{}
Returns:
Type Description Union[int, StandardButton]
\u8fd4\u56de\u7528\u6237\u6309\u4e0b\u7684\u6309\u94ae\u3002
"},{"location":"apis/pyguiadapter.adapter.udialog/#pyguiadapter.adapter.udialog.show_text_content","title":"show_text_content(text_content: str, text_format: Literal['markdown', 'plaintext', 'html'] = 'markdown', size: Tuple[int, int] = None, title: Optional[str] = '', icon: IconType = None, buttons: Optional[DialogButtons] = DialogButtonOk, resizeable: bool = True) -> None
","text":"\u663e\u793a\u591a\u884c\u6587\u672c\u5185\u5bb9\u3002
Parameters:
Name Type Description Default text_content
str
\u6587\u672c\u5185\u5bb9
required text_format
Literal['markdown', 'plaintext', 'html']
\u6587\u672c\u683c\u5f0f
'markdown'
size
Tuple[int, int]
\u5bf9\u8bdd\u6846\u5c3a\u5bf8
None
title
Optional[str]
\u5bf9\u8bdd\u6846\u6807\u9898
''
icon
IconType
\u5bf9\u8bdd\u6846\u56fe\u6807
None
buttons
Optional[DialogButtons]
\u5bf9\u8bdd\u6846\u6309\u94ae
DialogButtonOk
resizeable
bool
\u5bf9\u8bdd\u6846\u662f\u5426\u53ef\u8c03\u6574\u5927\u5c0f
True
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.udialog/#pyguiadapter.adapter.udialog.show_text_file","title":"show_text_file(text_file: str, text_format: Literal['markdown', 'plaintext', 'html'] = 'markdown', size: Tuple[int, int] = None, title: Optional[str] = '', icon: IconType = None, buttons: Optional[DialogButtons] = DialogButtonOk, resizeable: bool = True) -> None
","text":"\u5c55\u793a\u6587\u672c\u6587\u4ef6\u5185\u5bb9\u3002
Parameters:
Name Type Description Default text_file
str
\u6587\u672c\u6587\u4ef6\u8def\u5f84
required text_format
Literal['markdown', 'plaintext', 'html']
\u6587\u672c\u6587\u4ef6\u683c\u5f0f
'markdown'
size
Tuple[int, int]
\u5bf9\u8bdd\u6846\u5c3a\u5bf8
None
title
Optional[str]
\u5bf9\u8bdd\u6846\u6807\u9898
''
icon
IconType
\u5bf9\u8bdd\u6846\u56fe\u6807
None
buttons
Optional[DialogButtons]
\u5bf9\u8bdd\u6846\u6309\u94ae
DialogButtonOk
resizeable
bool
\u5bf9\u8bdd\u6846\u662f\u5426\u53ef\u8c03\u6574\u5927\u5c0f
True
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.udialog/#pyguiadapter.adapter.udialog.show_custom_dialog","title":"show_custom_dialog(dialog_class: Type[BaseCustomDialog], **kwargs) -> Any
","text":"\u5f39\u51fa\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846\u3002
Parameters:
Name Type Description Default dialog_class
Type[BaseCustomDialog]
\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846\u7c7b
required **kwargs
\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846\u521d\u59cb\u5316\u53c2\u6570
{}
Returns:
Type Description Any
\u8fd4\u56de\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846show_and_get_result()
\u51fd\u6570\u7684\u8fd4\u56de\u503c\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/","title":"pyguiadapter.adapter.uinput","text":""},{"location":"apis/pyguiadapter.adapter.uinput/#_1","title":"\u6a21\u5757\u7ea7\u65b9\u6cd5","text":""},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_string","title":"get_string(title: str = 'Input Text', label: str = '', echo: Optional[EchoMode] = None, text: str = '') -> Optional[str]
","text":"\u5f39\u51fa\u5355\u884c\u6587\u672c\u8f93\u5165\u6846\uff0c\u8fd4\u56de\u7528\u6237\u8f93\u5165\u7684\u5b57\u7b26\u4e32\u3002
Parameters:
Name Type Description Default title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Input Text'
label
str
\u63d0\u793a\u6807\u7b7e
''
echo
Optional[EchoMode]
\u56de\u663e\u6a21\u5f0f
None
text
str
\u521d\u59cb\u6587\u672c
''
Returns:
Type Description Optional[str]
\u7528\u6237\u8f93\u5165\u7684\u5b57\u7b26\u4e32\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_text","title":"get_text(title: str = 'Input Text', label: str = '', text: str = '') -> Optional[str]
","text":"\u5f39\u51fa\u591a\u884c\u6587\u672c\u8f93\u5165\u6846\uff0c\u8fd4\u56de\u7528\u6237\u8f93\u5165\u7684\u5b57\u7b26\u4e32\u3002
Parameters:
Name Type Description Default title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Input Text'
label
str
\u63d0\u793a\u6807\u7b7e
''
text
str
\u521d\u59cb\u6587\u672c
''
Returns:
Type Description Optional[str]
\u7528\u6237\u8f93\u5165\u7684\u5b57\u7b26\u4e32\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_int","title":"get_int(title: str = 'Input Integer', label: str = '', value: int = 0, min_value: int = -2147483647, max_value: int = 2147483647, step: int = 1) -> Optional[int]
","text":"\u5f39\u51fa\u6574\u6570\u8f93\u5165\u6846\uff0c\u8fd4\u56de\u7528\u6237\u8f93\u5165\u7684\u6574\u6570\u3002
Parameters:
Name Type Description Default title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Input Integer'
label
str
\u63d0\u793a\u6807\u7b7e
''
value
int
\u521d\u59cb\u503c
0
min_value
int
\u6700\u5c0f\u503c
-2147483647
max_value
int
\u6700\u5927\u503c
2147483647
step
int
\u6b65\u957f
1
Returns:
Type Description Optional[int]
\u7528\u6237\u8f93\u5165\u7684\u6574\u6570\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_float","title":"get_float(title: str = 'Input Float', label: str = '', value: float = 0.0, min_value: float = -2147483647.0, max_value: float = 2147483647.0, decimals: int = 3, step: float = 1.0) -> Optional[float]
","text":"\u5f39\u51fa\u6d6e\u70b9\u6570\u8f93\u5165\u6846\uff0c\u8fd4\u56de\u7528\u6237\u8f93\u5165\u7684\u6d6e\u70b9\u6570\u3002
Parameters:
Name Type Description Default title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Input Float'
label
str
\u63d0\u793a\u6807\u7b7e
''
value
float
\u521d\u59cb\u503c
0.0
min_value
float
\u6700\u5c0f\u503c
-2147483647.0
max_value
float
\u6700\u5927\u503c
2147483647.0
decimals
int
\u5c0f\u6570\u4f4d\u6570
3
step
float
\u6b65\u957f
1.0
Returns:
Type Description Optional[float]
\u7528\u6237\u8f93\u5165\u7684\u6d6e\u70b9\u6570\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_selected_item","title":"get_selected_item(items: List[str], title: str = 'Select Item', label: str = '', current: int = 0, editable: bool = False) -> Optional[str]
","text":"\u5f39\u51fa\u9009\u9879\u5217\u8868\uff0c\u8fd4\u56de\u7528\u6237\u9009\u62e9\u7684\u9879\u76ee\u3002
Parameters:
Name Type Description Default items
List[str]
\u9879\u76ee\u5217\u8868
required title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Select Item'
label
str
\u63d0\u793a\u6807\u7b7e
''
current
int
\u5f53\u524d\u9009\u62e9\u9879\u7d22\u5f15
0
editable
bool
\u662f\u5426\u53ef\u7f16\u8f91
False
Returns:
Type Description Optional[str]
\u7528\u6237\u9009\u62e9\u7684\u9879\u76ee\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_json_object","title":"get_json_object(title: str = 'Input Json', icon: IconType = None, size: Tuple[int, int] = (600, 400), ok_button_text: str = 'Ok', cancel_button_text: Optional[str] = 'Cancel', initial_text: str = '', auto_indent: bool = True, indent_size: int = 4, auto_parentheses: bool = True, line_wrap_mode: LineWrapMode = LineWrapMode.WidgetWidth, line_wrap_width: int = 88, font_family: Union[str, Sequence[str], None] = None, font_size: Optional[int] = None, **kwargs) -> Any
","text":"\u5f39\u51faJson\u8f93\u5165\u6846\uff0c\u8fd4\u56de\u7528\u6237\u8f93\u5165\u7684Json\u5bf9\u8c61\u3002
Parameters:
Name Type Description Default title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Input Json'
icon
IconType
\u7a97\u53e3\u56fe\u6807
None
size
Tuple[int, int]
\u7a97\u53e3\u5927\u5c0f
(600, 400)
ok_button_text
str
\u786e\u5b9a\u6309\u94ae\u6587\u672c
'Ok'
cancel_button_text
Optional[str]
\u53d6\u6d88\u6309\u94ae\u6587\u672c
'Cancel'
initial_text
str
\u521d\u59cb\u6587\u672c
''
auto_indent
bool
\u662f\u5426\u81ea\u52a8\u7f29\u8fdb
True
indent_size
int
\u7f29\u8fdb\u5927\u5c0f
4
auto_parentheses
bool
\u662f\u5426\u81ea\u52a8\u5339\u914d\u62ec\u53f7
True
line_wrap_mode
LineWrapMode
\u6362\u884c\u6a21\u5f0f
WidgetWidth
line_wrap_width
int
\u6362\u884c\u5bbd\u5ea6
88
font_family
Union[str, Sequence[str], None]
\u5b57\u4f53
None
font_size
Optional[int]
\u5b57\u4f53\u5927\u5c0f
None
**kwargs
\u5176\u4ed6\u53c2\u6570
{}
Returns:
Type Description Any
\u7528\u6237\u8f93\u5165\u7684Json\u5bf9\u8c61\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
Raises:
Type Description Exception
\u5982\u679c\u8f93\u5165\u4e86\u975e\u6cd5\u7684Json\u6587\u672c\uff0c\u5219\u4f1a\u629b\u51fa\u5f02\u5e38\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_py_literal","title":"get_py_literal(title: str = 'Input Python Literal', icon: IconType = None, size: Tuple[int, int] = (600, 400), ok_button_text: str = 'Ok', cancel_button_text: Optional[str] = 'Cancel', initial_text: str = '', auto_indent: bool = True, indent_size: int = 4, auto_parentheses: bool = True, line_wrap_mode: LineWrapMode = LineWrapMode.WidgetWidth, line_wrap_width: int = 88, font_family: Union[str, Sequence[str], None] = None, font_size: Optional[int] = None, **kwargs) -> PyLiteralType
","text":"\u5f39\u51faPython\u5b57\u9762\u91cf\u8f93\u5165\u6846\uff0c\u8fd4\u56de\u7528\u6237\u8f93\u5165\u7684Python\u5b57\u9762\u91cf\u3002
Parameters:
Name Type Description Default title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Input Python Literal'
icon
IconType
\u7a97\u53e3\u56fe\u6807
None
size
Tuple[int, int]
\u7a97\u53e3\u5927\u5c0f
(600, 400)
ok_button_text
str
\u786e\u5b9a\u6309\u94ae\u6587\u672c
'Ok'
cancel_button_text
Optional[str]
\u53d6\u6d88\u6309\u94ae\u6587\u672c
'Cancel'
initial_text
str
\u521d\u59cb\u6587\u672c
''
auto_indent
bool
\u662f\u5426\u81ea\u52a8\u7f29\u8fdb
True
indent_size
int
\u7f29\u8fdb\u5927\u5c0f
4
auto_parentheses
bool
\u662f\u5426\u81ea\u52a8\u5339\u914d\u62ec\u53f7
True
line_wrap_mode
LineWrapMode
\u6362\u884c\u6a21\u5f0f
WidgetWidth
line_wrap_width
int
\u6362\u884c\u5bbd\u5ea6
88
font_family
Union[str, Sequence[str], None]
\u5b57\u4f53
None
font_size
Optional[int]
\u5b57\u4f53\u5927\u5c0f
None
**kwargs
\u5176\u4ed6\u53c2\u6570
{}
Returns:
Type Description PyLiteralType
\u7528\u6237\u8f93\u5165\u7684Python\u5b57\u9762\u91cf\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
Raises:
Type Description Exception
\u5982\u679c\u8f93\u5165\u4e86\u975e\u6cd5\u7684Python\u5b57\u9762\u91cf\uff08\u5373ast.literal_eval()\u65e0\u6cd5\u89e3\u6790\u7684\u5185\u5bb9\uff09\uff0c\u5219\u4f1a\u629b\u51fa\u5f02\u5e38\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_existing_directory","title":"get_existing_directory(title: str = '', start_dir: str = '') -> Optional[str]
","text":"\u5f39\u51fa\u9009\u62e9\u6587\u4ef6\u5939\u5bf9\u8bdd\u6846\uff0c\u8fd4\u56de\u7528\u6237\u9009\u62e9\u7684\u76ee\u5f55\u3002
Parameters:
Name Type Description Default title
str
\u5bf9\u8bdd\u6846\u6807\u9898
''
start_dir
str
\u8d77\u59cb\u76ee\u5f55
''
Returns:
Type Description Optional[str]
\u7528\u6237\u9009\u62e9\u7684\u76ee\u5f55\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_open_file","title":"get_open_file(title: str = '', start_dir: str = '', filters: str = '') -> Optional[str]
","text":"\u5f39\u51fa\u6253\u5f00\u6587\u4ef6\u5bf9\u8bdd\u6846\uff0c\u8fd4\u56de\u7528\u6237\u9009\u62e9\u7684\u6587\u4ef6\u3002
Parameters:
Name Type Description Default title
str
\u5bf9\u8bdd\u6846\u6807\u9898
''
start_dir
str
\u8d77\u59cb\u76ee\u5f55
''
filters
str
\u6587\u4ef6\u8fc7\u6ee4\u5668
''
Returns:
Type Description Optional[str]
\u7528\u6237\u9009\u62e9\u7684\u6587\u4ef6\u8def\u5f84\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_open_files","title":"get_open_files(title: str = '', start_dir: str = '', filters: str = '') -> Optional[List[str]]
","text":"\u5f39\u51fa\u6253\u5f00\u6587\u4ef6\u5bf9\u8bdd\u6846\uff0c\u8fd4\u56de\u7528\u6237\u9009\u62e9\u7684\u591a\u4e2a\u6587\u4ef6\u3002 Args: title: \u5bf9\u8bdd\u6846\u6807\u9898 start_dir: \u8d77\u59cb\u76ee\u5f55 filters: \u6587\u4ef6\u8fc7\u6ee4\u5668
Returns:
Type Description Optional[List[str]]
\u7528\u6237\u9009\u62e9\u7684\u6587\u4ef6\u8def\u5f84\u5217\u8868\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_save_file","title":"get_save_file(title: str = '', start_dir: str = '', filters: str = '') -> Optional[str]
","text":"\u5f39\u51fa\u4fdd\u5b58\u6587\u4ef6\u5bf9\u8bdd\u6846\uff0c\u8fd4\u56de\u7528\u6237\u8f93\u5165\u6216\u9009\u62e9\u7684\u6587\u4ef6\u8def\u5f84\u3002
Parameters:
Name Type Description Default title
str
\u5bf9\u8bdd\u6846\u6807\u9898
''
start_dir
str
\u8d77\u59cb\u76ee\u5f55
''
filters
str
\u6587\u4ef6\u8fc7\u6ee4\u5668
''
Returns:
Type Description Optional[str]
\u7528\u6237\u8f93\u5165\u6216\u9009\u62e9\u7684\u6587\u4ef6\u8def\u5f84\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uinput/#pyguiadapter.adapter.uinput.get_custom_input","title":"get_custom_input(input_dialog_class: Type[UniversalInputDialog], **input_dialog_args) -> Any
","text":"\u5f39\u51fa\u81ea\u5b9a\u4e49\u8f93\u5165\u6846\uff0c\u8fd4\u56de\u7528\u6237\u8f93\u5165\u7684\u5185\u5bb9\u3002
Parameters:
Name Type Description Default input_dialog_class
Type[UniversalInputDialog]
\u81ea\u5b9a\u4e49\u8f93\u5165\u6846\u7c7b
required **input_dialog_args
\u81ea\u5b9a\u4e49\u8f93\u5165\u6846\u53c2\u6570
{}
Returns:
Type Description Any
\u7528\u6237\u8f93\u5165\u7684\u5185\u5bb9\uff0c\u5982\u679c\u7528\u6237\u53d6\u6d88\u8f93\u5165\u5219\u8fd4\u56deNone\u3002
"},{"location":"apis/pyguiadapter.adapter.uoutput/","title":"pyguiadapter.adapter.uoutput","text":""},{"location":"apis/pyguiadapter.adapter.uoutput/#_1","title":"\u6a21\u5757\u7ea7\u65b9\u6cd5","text":""},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.uprint","title":"uprint(*args: Any, sep: str = ' ', end: str = '\\n', html: bool = False, scroll_to_bottom: bool = True) -> None
","text":"\u6253\u5370\u4fe1\u606f\u5230\u8f93\u51fa\u6d4f\u89c8\u5668
Parameters:
Name Type Description Default *args
Any
\u8981\u6253\u5370\u7684\u4fe1\u606f
()
sep
str
\u6bcf\u6761\u4fe1\u606f\u4e4b\u95f4\u7684\u5206\u9694\u5b57\u7b26\u4e32
' '
end
str
\u6dfb\u52a0\u5230\u6700\u540e\u4e00\u6761\u4fe1\u606f\u540e\u9762\u7684\u5b57\u7b26\u4e32
'\\n'
html
bool
\u8981\u6253\u5370\u7684\u4fe1\u606f\u662f\u5426\u4e3ahtml
\u683c\u5f0f
False
scroll_to_bottom
bool
\u6253\u5370\u4fe1\u606f\u540e\u662f\u5426\u5c06\u8f93\u51fa\u6d4f\u89c8\u5668
\u6eda\u52a8\u5230\u6700\u5e95\u90e8
True
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.clear_output","title":"clear_output() -> None
","text":"\u6e05\u9664\u8f93\u51fa\u6d4f\u89c8\u5668
\u4e2d\u6240\u6709\u5185\u5bb9
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.print_image","title":"print_image(img: Union[str, bytes], img_type: str = 'jpeg', embed_base64: bool = False, width: Optional[int] = None, height: Optional[int] = None, centered: bool = True) -> None
","text":"\u6a21\u5757\u7ea7\u51fd\u6570\u3002\u6253\u5370\u56fe\u7247\u3002
Parameters:
Name Type Description Default img
Union[str, bytes]
\u5f85\u6253\u5370\u7684\u56fe\u7247\u3002\u53ef\u4ee5\u4e3a\u56fe\u7247\u6587\u4ef6\u7684\u8def\u5f84\uff08str
\uff09\u6216\u56fe\u7247\u7684\u4e8c\u8fdb\u5236\u6570\u636e\uff08bytes
\uff09
required img_type
str
\u56fe\u7247\u7c7b\u578b\u3002
'jpeg'
embed_base64
bool
\u662f\u5426\u4f7f\u7528data url
\uff08base64\u683c\u5f0f
\uff09\u5d4c\u5165\u56fe\u7247\u3002\u4f20\u5165\u4e8c\u8fdb\u5236\u56fe\u7247\u6570\u636e\u65f6\uff0c\u5c06\u5ffd\u7565\u6b64\u53c2\u6570\u3002
False
width
Optional[int]
\u56fe\u7247\u7684\u5bbd\u5ea6\u3002\u82e5\u672a\u6307\u5b9a\uff0c\u5219\u663e\u793a\u56fe\u7247\u7684\u539f\u59cb\u5bbd\u5ea6\u3002
None
height
Optional[int]
\u56fe\u7247\u7684\u9ad8\u5ea6\u3002\u82e5\u672a\u6307\u5b9a\uff0c\u5219\u663e\u793a\u56fe\u7247\u7684\u539f\u59cb\u9ad8\u5ea6\u3002
None
centered
bool
\u662f\u5426\u5c06\u56fe\u7247\u5c45\u4e2d\u663e\u793a\u3002
True
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c\u3002
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.info","title":"info(msg: str) -> None
","text":"\u6a21\u5757\u7ea7\u51fd\u6570\u3002\u6253\u5370info
\u7ea7\u522b\u7684\u6d88\u606f\u3002info
\u6d88\u606f\u989c\u8272\u503c\u9ed8\u8ba4\u4e3a\uff1a#00FF00
\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.debug","title":"debug(msg: str) -> None
","text":"\u6a21\u5757\u7ea7\u51fd\u6570\u3002\u6253\u5370debug
\u7ea7\u522b\u7684\u6d88\u606f\u3002debug
\u6d88\u606f\u989c\u8272\u503c\u9ed8\u8ba4\u4e3a\uff1a#909399
\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.warning","title":"warning(msg: str) -> None
","text":"\u6a21\u5757\u7ea7\u51fd\u6570\u3002\u6253\u5370warning
\u7ea7\u522b\u7684\u6d88\u606f\u3002warning
\u6d88\u606f\u989c\u8272\u503c\u9ed8\u8ba4\u4e3a\uff1a#FFFF00
\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.critical","title":"critical(msg: str) -> None
","text":"\u6a21\u5757\u7ea7\u51fd\u6570\u3002\u6253\u5370critical
\u7ea7\u522b\u7684\u6d88\u606f\u3002critical
\u6d88\u606f\u989c\u8272\u503c\u9ed8\u8ba4\u4e3a\uff1a#A61C00
\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.fatal","title":"fatal(msg: str) -> None
","text":"\u6a21\u5757\u7ea7\u51fd\u6570\u3002\u6253\u5370fatal
\u7ea7\u522b\u7684\u6d88\u606f\u3002fatal
\u6d88\u606f\u989c\u8272\u503c\u9ed8\u8ba4\u4e3a\uff1a#FF0000
\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.Logger","title":"Logger
","text":" Bases: object
\u8be5\u7c7b\u7528\u4e8e\u5411\u51fd\u6570\u6267\u884c\u7a97\u53e3\u7684\u8f93\u51fa\u6d4f\u89c8\u5668
\u533a\u57df\u6253\u5370\u65e5\u5fd7\u6d88\u606f\u3002\u4e0d\u540c\u7ea7\u522b\u7684\u65e5\u5fd7\u6d88\u606f\uff0c\u4e3b\u8981\u4ee5\u989c\u8272\u8fdb\u884c\u533a\u5206\u3002\u53ef\u4ee5\u4f7f\u7528LoggerConfig
\u5b9e\u4f8b\u6307\u5b9a\u5404\u6d88\u606f\u7ea7\u522b\u7684\u989c\u8272\u503c\u3002
\u793a\u4f8b:
from pyguiadapter.adapter import GUIAdapter\nfrom pyguiadapter.adapter.uoutput import Logger, LoggerConfig\n\nlogger = Logger(\n config=LoggerConfig(\n info_color=\"green\",\n debug_color=\"blue\",\n warning_color=\"yellow\",\n critical_color=\"red\",\n fatal_color=\"magenta\",\n )\n)\n\n\ndef output_log_msg(\n info_msg: str = \"info message\",\n debug_msg: str = \"debug message\",\n warning_msg: str = \"warning message\",\n critical_msg: str = \"critical message\",\n fatal_msg: str = \"fatal message\",\n):\n\n logger.info(info_msg)\n logger.debug(debug_msg)\n logger.warning(warning_msg)\n logger.critical(critical_msg)\n logger.fatal(fatal_msg)\n\nif __name__ == \"__main__\":\n adapter = GUIAdapter()\n adapter.add(output_log_msg)\n adapter.run()\n
\u7ed3\u679c\uff1a
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.Logger.critical","title":"critical(msg: str) -> None
","text":"\u6253\u5370critical
\u7ea7\u522b\u7684\u6d88\u606f\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.Logger.debug","title":"debug(msg: str) -> None
","text":"\u6253\u5370debug
\u7ea7\u522b\u7684\u6d88\u606f\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.Logger.fatal","title":"fatal(msg: str) -> None
","text":"\u6253\u5370fatal
\u7ea7\u522b\u7684\u6d88\u606f\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.Logger.info","title":"info(msg: str) -> None
","text":"\u6253\u5370info
\u7ea7\u522b\u7684\u6d88\u606f\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.Logger.warning","title":"warning(msg: str) -> None
","text":"\u6253\u5370warning
\u7ea7\u522b\u7684\u6d88\u606f\u3002
Parameters:
Name Type Description Default msg
str
\u8981\u6253\u5370\u7684\u6d88\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.LoggerConfig","title":"LoggerConfig
dataclass
","text":" Bases: object
Logger
\u7684\u914d\u7f6e\u7c7b\uff0c\u7528\u4e8e\u914d\u7f6eLogger
\u7684\u989c\u8272\u7b49\u5c5e\u6027\u3002
Source code in pyguiadapter\\adapter\\uoutput.py
@dataclasses.dataclass\nclass LoggerConfig(object):\n \"\"\"\n `Logger`\u7684\u914d\u7f6e\u7c7b\uff0c\u7528\u4e8e\u914d\u7f6e`Logger`\u7684\u989c\u8272\u7b49\u5c5e\u6027\u3002\n \"\"\"\n\n info_color: str = COLOR_INFO\n \"\"\"`info`\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c\"\"\"\n\n debug_color: str = COLOR_DEBUG\n \"\"\"`debug`\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c\"\"\"\n\n warning_color: str = COLOR_WARNING\n \"\"\"`warning`\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c\"\"\"\n\n critical_color: str = COLOR_CRITICAL\n \"\"\"`critical`\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c\"\"\"\n\n fatal_color: str = COLOR_FATAL\n \"\"\"`fatal`\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c\"\"\"\n
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.LoggerConfig.critical_color","title":"critical_color: str = COLOR_CRITICAL
class-attribute
instance-attribute
","text":"critical
\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.LoggerConfig.debug_color","title":"debug_color: str = COLOR_DEBUG
class-attribute
instance-attribute
","text":"debug
\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.LoggerConfig.fatal_color","title":"fatal_color: str = COLOR_FATAL
class-attribute
instance-attribute
","text":"fatal
\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.LoggerConfig.info_color","title":"info_color: str = COLOR_INFO
class-attribute
instance-attribute
","text":"info
\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c
"},{"location":"apis/pyguiadapter.adapter.uoutput/#pyguiadapter.adapter.uoutput.LoggerConfig.warning_color","title":"warning_color: str = COLOR_WARNING
class-attribute
instance-attribute
","text":"warning
\u7ea7\u522b\u6d88\u606f\u7684\u989c\u8272\u503c
"},{"location":"apis/pyguiadapter.adapter.uprogress/","title":"pyguiadapter.adapter.uprogress","text":""},{"location":"apis/pyguiadapter.adapter.uprogress/#_1","title":"\u6a21\u5757\u7ea7\u65b9\u6cd5","text":""},{"location":"apis/pyguiadapter.adapter.uprogress/#pyguiadapter.adapter.uprogress.show_progressbar","title":"show_progressbar(min_value: int = 0, max_value: int = 100, inverted_appearance: bool = False, *, message_visible: bool = False, message_format: str = '%p%', message_centered: str = True, info_visible: bool = True, info_centered: bool = True, info_text_format: Literal['richtext', 'markdown', 'plaintext', 'autotext'] = 'autotext', initial_info: str = '') -> None
","text":"\u663e\u793a\u8fdb\u5ea6\u6761\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8fdb\u5ea6\u6761\u5904\u4e8e\u9690\u85cf\u72b6\u6001\uff0c\u5f00\u53d1\u8005\u5fc5\u987b\u624b\u52a8\u8c03\u7528\u6b64\u51fd\u6570\u6765\u663e\u793a\u8fdb\u5ea6\u6761\uff0c\u6b64\u51fd\u6570\u9664\u4e86\u7528\u4e8e\u663e\u793a\u8fdb\u5ea6\u6761\uff0c\u8fd8\u53ef\u4ee5\u5bf9\u8fdb\u5ea6\u6761\u8fdb\u884c\u914d\u7f6e\u3002
Parameters:
Name Type Description Default min_value
int
\u6700\u5c0f\u8fdb\u5ea6\u503c\uff0c\u9ed8\u8ba4\u4e3a0
0
max_value
int
\u6700\u5927\u8fdb\u5ea6\u503c\uff0c\u9ed8\u8ba4\u4e3a100
100
inverted_appearance
bool
\u662f\u5426\u6539\u53d8\u8fdb\u5ea6\u6761\u7684\u663e\u793a\u65b9\u5f0f\uff0c\u4f7f\u5176\u4ee5\u53cd\u65b9\u5411\u663e\u793a\u8fdb\u5ea6
False
message_visible
bool
\u662f\u5426\u663e\u793amessage\u4fe1\u606f
False
message_format
str
message\u4fe1\u606f\u7684\u683c\u5f0f\uff0c\u652f\u6301\uff1a%p%
\uff08\u663e\u793a\u5b8c\u6210\u7684\u767e\u5206\u6bd4\uff0c\u8fd9\u662f\u9ed8\u8ba4\u663e\u793a\u65b9\u5f0f\uff09\u3001%v
\uff08\u663e\u793a\u5f53\u524d\u7684\u8fdb\u5ea6\u503c\uff09\u548c%m
\uff08\u663e\u793a\u603b\u7684\u6b65\u8fdb\u503c\uff09
'%p%'
message_centered
str
message\u4fe1\u606f\u662f\u5426\u5c45\u4e2d\u663e\u793a
True
info_visible
bool
\u662f\u5426\u663e\u793ainfo\u533a\u57df
True
info_centered
bool
info\u4fe1\u606f\u662f\u5426\u5c45\u4e2d\u663e\u793a
True
info_text_format
Literal['richtext', 'markdown', 'plaintext', 'autotext']
info\u4fe1\u606f\u7684\u6587\u672c\u683c\u5f0f\uff0c\u652f\u6301\"richtext\"
\u3001\"markdown\"
\u3001\"plaintext\"
\u3001\"autotext\"
'autotext'
initial_info
str
info\u4fe1\u606f\u7684\u521d\u59cb\u503c
''
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uprogress/#pyguiadapter.adapter.uprogress.hide_progressbar","title":"hide_progressbar() -> None
","text":"\u9690\u85cf\u8fdb\u5ea6\u6761
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uprogress/#pyguiadapter.adapter.uprogress.update_progress","title":"update_progress(value: int, info: Optional[str] = None) -> None
","text":"\u66f4\u65b0\u8fdb\u5ea6\u4fe1\u606f
Parameters:
Name Type Description Default value
int
\u5f53\u524d\u8fdb\u5ea6\u503c
required info
Optional[str]
\u5f53\u524dinfo\u6587\u672c
None
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uprogress/#pyguiadapter.adapter.uprogress.show_progress_dialog","title":"show_progress_dialog(min_value: int = 0, max_value: int = 100, inverted_appearance: bool = False, *, message_visible: bool = False, message_format: str = '%p%', message_centered: str = True, info_visible: bool = True, info_centered: bool = True, info_text_format: Literal['richtext', 'markdown', 'plaintext', 'autotext'] = 'autotext', initial_info: str = '', title: str = 'Progress', size: tuple = (400, 150), modal: bool = True) -> None
","text":"\u663e\u793a\u8fdb\u5ea6\u5bf9\u8bdd\u6846\u3002\u5f00\u53d1\u8005\u5fc5\u987b\u624b\u52a8\u8c03\u7528\u6b64\u51fd\u6570\u6765\u663e\u793a\u8fdb\u5ea6\u5bf9\u8bdd\u6846\uff0c\u6b64\u51fd\u6570\u9664\u4e86\u7528\u4e8e\u663e\u793a\u8fdb\u5ea6\u5bf9\u8bdd\u6846\uff0c \u8fd8\u7528\u4e8e\u5bf9\u8fdb\u5ea6\u5bf9\u8bdd\u6846\u8fdb\u884c\u914d\u7f6e\u3002
Parameters:
Name Type Description Default min_value
int
\u6700\u5c0f\u8fdb\u5ea6\u503c\uff0c\u9ed8\u8ba4\u4e3a0
0
max_value
int
\u6700\u5927\u8fdb\u5ea6\u503c\uff0c\u9ed8\u8ba4\u4e3a100
100
inverted_appearance
bool
\u662f\u5426\u6539\u53d8\u8fdb\u5ea6\u6761\u7684\u663e\u793a\u65b9\u5f0f\uff0c\u4f7f\u5176\u4ee5\u53cd\u65b9\u5411\u663e\u793a\u8fdb\u5ea6
False
message_visible
bool
\u662f\u5426\u663e\u793amessage\u4fe1\u606f
False
message_format
str
message\u4fe1\u606f\u7684\u683c\u5f0f\uff0c\u652f\u6301\uff1a%p%
\uff08\u663e\u793a\u5b8c\u6210\u7684\u767e\u5206\u6bd4\uff0c\u8fd9\u662f\u9ed8\u8ba4\u663e\u793a\u65b9\u5f0f\uff09\u3001%v
\uff08\u663e\u793a\u5f53\u524d\u7684\u8fdb\u5ea6\u503c\uff09\u548c%m
\uff08\u663e\u793a\u603b\u7684\u6b65\u8fdb\u503c\uff09
'%p%'
message_centered
str
message\u4fe1\u606f\u662f\u5426\u5c45\u4e2d\u663e\u793a
True
info_visible
bool
\u662f\u5426\u663e\u793ainfo\u4fe1\u606f
True
info_centered
bool
info\u4fe1\u606f\u662f\u5426\u5c45\u4e2d\u663e\u793a
True
info_text_format
Literal['richtext', 'markdown', 'plaintext', 'autotext']
info\u4fe1\u606f\u7684\u6587\u672c\u683c\u5f0f\uff0c\u652f\u6301\"richtext\"
\u3001\"markdown\"
\u3001\"plaintext\"
\u3001\"autotext\"
'autotext'
initial_info
str
info\u4fe1\u606f\u7684\u521d\u59cb\u503c
''
title
str
\u5bf9\u8bdd\u6846\u6807\u9898
'Progress'
size
tuple
\u5bf9\u8bdd\u6846\u5927\u5c0f
(400, 150)
modal
bool
\u662f\u5426\u4e3a\u6a21\u6001\u5bf9\u8bdd\u6846
True
Returns: \u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uprogress/#pyguiadapter.adapter.uprogress.dismiss_progress_dialog","title":"dismiss_progress_dialog() -> None
","text":"\u5173\u95ed\u8fdb\u5ea6\u5bf9\u8bdd\u6846
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.uprogress/#pyguiadapter.adapter.uprogress.update_progress_dialog","title":"update_progress_dialog(value: int, info: Optional[str] = None) -> None
","text":"\u66f4\u65b0\u8fdb\u5ea6\u5bf9\u8bdd\u6846
Parameters:
Name Type Description Default value
int
\u5f53\u524d\u8fdb\u5ea6\u503c
required info
Optional[str]
\u5f53\u524dinfo\u6587\u672c
None
Returns: \u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.useful/","title":"pyguiadapter.adapter.useful","text":""},{"location":"apis/pyguiadapter.adapter.useful/#_1","title":"\u6a21\u5757\u7ea7\u65b9\u6cd5","text":""},{"location":"apis/pyguiadapter.adapter.useful/#pyguiadapter.adapter.useful.highlight_parameter","title":"highlight_parameter(parameter_name: str) -> None
","text":"\u9ad8\u4eae\u663e\u793a\u53c2\u6570\u540d\u79f0\u6240\u5bf9\u5e94\u7684\u63a7\u4ef6\uff0c\u82e5\u53c2\u6570\u540d\u79f0\u4e0d\u5b58\u5728\uff0c\u5219\u4e0d\u4ea7\u751f\u4efb\u4f55\u6548\u679c\u3002
Parameters:
Name Type Description Default parameter_name
str
\u9700\u8981\u9ad8\u4eae\u663e\u793a\u7684\u63a7\u4ef6\u540d\u79f0
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.utoast/","title":"pyguiadapter.adapter.utoast","text":""},{"location":"apis/pyguiadapter.adapter.utoast/#_1","title":"\u6a21\u5757\u7ea7\u65b9\u6cd5","text":""},{"location":"apis/pyguiadapter.adapter.utoast/#pyguiadapter.adapter.utoast.show_toast","title":"show_toast(message: str, duration: int = 3000, config: Optional[ToastConfig] = None, clear: bool = False) -> None
","text":"\u5c55\u793atoast\u6d88\u606f\u3002
Parameters:
Name Type Description Default message
str
toast\u6d88\u606f\u5185\u5bb9
required duration
int
toast\u663e\u793a\u65f6\u95f4\uff0c\u5355\u4f4d\u4e3a\u6beb\u79d2
3000
config
Optional[ToastConfig]
toast\u914d\u7f6e
None
clear
bool
\u662f\u5426\u6e05\u9664\u4e4b\u524d\u7684toast\u6d88\u606f
False
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.adapter.utoast/#pyguiadapter.adapter.utoast.clear_toasts","title":"clear_toasts() -> None
","text":"\u6e05\u9664\u6240\u6709toast\u6d88\u606f\u3002
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.menu/","title":"pyguiadapter.menu","text":""},{"location":"apis/pyguiadapter.menu/#pyguiadapter.menu.Menu","title":"Menu
dataclass
","text":" Bases: object
\u8be5\u7c7b\u7528\u4e8e\u914d\u7f6e\u7a97\u53e3\u83dc\u5355\u680f\u4e0a\u7684\u83dc\u5355\u3002
Source code in pyguiadapter\\menu.py
@dataclasses.dataclass(frozen=True)\nclass Menu(object):\n \"\"\"\u8be5\u7c7b\u7528\u4e8e\u914d\u7f6e\u7a97\u53e3\u83dc\u5355\u680f\u4e0a\u7684\u83dc\u5355\u3002\"\"\"\n\n title: str\n \"\"\"\u83dc\u5355\u7684\u6807\u9898\u3002\"\"\"\n\n actions: List[Union[Action, Separator, \"Menu\"]]\n \"\"\"\u83dc\u5355\u4e0b\u7684\u83dc\u5355\u9879\uff08`Action`\uff09\u3001\u5206\u9694\u7b26\uff08`Separator`\uff09\u6216\u5b50\u83dc\u5355\uff08`Menu`\uff09\"\"\"\n\n separators_collapsible: bool = True\n \"\"\"\u662f\u5426\u5c06\u8fde\u7eed\u7684\u5206\u9694\u7b26\u5408\u5e76\u3002\u4e3a`True`\u65f6\u8fde\u7eed\u5206\u9694\u7b26\u5c06\u88ab\u5408\u5e76\u4e3a\u4e00\u4e2a\uff0c\u540c\u65f6\uff0c\u4f4d\u4e8e\u83dc\u5355\u5f00\u5934\u6216\u7ed3\u5c3e\u7684\u5206\u9694\u7b26\u4e5f\u4f1a\u88ab\u9690\u85cf\u3002\"\"\"\n\n tear_off_enabled: bool = True\n \"\"\"\u83dc\u5355\u53ef\u4ee5\u88ab\u201c\u6495\u4e0b\u201d\u3002\u4e3a`True`\u65f6\uff0c\u83dc\u5355\u5c06\u5305\u542b\u4e00\u4e2a\u7279\u6b8a\u7684\u201c\u6495\u4e0b\u201d\u9879\uff08\u901a\u5e38\u663e\u793a\u4e3a\u83dc\u5355\u9876\u90e8\u7684\u865a\u7ebf\uff09\uff0c\u5f53\u89e6\u53d1\u5b83\u65f6\uff0c\u4f1a\u521b\u5efa\u4e00\u4e2a\u83dc\u5355\u7684\u526f\u672c\u3002\u8fd9\u4e2a\u201c\u6495\u4e0b\u201d\u7684\u526f\u672c\n \u4f1a\u5b58\u5728\u4e8e\u4e00\u4e2a\u5355\u72ec\u7684\u7a97\u53e3\u4e2d\uff0c\u5e76\u4e14\u5305\u542b\u4e0e\u539f\u59cb\u83dc\u5355\u76f8\u540c\u7684\u83dc\u5355\u9879\u3002\"\"\"\n\n exclusive: bool = False\n \"\"\"\u662f\u5426\u5c06\u83dc\u5355\u4e0b\u7684\u83dc\u5355\u9879\uff08`Action`\uff09\u6dfb\u52a0\u5230\u4e00\u4e2a\u4e92\u65a5\u7ec4\u4e2d\u3002\u53ea\u6709\u5f53\u524d\u83dc\u5355\u4e0b`checkable`\u5c5e\u6027\u4e3a`True`\u7684\u83dc\u5355\u9879\uff08`Action`\uff09\u624d\u4f1a\u88ab\u6dfb\u52a0\u7684\u4e92\u65a5\u7ec4\u4e2d\u3002\"\"\"\n\n def remove_action(self, action: Union[str, Action, Separator, \"Menu\"]):\n if isinstance(action, str):\n for action_ in self.actions:\n if isinstance(action_, Action):\n if action_.text == action:\n action = action_\n break\n if isinstance(action_, Menu):\n if action_.title == action:\n action = action_\n break\n if action in self.actions:\n self.actions.remove(action)\n return\n if action in self.actions:\n self.actions.remove(action)\n return\n
"},{"location":"apis/pyguiadapter.menu/#pyguiadapter.menu.Menu.actions","title":"actions: List[Union[Action, Separator, Menu]]
instance-attribute
","text":"\u83dc\u5355\u4e0b\u7684\u83dc\u5355\u9879\uff08Action
\uff09\u3001\u5206\u9694\u7b26\uff08Separator
\uff09\u6216\u5b50\u83dc\u5355\uff08Menu
\uff09
"},{"location":"apis/pyguiadapter.menu/#pyguiadapter.menu.Menu.exclusive","title":"exclusive: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u83dc\u5355\u4e0b\u7684\u83dc\u5355\u9879\uff08Action
\uff09\u6dfb\u52a0\u5230\u4e00\u4e2a\u4e92\u65a5\u7ec4\u4e2d\u3002\u53ea\u6709\u5f53\u524d\u83dc\u5355\u4e0bcheckable
\u5c5e\u6027\u4e3aTrue
\u7684\u83dc\u5355\u9879\uff08Action
\uff09\u624d\u4f1a\u88ab\u6dfb\u52a0\u7684\u4e92\u65a5\u7ec4\u4e2d\u3002
"},{"location":"apis/pyguiadapter.menu/#pyguiadapter.menu.Menu.separators_collapsible","title":"separators_collapsible: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8fde\u7eed\u7684\u5206\u9694\u7b26\u5408\u5e76\u3002\u4e3aTrue
\u65f6\u8fde\u7eed\u5206\u9694\u7b26\u5c06\u88ab\u5408\u5e76\u4e3a\u4e00\u4e2a\uff0c\u540c\u65f6\uff0c\u4f4d\u4e8e\u83dc\u5355\u5f00\u5934\u6216\u7ed3\u5c3e\u7684\u5206\u9694\u7b26\u4e5f\u4f1a\u88ab\u9690\u85cf\u3002
"},{"location":"apis/pyguiadapter.menu/#pyguiadapter.menu.Menu.tear_off_enabled","title":"tear_off_enabled: bool = True
class-attribute
instance-attribute
","text":"\u83dc\u5355\u53ef\u4ee5\u88ab\u201c\u6495\u4e0b\u201d\u3002\u4e3aTrue
\u65f6\uff0c\u83dc\u5355\u5c06\u5305\u542b\u4e00\u4e2a\u7279\u6b8a\u7684\u201c\u6495\u4e0b\u201d\u9879\uff08\u901a\u5e38\u663e\u793a\u4e3a\u83dc\u5355\u9876\u90e8\u7684\u865a\u7ebf\uff09\uff0c\u5f53\u89e6\u53d1\u5b83\u65f6\uff0c\u4f1a\u521b\u5efa\u4e00\u4e2a\u83dc\u5355\u7684\u526f\u672c\u3002\u8fd9\u4e2a\u201c\u6495\u4e0b\u201d\u7684\u526f\u672c \u4f1a\u5b58\u5728\u4e8e\u4e00\u4e2a\u5355\u72ec\u7684\u7a97\u53e3\u4e2d\uff0c\u5e76\u4e14\u5305\u542b\u4e0e\u539f\u59cb\u83dc\u5355\u76f8\u540c\u7684\u83dc\u5355\u9879\u3002
"},{"location":"apis/pyguiadapter.menu/#pyguiadapter.menu.Menu.title","title":"title: str
instance-attribute
","text":"\u83dc\u5355\u7684\u6807\u9898\u3002
"},{"location":"apis/pyguiadapter.paramwidget/","title":"pyguiadapter.paramwidget","text":""},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidgetConfig","title":"BaseParameterWidgetConfig
dataclass
","text":" Bases: object
\u53c2\u6570\u63a7\u4ef6\u914d\u7f6e\u57fa\u7c7b\u3002\u63d0\u4f9b\u4e86\u6240\u6709\u53c2\u6570\u63a7\u4ef6\u5171\u6709\u7684\u53ef\u914d\u7f6e\u5c5e\u6027\u3002
Source code in pyguiadapter\\paramwidget.py
@dataclasses.dataclass(frozen=True)\nclass BaseParameterWidgetConfig(object):\n \"\"\"\n \u53c2\u6570\u63a7\u4ef6\u914d\u7f6e\u57fa\u7c7b\u3002\u63d0\u4f9b\u4e86\u6240\u6709\u53c2\u6570\u63a7\u4ef6\u5171\u6709\u7684\u53ef\u914d\u7f6e\u5c5e\u6027\u3002\n \"\"\"\n\n default_value: Any = None\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\u3002\"\"\"\n\n label: Optional[str] = None\n \"\"\"\u63a7\u4ef6\u7684\u6807\u7b7e\u3002\u82e5\u4e0d\u6307\u5b9a\u6b64\u5c5e\u6027\uff0c\u5219\u4f7f\u7528\u53c2\u6570\u540d\u4f5c\u4e3a\u6807\u7b7e\u3002\"\"\"\n\n description: Optional[str] = None\n \"\"\"\u63a7\u4ef6\u7684\u63cf\u8ff0\u6587\u672c\u3002\u82e5\u4e0d\u6307\u5b9a\u6b64\u5c5e\u6027\uff0c\u5219\u4ece\u5c1d\u8bd5\u4ece\u51fd\u6570\u7684docstring\u4e2d\u83b7\u53d6\u5bf9\u5e94\u53c2\u6570\u7684\u63cf\u8ff0\u6587\u672c\u3002\"\"\"\n\n default_value_description: Optional[str] = DEFAULT_VALUE_DESCRIPTION\n \"\"\"\u4f7f\u7528\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u7684\u63cf\u8ff0\u6587\u672c\u3002\u5f53default_value\u4e3aNone\u6216\u5f00\u53d1\u8005\u660e\u786e\u6307\u5b9a\u663e\u793a\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u65f6\uff0c\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u624d\u4f1a\u663e\u793a\u3002\"\"\"\n\n group: Optional[str] = None\n \"\"\"\u53c2\u6570\u5206\u7ec4\u540d\u79f0\u3002\u4e3aNone\u65f6\uff0c\u53c2\u89c1\u5c06\u88ab\u6dfb\u52a0\u5230\u9ed8\u8ba4\u5206\u7ec4\u3002\"\"\"\n\n stylesheet: Optional[str] = None\n \"\"\"\u53c2\u6570\u63a7\u4ef6\u7684\u6837\u5f0f\u8868\u3002\"\"\"\n\n @classmethod\n @abstractmethod\n def target_widget_class(cls) -> Type[\"BaseParameterWidget\"]:\n \"\"\"\n \u76ee\u6807\u63a7\u4ef6\u7c7b\uff0c\u5373\u672c\u914d\u7f6e\u7c7b\u9002\u7528\u7684\u53c2\u6570\u63a7\u4ef6\u7c7b\u3002\u5b50\u7c7b\u5fc5\u987b\u5b9e\u73b0\u6b64\u65b9\u6cd5\u3002\n\n Returns:\n \u76ee\u6807\u63a7\u4ef6\u7c7b\n \"\"\"\n pass\n\n @classmethod\n def new(cls, **kwargs) -> \"BaseParameterWidgetConfig\":\n return cls(**kwargs)\n
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidgetConfig.default_value","title":"default_value: Any = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\u3002
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidgetConfig.default_value_description","title":"default_value_description: Optional[str] = DEFAULT_VALUE_DESCRIPTION
class-attribute
instance-attribute
","text":"\u4f7f\u7528\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u7684\u63cf\u8ff0\u6587\u672c\u3002\u5f53default_value\u4e3aNone\u6216\u5f00\u53d1\u8005\u660e\u786e\u6307\u5b9a\u663e\u793a\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u65f6\uff0c\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u624d\u4f1a\u663e\u793a\u3002
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidgetConfig.description","title":"description: Optional[str] = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u63cf\u8ff0\u6587\u672c\u3002\u82e5\u4e0d\u6307\u5b9a\u6b64\u5c5e\u6027\uff0c\u5219\u4ece\u5c1d\u8bd5\u4ece\u51fd\u6570\u7684docstring\u4e2d\u83b7\u53d6\u5bf9\u5e94\u53c2\u6570\u7684\u63cf\u8ff0\u6587\u672c\u3002
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidgetConfig.group","title":"group: Optional[str] = None
class-attribute
instance-attribute
","text":"\u53c2\u6570\u5206\u7ec4\u540d\u79f0\u3002\u4e3aNone\u65f6\uff0c\u53c2\u89c1\u5c06\u88ab\u6dfb\u52a0\u5230\u9ed8\u8ba4\u5206\u7ec4\u3002
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidgetConfig.label","title":"label: Optional[str] = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u6807\u7b7e\u3002\u82e5\u4e0d\u6307\u5b9a\u6b64\u5c5e\u6027\uff0c\u5219\u4f7f\u7528\u53c2\u6570\u540d\u4f5c\u4e3a\u6807\u7b7e\u3002
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidgetConfig.stylesheet","title":"stylesheet: Optional[str] = None
class-attribute
instance-attribute
","text":"\u53c2\u6570\u63a7\u4ef6\u7684\u6837\u5f0f\u8868\u3002
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidgetConfig.target_widget_class","title":"target_widget_class() -> Type[BaseParameterWidget]
abstractmethod
classmethod
","text":"\u76ee\u6807\u63a7\u4ef6\u7c7b\uff0c\u5373\u672c\u914d\u7f6e\u7c7b\u9002\u7528\u7684\u53c2\u6570\u63a7\u4ef6\u7c7b\u3002\u5b50\u7c7b\u5fc5\u987b\u5b9e\u73b0\u6b64\u65b9\u6cd5\u3002
Returns:
Type Description Type[BaseParameterWidget]
\u76ee\u6807\u63a7\u4ef6\u7c7b
Source code in pyguiadapter\\paramwidget.py
@classmethod\n@abstractmethod\ndef target_widget_class(cls) -> Type[\"BaseParameterWidget\"]:\n \"\"\"\n \u76ee\u6807\u63a7\u4ef6\u7c7b\uff0c\u5373\u672c\u914d\u7f6e\u7c7b\u9002\u7528\u7684\u53c2\u6570\u63a7\u4ef6\u7c7b\u3002\u5b50\u7c7b\u5fc5\u987b\u5b9e\u73b0\u6b64\u65b9\u6cd5\u3002\n\n Returns:\n \u76ee\u6807\u63a7\u4ef6\u7c7b\n \"\"\"\n pass\n
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidget","title":"BaseParameterWidget
","text":" Bases: QWidget
\u53c2\u6570\u63a7\u4ef6\u57fa\u7c7b\u3002\u5b9a\u4e49\u4e86\u6240\u6709\u53c2\u6570\u63a7\u4ef6\u5171\u6709\u7684\u63a5\u53e3\u3002
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidget.ConfigClass","title":"ConfigClass: Type[_T] = NotImplemented
class-attribute
instance-attribute
","text":"\u53c2\u6570\u63a7\u4ef6\u5bf9\u5e94\u7684\u914d\u7f6e\u7c7b\u3002\u5fc5\u987b\u4e3aBaseParameterWidgetConfig\u7684\u5b50\u7c7b\u3002\u5fc5\u987b\u5728\u5b50\u7c7b\u4e2d\u5b9e\u73b0\u3002
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidget.__init__","title":"__init__(parent: Optional[QWidget], parameter_name: str, config: BaseParameterWidgetConfig)
","text":"\u6784\u9020\u51fd\u6570\u3002
Parameters:
Name Type Description Default parent
Optional[QWidget]
\u7236\u63a7\u4ef6
required parameter_name
str
\u53c2\u6570\u540d
required config
BaseParameterWidgetConfig
\u53c2\u6570\u63a7\u4ef6\u914d\u7f6e
required"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidget.build","title":"build() -> BaseParameterWidget
abstractmethod
","text":"\u6784\u5efa\u53c2\u6570\u63a7\u4ef6\u3002\u5b50\u7c7b\u5fc5\u987b\u5b9e\u73b0\u6b64\u65b9\u6cd5\u3002
Returns:
Type Description BaseParameterWidget
\u53c2\u6570\u63a7\u4ef6\u5b9e\u4f8b
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidget.get_value","title":"get_value() -> Any
abstractmethod
","text":"\u4ece\u63a7\u4ef6\u83b7\u53d6\u53c2\u6570\u503c\u3002\u5b50\u7c7b\u5fc5\u987b\u5b9e\u73b0\u6b64\u65b9\u6cd5\u3002
Returns:
Type Description Any
\u53c2\u6570\u503c
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidget.on_clear_parameter_error","title":"on_clear_parameter_error(parameter_name: Optional[str]) -> None
","text":"\u6e05\u9664\u53c2\u6570\u9519\u8bef\u65f6\u56de\u8c03\u3002\u5b50\u7c7b\u53ef\u91cd\u5199\u6b64\u65b9\u6cd5\u3002
Parameters:
Name Type Description Default parameter_name
Optional[str]
\u53c2\u6570\u540d\uff0c\u82e5\u4e3aNone\uff0c\u8868\u793a\u6e05\u9664\u6240\u6709\u53c2\u6570\u9519\u8bef\u3002
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidget.on_parameter_error","title":"on_parameter_error(parameter_name: str, error: Any) -> None
","text":"\u53c2\u6570\u9519\u8bef\u65f6\u56de\u8c03\u3002\u5b50\u7c7b\u53ef\u91cd\u5199\u6b64\u65b9\u6cd5\u3002
Parameters:
Name Type Description Default parameter_name
str
\u53c2\u6570\u540d
required error
Any
\u9519\u8bef\u4fe1\u606f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.paramwidget/#pyguiadapter.paramwidget.BaseParameterWidget.set_value","title":"set_value(value: Any) -> None
abstractmethod
","text":"\u8bbe\u7f6e\u53c2\u6570\u503c\u3002\u5b50\u7c7b\u5fc5\u987b\u5b9e\u73b0\u6b64\u65b9\u6cd5\u3002
Parameters:
Name Type Description Default value
Any
\u53c2\u6570\u503c
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.textbrowser/","title":"pyguiadapter.textbrowser","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig","title":"TextBrowserConfig
dataclass
","text":" Bases: object
\u6587\u672c\u6d4f\u89c8\u5668\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\textbrowser.py
@dataclasses.dataclass\nclass TextBrowserConfig(object):\n \"\"\"\u6587\u672c\u6d4f\u89c8\u5668\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n text_color: str = COLOR_BASE_TEXT\n \"\"\"\u6587\u672c\u989c\u8272\u3002\"\"\"\n\n font_family: Union[Sequence[str], str] = None\n \"\u6587\u672c\u7684\u5b57\u4f53\u7cfb\u5217\u3002\"\n\n font_size: Optional[int] = None\n \"\"\"\u6587\u672c\u7684\u5b57\u4f53\u5927\u5c0f\uff08px\uff09\u3002\"\"\"\n\n background_color: str = COLOR_BASE_BACKGROUND\n \"\"\"\u80cc\u666f\u989c\u8272\u3002\"\"\"\n\n line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap\n \"\"\"\u6362\u884c\u6a21\u5f0f\u3002\"\"\"\n\n line_wrap_width: int = 88\n \"\"\"\u6362\u884c\u5bbd\u5ea6\u3002\"\"\"\n\n word_wrap_mode: WordWrapMode = WordWrapMode.WordWrap\n \"\"\"\u201c\u5355\u8bcd\u6362\u884c\u6a21\u5f0f\"\"\"\n\n open_external_links: bool = True\n \"\"\"\u662f\u5426\u5141\u8bb8\u6253\u5f00\u5916\u90e8\u94fe\u63a5\u3002\"\"\"\n\n stylesheet: str = \"\"\n \"\"\"\u6837\u5f0f\u8868\uff08QSS\u683c\u5f0f\uff09\u3002\"\"\"\n
"},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig.background_color","title":"background_color: str = COLOR_BASE_BACKGROUND
class-attribute
instance-attribute
","text":"\u80cc\u666f\u989c\u8272\u3002
"},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig.font_family","title":"font_family: Union[Sequence[str], str] = None
class-attribute
instance-attribute
","text":"\u6587\u672c\u7684\u5b57\u4f53\u7cfb\u5217\u3002
"},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig.font_size","title":"font_size: Optional[int] = None
class-attribute
instance-attribute
","text":"\u6587\u672c\u7684\u5b57\u4f53\u5927\u5c0f\uff08px\uff09\u3002
"},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig.line_wrap_mode","title":"line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap
class-attribute
instance-attribute
","text":"\u6362\u884c\u6a21\u5f0f\u3002
"},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig.line_wrap_width","title":"line_wrap_width: int = 88
class-attribute
instance-attribute
","text":"\u6362\u884c\u5bbd\u5ea6\u3002
"},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig.open_external_links","title":"open_external_links: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5141\u8bb8\u6253\u5f00\u5916\u90e8\u94fe\u63a5\u3002
"},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig.stylesheet","title":"stylesheet: str = ''
class-attribute
instance-attribute
","text":"\u6837\u5f0f\u8868\uff08QSS\u683c\u5f0f\uff09\u3002
"},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig.text_color","title":"text_color: str = COLOR_BASE_TEXT
class-attribute
instance-attribute
","text":"\u6587\u672c\u989c\u8272\u3002
"},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.TextBrowserConfig.word_wrap_mode","title":"word_wrap_mode: WordWrapMode = WordWrapMode.WordWrap
class-attribute
instance-attribute
","text":"\u201c\u5355\u8bcd\u6362\u884c\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.textbrowser/#_1","title":"\u7c7b\u578b\u548c\u5e38\u91cf","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.LineWrapMode","title":"LineWrapMode = QTextBrowser.LineWrapMode
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.NoLineWrap","title":"NoLineWrap = QTextBrowser.NoWrap
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.WidgetWidth","title":"WidgetWidth = QTextBrowser.WidgetWidth
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.FixedPixelWidth","title":"FixedPixelWidth = QTextBrowser.FixedPixelWidth
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.FixedColumnWidth","title":"FixedColumnWidth = QTextBrowser.FixedColumnWidth
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.WordWrapMode","title":"WordWrapMode = QTextOption.WrapMode
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.NoWrap","title":"NoWrap = QTextOption.NoWrap
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.WordWrap","title":"WordWrap = QTextOption.WordWrap
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.ManualWrap","title":"ManualWrap = QTextOption.ManualWrap
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.WrapAnywhere","title":"WrapAnywhere = QTextOption.WrapAnywhere
module-attribute
","text":""},{"location":"apis/pyguiadapter.textbrowser/#pyguiadapter.textbrowser.WrapAtWordBoundaryOrAnywhere","title":"WrapAtWordBoundaryOrAnywhere = QTextOption.WrapAtWordBoundaryOrAnywhere
module-attribute
","text":""},{"location":"apis/pyguiadapter.toast/","title":"pyguiadapter.toast","text":""},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig","title":"ToastConfig
dataclass
","text":" Bases: object
Toast\u63a7\u4ef6\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\toast.py
@dataclasses.dataclass(frozen=True)\nclass ToastConfig(object):\n \"\"\"\n Toast\u63a7\u4ef6\u914d\u7f6e\u7c7b\n \"\"\"\n\n opacity: float = 0.9\n \"\"\"\u4e0d\u900f\u660e\u5ea6\"\"\"\n\n background_color: str = COLOR_TOAST_BACKGROUND_CLASSIC\n \"\"\"\u80cc\u666f\u989c\u8272\"\"\"\n\n text_color: str = COLOR_TOAST_TEXT_CLASSIC\n \"\"\"\u6587\u5b57\u989c\u8272\"\"\"\n\n text_padding: int = 50\n \"\"\"\u6587\u5b57\u8fb9\u8ddd\"\"\"\n\n text_alignment: Optional[TextAlignment] = None\n \"\"\"\u6587\u5b57\u5bf9\u9f50\u65b9\u5f0f\"\"\"\n\n font_family: Union[Sequence[str], str] = FONT_FAMILY\n \"\"\"\u5b57\u4f53\"\"\"\n\n font_size: int = 26\n \"\"\"\u5b57\u4f53\u5927\u5c0f\"\"\"\n\n position: Optional[Tuple[Union[int, float, None], Union[int, float, None]]] = (\n DEFAULT_POSITION\n )\n \"\"\"\u663e\u793a\u4f4d\u7f6e\uff0c\u53ef\u4ee5\u4f7f\u7528\u767e\u5206\u6bd4\u6216\u7edd\u5bf9\u5750\u6807\uff0c\u6bd4\u5982`(0.5, 0.5)`\u8868\u793a\u5728\u5c4f\u5e55\u4e2d\u5fc3\u663e\u793a\uff0c`(100, 100)`\u8868\u793a\u5728\u5c4f\u5e55\u5750\u6807x=100 y=100\u5904\u663e\u793a\"\"\"\n\n fixed_size: Optional[Tuple[int, int]] = None\n \"\"\"\u56fa\u5b9a\u5c3a\u5bf8\"\"\"\n\n fade_out: Optional[int] = None\n \"\"\"\u6de1\u51fa\u65f6\u95f4\"\"\"\n\n styles: Optional[Dict[str, str]] = None\n \"\"\"\u989d\u5916\u6837\u5f0f\"\"\"\n
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.background_color","title":"background_color: str = COLOR_TOAST_BACKGROUND_CLASSIC
class-attribute
instance-attribute
","text":"\u80cc\u666f\u989c\u8272
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.fade_out","title":"fade_out: Optional[int] = None
class-attribute
instance-attribute
","text":"\u6de1\u51fa\u65f6\u95f4
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.fixed_size","title":"fixed_size: Optional[Tuple[int, int]] = None
class-attribute
instance-attribute
","text":"\u56fa\u5b9a\u5c3a\u5bf8
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.font_family","title":"font_family: Union[Sequence[str], str] = FONT_FAMILY
class-attribute
instance-attribute
","text":"\u5b57\u4f53
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.font_size","title":"font_size: int = 26
class-attribute
instance-attribute
","text":"\u5b57\u4f53\u5927\u5c0f
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.opacity","title":"opacity: float = 0.9
class-attribute
instance-attribute
","text":"\u4e0d\u900f\u660e\u5ea6
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.position","title":"position: Optional[Tuple[Union[int, float, None], Union[int, float, None]]] = DEFAULT_POSITION
class-attribute
instance-attribute
","text":"\u663e\u793a\u4f4d\u7f6e\uff0c\u53ef\u4ee5\u4f7f\u7528\u767e\u5206\u6bd4\u6216\u7edd\u5bf9\u5750\u6807\uff0c\u6bd4\u5982(0.5, 0.5)
\u8868\u793a\u5728\u5c4f\u5e55\u4e2d\u5fc3\u663e\u793a\uff0c(100, 100)
\u8868\u793a\u5728\u5c4f\u5e55\u5750\u6807x=100 y=100\u5904\u663e\u793a
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.styles","title":"styles: Optional[Dict[str, str]] = None
class-attribute
instance-attribute
","text":"\u989d\u5916\u6837\u5f0f
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.text_alignment","title":"text_alignment: Optional[TextAlignment] = None
class-attribute
instance-attribute
","text":"\u6587\u5b57\u5bf9\u9f50\u65b9\u5f0f
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.text_color","title":"text_color: str = COLOR_TOAST_TEXT_CLASSIC
class-attribute
instance-attribute
","text":"\u6587\u5b57\u989c\u8272
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.ToastConfig.text_padding","title":"text_padding: int = 50
class-attribute
instance-attribute
","text":"\u6587\u5b57\u8fb9\u8ddd
"},{"location":"apis/pyguiadapter.toast/#_1","title":"\u7c7b\u578b\u4e0e\u5e38\u91cf","text":""},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.TextAlignment","title":"TextAlignment = Union[Qt.AlignmentFlag, int]
module-attribute
","text":"\u6587\u5b57\u5bf9\u9f50\u65b9\u5f0f
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.AlignCenter","title":"AlignCenter = Qt.AlignVCenter | Qt.AlignHCenter
module-attribute
","text":"\u5c45\u4e2d\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.AlignLeft","title":"AlignLeft = Qt.AlignLeft | Qt.AlignVCenter
module-attribute
","text":"\u5de6\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.toast/#pyguiadapter.toast.AlignRight","title":"AlignRight = Qt.AlignRight | Qt.AlignVCenter
module-attribute
","text":"\u53f3\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.toolbar/","title":"pyguiadapter.toolbar","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBar","title":"ToolBar
dataclass
","text":" Bases: object
\u8be5\u7c7b\u7528\u4e8e\u914d\u7f6e\u7a97\u53e3\u4e0a\u7684\u5de5\u5177\u680f
Source code in pyguiadapter\\toolbar.py
@dataclasses.dataclass(frozen=True)\nclass ToolBar(object):\n \"\"\"\u8be5\u7c7b\u7528\u4e8e\u914d\u7f6e\u7a97\u53e3\u4e0a\u7684\u5de5\u5177\u680f\"\"\"\n\n actions: List[Union[Action, Separator]]\n \"\"\"\u8981\u6dfb\u52a0\u5230\u5de5\u5177\u680f\u4e2d\u7684\u52a8\u4f5c\uff08`Action`\uff09\u6216\u5206\u9694\u7b26\uff08`Separator`\uff09\u5217\u8868\u3002\u5728\u5de5\u5177\u680f\u4e2d\uff0c\u52a8\u4f5c`Action`\u4ee5\u5de5\u5177\u680f\u6309\u94ae\u7684\u5f62\u5f0f\u51fa\u73b0\u3002\"\"\"\n\n moveable: bool = True\n \"\"\"\u5de5\u5177\u680f\u662f\u5426\u53ef\u4ee5\u79fb\u52a8\u3002\"\"\"\n\n floatable: bool = True\n \"\"\"\u5de5\u5177\u680f\u662f\u5426\u53ef\u4ee5\u6f02\u6d6e\u5728\u4e3b\u7a97\u53e3\u4e4b\u5916\u3002\"\"\"\n\n icon_size: Union[int, Tuple[int, int], QSize, None] = None\n \"\"\"\u5de5\u5177\u680f\u6309\u94ae\u7684\u56fe\u6807\u5927\u5c0f\uff0c\"\"\"\n\n initial_area: Optional[ToolBarArea] = None\n \"\"\"\u5de5\u5177\u680f\u5728\u7a97\u53e3\u4e0a\u7684\u521d\u59cb\u4f4d\u7f6e\u3002\"\"\"\n\n allowed_areas: Optional[ToolBarAreas] = None\n \"\"\"\u7a97\u53e3\u4e0a\u5141\u8bb8\u5de5\u5177\u680f\u505c\u9760\u7684\u4f4d\u7f6e\u3002\"\"\"\n\n button_style: Optional[ToolButtonStyle] = None\n \"\"\"\u5de5\u5177\u680f\u6309\u7684\u6837\u5f0f\u3002\"\"\"\n\n def remove_action(self, action: Union[str, Action, Separator]):\n if isinstance(action, str):\n for action_ in self.actions:\n if isinstance(action_, Action):\n if action_.text == action:\n action = action_\n break\n if action in self.actions:\n self.actions.remove(action)\n return\n if action in self.actions:\n self.actions.remove(action)\n return\n
"},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBar.actions","title":"actions: List[Union[Action, Separator]]
instance-attribute
","text":"\u8981\u6dfb\u52a0\u5230\u5de5\u5177\u680f\u4e2d\u7684\u52a8\u4f5c\uff08Action
\uff09\u6216\u5206\u9694\u7b26\uff08Separator
\uff09\u5217\u8868\u3002\u5728\u5de5\u5177\u680f\u4e2d\uff0c\u52a8\u4f5cAction
\u4ee5\u5de5\u5177\u680f\u6309\u94ae\u7684\u5f62\u5f0f\u51fa\u73b0\u3002
"},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBar.allowed_areas","title":"allowed_areas: Optional[ToolBarAreas] = None
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u4e0a\u5141\u8bb8\u5de5\u5177\u680f\u505c\u9760\u7684\u4f4d\u7f6e\u3002
"},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBar.button_style","title":"button_style: Optional[ToolButtonStyle] = None
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u6309\u7684\u6837\u5f0f\u3002
"},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBar.floatable","title":"floatable: bool = True
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u662f\u5426\u53ef\u4ee5\u6f02\u6d6e\u5728\u4e3b\u7a97\u53e3\u4e4b\u5916\u3002
"},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBar.icon_size","title":"icon_size: Union[int, Tuple[int, int], QSize, None] = None
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u6309\u94ae\u7684\u56fe\u6807\u5927\u5c0f\uff0c
"},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBar.initial_area","title":"initial_area: Optional[ToolBarArea] = None
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u5728\u7a97\u53e3\u4e0a\u7684\u521d\u59cb\u4f4d\u7f6e\u3002
"},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBar.moveable","title":"moveable: bool = True
class-attribute
instance-attribute
","text":"\u5de5\u5177\u680f\u662f\u5426\u53ef\u4ee5\u79fb\u52a8\u3002
"},{"location":"apis/pyguiadapter.toolbar/#_1","title":"\u7c7b\u578b\u4e0e\u5e38\u91cf","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBarArea","title":"ToolBarArea = Qt.ToolBarArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.TopToolBarArea","title":"TopToolBarArea = ToolBarArea.TopToolBarArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.BottomToolBarArea","title":"BottomToolBarArea = ToolBarArea.BottomToolBarArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.LeftToolBarArea","title":"LeftToolBarArea = ToolBarArea.LeftToolBarArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.RightToolBarArea","title":"RightToolBarArea = ToolBarArea.RightToolBarArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolBarAreas","title":"ToolBarAreas = Union[ToolBarArea, int]
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.AllToolBarAreas","title":"AllToolBarAreas = Qt.AllToolBarAreas
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolButtonStyle","title":"ToolButtonStyle = Qt.ToolButtonStyle
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolButtonIconOnly","title":"ToolButtonIconOnly = ToolButtonStyle.ToolButtonIconOnly
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolButtonTextBesideIcon","title":"ToolButtonTextBesideIcon = ToolButtonStyle.ToolButtonTextBesideIcon
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolButtonTextUnderIcon","title":"ToolButtonTextUnderIcon = ToolButtonStyle.ToolButtonTextUnderIcon
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolButtonFollowStyle","title":"ToolButtonFollowStyle = ToolButtonStyle.ToolButtonFollowStyle
module-attribute
","text":""},{"location":"apis/pyguiadapter.toolbar/#pyguiadapter.toolbar.ToolButtonTextOnly","title":"ToolButtonTextOnly = ToolButtonStyle.ToolButtonTextOnly
module-attribute
","text":""},{"location":"apis/pyguiadapter.widgets.boolbox/","title":"pyguiadapter.widgets.boolbox","text":""},{"location":"apis/pyguiadapter.widgets.boolbox/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.boolbox/#pyguiadapter.widgets.BoolBoxConfig","title":"BoolBoxConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
BoolBox\u63a7\u4ef6\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\basic\\boolbox.py
@dataclasses.dataclass(frozen=True)\nclass BoolBoxConfig(CommonParameterWidgetConfig):\n \"\"\"\n BoolBox\u63a7\u4ef6\u7684\u914d\u7f6e\u7c7b\u3002\n \"\"\"\n\n default_value: Optional[bool] = False\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\u3002\"\"\"\n\n true_text: str = \"True\"\n \"\"\"\u503c\u4e3aTrue\u7684\u9009\u9879\u6587\u672c\"\"\"\n\n false_text: str = \"False\"\n \"\"\"\u503c\u4e3aFalse\u7684\u9009\u9879\u6587\u672c\"\"\"\n\n true_icon: IconType = None\n \"\"\"\u503c\u4e3aTrue\u7684\u9009\u9879\u56fe\u6807\"\"\"\n\n false_icon: IconType = None\n \"\"\"\u503c\u4e3aFalse\u7684\u9009\u9879\u56fe\u6807\"\"\"\n\n vertical: bool = False\n \"\"\"\u662f\u5426\u4e3a\u5782\u76f4\u5e03\u5c40\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"BoolBox\"]:\n return BoolBox\n
"},{"location":"apis/pyguiadapter.widgets.boolbox/#pyguiadapter.widgets.BoolBoxConfig.default_value","title":"default_value: Optional[bool] = False
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\u3002
"},{"location":"apis/pyguiadapter.widgets.boolbox/#pyguiadapter.widgets.BoolBoxConfig.false_icon","title":"false_icon: IconType = None
class-attribute
instance-attribute
","text":"\u503c\u4e3aFalse\u7684\u9009\u9879\u56fe\u6807
"},{"location":"apis/pyguiadapter.widgets.boolbox/#pyguiadapter.widgets.BoolBoxConfig.false_text","title":"false_text: str = 'False'
class-attribute
instance-attribute
","text":"\u503c\u4e3aFalse\u7684\u9009\u9879\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.boolbox/#pyguiadapter.widgets.BoolBoxConfig.true_icon","title":"true_icon: IconType = None
class-attribute
instance-attribute
","text":"\u503c\u4e3aTrue\u7684\u9009\u9879\u56fe\u6807
"},{"location":"apis/pyguiadapter.widgets.boolbox/#pyguiadapter.widgets.BoolBoxConfig.true_text","title":"true_text: str = 'True'
class-attribute
instance-attribute
","text":"\u503c\u4e3aTrue\u7684\u9009\u9879\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.boolbox/#pyguiadapter.widgets.BoolBoxConfig.vertical","title":"vertical: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u4e3a\u5782\u76f4\u5e03\u5c40
"},{"location":"apis/pyguiadapter.widgets.boolbox/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.boolbox/#pyguiadapter.widgets.BoolBox","title":"BoolBox
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.boolbox/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" bool
"},{"location":"apis/pyguiadapter.widgets.choicebox/","title":"pyguiadapter.widgets.choicebox","text":""},{"location":"apis/pyguiadapter.widgets.choicebox/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.choicebox/#pyguiadapter.widgets.ChoiceBoxConfig","title":"ChoiceBoxConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
ChoiceBox\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\extend\\choicebox.py
@dataclasses.dataclass(frozen=True)\nclass ChoiceBoxConfig(CommonParameterWidgetConfig):\n \"\"\"ChoiceBox\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[Any] = _FIRST_ITEM\n \"\"\"\u9ed8\u8ba4\u9009\u9879\uff0c`_FIRST_ITEM`\u662f\u4e00\u4e2a\u7279\u6b8a\u503c\uff0c\u8868\u793a\u9009\u62e9\u9009\u9879\u5217\u8868\u4e2d\u7684\u7b2c\u4e00\u4e2a\"\"\"\n\n choices: Union[Dict[str, Any], Sequence[Any]] = dataclasses.field(\n default_factory=list\n )\n \"\"\"\u9009\u9879\u5217\u8868\uff0c\u53ef\u4ee5\u662f\u5b57\u5178\u6216\u5217\u8868\u3001\u5143\u7ec4\u7b49\u5e8f\u5217\u5bf9\u8c61\u3002\u4e3a\u5b57\u5178\u65f6\uff0c\u952e\u503c\u5bf9\u7684\u952e\u4e3a\u663e\u793a\u6587\u672c\uff0c\u503c\u4e3a\u5b9e\u9645\u503c\uff1b\u4e3a\u5e8f\u5217\u5bf9\u8c61\u65f6\uff0c\u5bf9\u5e8f\u5217\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u8c03\u7528`str()`\uff0c\n \u4ee5\u5176\u8fd4\u56de\u503c\u4f5c\u4e3a\u663e\u793a\u6587\u672c\uff0c\u5143\u7d20\u672c\u8eab\u4f5c\u4e3a\u5b9e\u9645\u503c\u3002\"\"\"\n\n editable: bool = False\n \"\"\"\u662f\u5426\u5141\u8bb8\u7f16\u8f91\"\"\"\n\n add_user_input: bool = True\n \"\"\"\u5728`editable`\u4e3a`True`\u65f6\uff0c\u7528\u6237\u8f93\u5165\u7684\u5185\u5bb9\u662f\u5426\u4f5c\u4e3a\u65b0\u7684\u9009\u9879\u6dfb\u52a0\u5230\u9009\u9879\u5217\u8868\u4e2d\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"ChoiceBox\"]:\n return ChoiceBox\n
"},{"location":"apis/pyguiadapter.widgets.choicebox/#pyguiadapter.widgets.ChoiceBoxConfig.add_user_input","title":"add_user_input: bool = True
class-attribute
instance-attribute
","text":"\u5728editable
\u4e3aTrue
\u65f6\uff0c\u7528\u6237\u8f93\u5165\u7684\u5185\u5bb9\u662f\u5426\u4f5c\u4e3a\u65b0\u7684\u9009\u9879\u6dfb\u52a0\u5230\u9009\u9879\u5217\u8868\u4e2d
"},{"location":"apis/pyguiadapter.widgets.choicebox/#pyguiadapter.widgets.ChoiceBoxConfig.choices","title":"choices: Union[Dict[str, Any], Sequence[Any]] = dataclasses.field(default_factory=list)
class-attribute
instance-attribute
","text":"\u9009\u9879\u5217\u8868\uff0c\u53ef\u4ee5\u662f\u5b57\u5178\u6216\u5217\u8868\u3001\u5143\u7ec4\u7b49\u5e8f\u5217\u5bf9\u8c61\u3002\u4e3a\u5b57\u5178\u65f6\uff0c\u952e\u503c\u5bf9\u7684\u952e\u4e3a\u663e\u793a\u6587\u672c\uff0c\u503c\u4e3a\u5b9e\u9645\u503c\uff1b\u4e3a\u5e8f\u5217\u5bf9\u8c61\u65f6\uff0c\u5bf9\u5e8f\u5217\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u8c03\u7528str()
\uff0c \u4ee5\u5176\u8fd4\u56de\u503c\u4f5c\u4e3a\u663e\u793a\u6587\u672c\uff0c\u5143\u7d20\u672c\u8eab\u4f5c\u4e3a\u5b9e\u9645\u503c\u3002
"},{"location":"apis/pyguiadapter.widgets.choicebox/#pyguiadapter.widgets.ChoiceBoxConfig.default_value","title":"default_value: Optional[Any] = _FIRST_ITEM
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u9009\u9879\uff0c_FIRST_ITEM
\u662f\u4e00\u4e2a\u7279\u6b8a\u503c\uff0c\u8868\u793a\u9009\u62e9\u9009\u9879\u5217\u8868\u4e2d\u7684\u7b2c\u4e00\u4e2a
"},{"location":"apis/pyguiadapter.widgets.choicebox/#pyguiadapter.widgets.ChoiceBoxConfig.editable","title":"editable: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5141\u8bb8\u7f16\u8f91
"},{"location":"apis/pyguiadapter.widgets.choicebox/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.choicebox/#pyguiadapter.widgets.ChoiceBox","title":"ChoiceBox
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.choicebox/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" choice_t
"},{"location":"apis/pyguiadapter.widgets.colorpicker/","title":"pyguiadapter.widgets.colorpicker","text":""},{"location":"apis/pyguiadapter.widgets.colorpicker/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.colorpicker/#pyguiadapter.widgets.ColorPickerConfig","title":"ColorPickerConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
ColorPicker\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\extend\\colorpicker.py
@dataclasses.dataclass(frozen=True)\nclass ColorPickerConfig(CommonParameterWidgetConfig):\n \"\"\"ColorPicker\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[ColorType] = \"white\"\n \"\"\"\u9ed8\u8ba4\u989c\u8272\u503c\uff0c\u53ef\u4ee5\u4e3a\u989c\u8272\u540d\u79f0\uff0cRGB\uff08\u6216RGBA\uff09\u5b57\u7b26\u4e32\uff0cQColor\uff0c\u6216\u989c\u8272\u5143\u7ec4\uff08\u5217\u8868\uff09\"\"\"\n\n initial_color: ColorType = \"white\"\n\n alpha_channel: bool = True\n \"\"\"\u662f\u5426\u663e\u793aAlpha\u901a\u9053\"\"\"\n\n display_color_name: bool = True\n \"\"\"\u989c\u8272\u6807\u7b7e\u4e0a\u662f\u5426\u663e\u793a\u989c\u8272\u540d\u79f0\"\"\"\n\n width: Optional[int] = None\n \"\"\"\u989c\u8272\u6807\u7b7e\u7684\u5bbd\u5ea6\"\"\"\n\n height: Optional[int] = 45\n \"\"\"\u989c\u8272\u6807\u7b7e\u7684\u9ad8\u5ea6\"\"\"\n\n return_type: Literal[\"tuple\", \"QColor\", \"str\"] = \"tuple\"\n \"\"\"\u8fd4\u56de\u503c\u7c7b\u578b\uff0c\u5373\u4ece\u63a7\u4ef6\u83b7\u53d6\u503c\u65f6\u5f97\u5230\u7684\u503c\u7684\u7c7b\u578b\uff0c\u53ef\u4ee5\u4e3a\u201ctuple\u201d\uff08\u8fd4\u56deRGB\u6216RGBA\u5143\u7ec4\uff09\uff0c\u201cQColor\u201d\uff08\u8fd4\u56deQColor\u5bf9\u8c61\uff09\uff0c\n \u6216\u201cstr\u201d\uff08\u8fd4\u56deRGB\u6216RGBA\u5341\u516d\u8fdb\u5236\u5b57\u7b26\u4e32\uff09\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"ColorPicker\"]:\n return ColorPicker\n
"},{"location":"apis/pyguiadapter.widgets.colorpicker/#pyguiadapter.widgets.ColorPickerConfig.alpha_channel","title":"alpha_channel: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793aAlpha\u901a\u9053
"},{"location":"apis/pyguiadapter.widgets.colorpicker/#pyguiadapter.widgets.ColorPickerConfig.default_value","title":"default_value: Optional[ColorType] = 'white'
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u989c\u8272\u503c\uff0c\u53ef\u4ee5\u4e3a\u989c\u8272\u540d\u79f0\uff0cRGB\uff08\u6216RGBA\uff09\u5b57\u7b26\u4e32\uff0cQColor\uff0c\u6216\u989c\u8272\u5143\u7ec4\uff08\u5217\u8868\uff09
"},{"location":"apis/pyguiadapter.widgets.colorpicker/#pyguiadapter.widgets.ColorPickerConfig.display_color_name","title":"display_color_name: bool = True
class-attribute
instance-attribute
","text":"\u989c\u8272\u6807\u7b7e\u4e0a\u662f\u5426\u663e\u793a\u989c\u8272\u540d\u79f0
"},{"location":"apis/pyguiadapter.widgets.colorpicker/#pyguiadapter.widgets.ColorPickerConfig.height","title":"height: Optional[int] = 45
class-attribute
instance-attribute
","text":"\u989c\u8272\u6807\u7b7e\u7684\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.colorpicker/#pyguiadapter.widgets.ColorPickerConfig.return_type","title":"return_type: Literal['tuple', 'QColor', 'str'] = 'tuple'
class-attribute
instance-attribute
","text":"\u8fd4\u56de\u503c\u7c7b\u578b\uff0c\u5373\u4ece\u63a7\u4ef6\u83b7\u53d6\u503c\u65f6\u5f97\u5230\u7684\u503c\u7684\u7c7b\u578b\uff0c\u53ef\u4ee5\u4e3a\u201ctuple\u201d\uff08\u8fd4\u56deRGB\u6216RGBA\u5143\u7ec4\uff09\uff0c\u201cQColor\u201d\uff08\u8fd4\u56deQColor\u5bf9\u8c61\uff09\uff0c \u6216\u201cstr\u201d\uff08\u8fd4\u56deRGB\u6216RGBA\u5341\u516d\u8fdb\u5236\u5b57\u7b26\u4e32\uff09
"},{"location":"apis/pyguiadapter.widgets.colorpicker/#pyguiadapter.widgets.ColorPickerConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"\u989c\u8272\u6807\u7b7e\u7684\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.colorpicker/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.colorpicker/#pyguiadapter.widgets.ColorHexPicker","title":"ColorHexPicker
","text":" Bases: ColorPicker
"},{"location":"apis/pyguiadapter.widgets.colorpicker/#pyguiadapter.widgets.ColorTuplePicker","title":"ColorTuplePicker
","text":" Bases: ColorPicker
"},{"location":"apis/pyguiadapter.widgets.colorpicker/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" color_hex_t
color_tuple_t
"},{"location":"apis/pyguiadapter.widgets.common/","title":"pyguiadapter.widgets.common","text":""},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig","title":"CommonParameterWidgetConfig
dataclass
","text":" Bases: BaseParameterWidgetConfig
\u901a\u7528\u53c2\u6570\u63a7\u4ef6\u914d\u7f6e\u7c7b\u3002\u7ee7\u627f\u81ea BaseParameterWidgetConfig
\u7c7b\u3002\u662f\u6240\u6709\u901a\u7528\u53c2\u6570\u63a7\u4ef6\u7684\u914d\u7f6e\u57fa\u7c7b\u3002
Source code in pyguiadapter\\widgets\\common.py
@dataclasses.dataclass(frozen=True)\nclass CommonParameterWidgetConfig(BaseParameterWidgetConfig):\n \"\"\"\n \u901a\u7528\u53c2\u6570\u63a7\u4ef6\u914d\u7f6e\u7c7b\u3002\u7ee7\u627f\u81ea `BaseParameterWidgetConfig` \u7c7b\u3002\u662f\u6240\u6709\u901a\u7528\u53c2\u6570\u63a7\u4ef6\u7684\u914d\u7f6e\u57fa\u7c7b\u3002\n \"\"\"\n\n set_default_value_on_init: bool = True\n \"\"\"\n \u662f\u5426\u5728\u63a7\u4ef6\u521d\u59cb\u5316\u65f6\u8bbe\u7f6e\u9ed8\u8ba4\u503c\u3002\u9ed8\u8ba4\u4e3a `True`\u3002\n \"\"\"\n\n hide_default_value_checkbox: bool = True\n \"\"\"\u662f\u5426\u9690\u85cf\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u3002\u5f53default_value\u4e3aNone\u65f6\uff0c\u6b64\u9009\u9879\u65e0\u6548\uff0c\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u59cb\u7ec8\u663e\u793a\u3002\"\"\"\n\n set_deepcopy: bool = True\n get_deepcopy: bool = True\n\n description_font_size: Optional[int] = None\n \"\"\"\u63a7\u4ef6\u63cf\u8ff0\u6587\u672c\u5b57\u4f53\u5927\u5c0f\u3002\"\"\"\n\n description_color: Optional[str] = COLOR_REGULAR_TEXT\n \"\"\"\u63a7\u4ef6\u63cf\u8ff0\u6587\u672c\u989c\u8272\u3002\u9ed8\u8ba4\u4e3a `COLOR_REGULAR_TEXT`\u3002\"\"\"\n\n parameter_error_font_size: Optional[int] = None\n \"\"\"ParameterError\u6587\u672c\u5b57\u4f53\u5927\u5c0f\u3002\"\"\"\n\n parameter_error_color: Optional[str] = COLOR_FATAL\n \"\"\"ParameterError\u6587\u672c\u989c\u8272\u3002\u9ed8\u8ba4\u4e3a `COLOR_FATAL`\u3002\"\"\"\n\n highlight_effect: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u9ad8\u4eae\u6548\u679c\u3002\u5f53\u542f\u7528\u9ad8\u4eae\u6548\u679c\u65f6\uff0c\u5141\u8bb8\u5f00\u53d1\u8005\u9ad8\u4eae\u663e\u793a\u8be5\u63a7\u4ef6\u3002\"\"\"\n\n effect_class: Optional[Type[QGraphicsEffect]] = QGraphicsDropShadowEffect\n \"\"\"\u9ad8\u4eae\u6548\u679c\u7c7b\u3002\u9ed8\u8ba4\u4e3a `QGraphicsDropShadowEffect`\u3002\"\"\"\n\n effect_properties: Optional[dict] = dataclasses.field(\n default_factory=_default_highlight_effect_properties\n )\n \"\"\"\u9ad8\u4eae\u6548\u679c\u5c5e\u6027\u3002\u9ed8\u8ba4\u4e3a `None`\u3002\"\"\"\n\n drag_n_drop: bool = False\n \"\"\"\u662f\u5426\u542f\u7528\u62d6\u653e\u529f\u80fd\u3002\u9ed8\u8ba4\u4e3a `False`\u3002\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"CommonParameterWidget\"]:\n return CommonParameterWidget\n
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.description_color","title":"description_color: Optional[str] = COLOR_REGULAR_TEXT
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u63cf\u8ff0\u6587\u672c\u989c\u8272\u3002\u9ed8\u8ba4\u4e3a COLOR_REGULAR_TEXT
\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.description_font_size","title":"description_font_size: Optional[int] = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u63cf\u8ff0\u6587\u672c\u5b57\u4f53\u5927\u5c0f\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.drag_n_drop","title":"drag_n_drop: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u62d6\u653e\u529f\u80fd\u3002\u9ed8\u8ba4\u4e3a False
\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.effect_class","title":"effect_class: Optional[Type[QGraphicsEffect]] = QGraphicsDropShadowEffect
class-attribute
instance-attribute
","text":"\u9ad8\u4eae\u6548\u679c\u7c7b\u3002\u9ed8\u8ba4\u4e3a QGraphicsDropShadowEffect
\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.effect_properties","title":"effect_properties: Optional[dict] = dataclasses.field(default_factory=_default_highlight_effect_properties)
class-attribute
instance-attribute
","text":"\u9ad8\u4eae\u6548\u679c\u5c5e\u6027\u3002\u9ed8\u8ba4\u4e3a None
\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.hide_default_value_checkbox","title":"hide_default_value_checkbox: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u9690\u85cf\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u3002\u5f53default_value\u4e3aNone\u65f6\uff0c\u6b64\u9009\u9879\u65e0\u6548\uff0c\u9ed8\u8ba4\u503c\u590d\u9009\u6846\u59cb\u7ec8\u663e\u793a\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.highlight_effect","title":"highlight_effect: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u9ad8\u4eae\u6548\u679c\u3002\u5f53\u542f\u7528\u9ad8\u4eae\u6548\u679c\u65f6\uff0c\u5141\u8bb8\u5f00\u53d1\u8005\u9ad8\u4eae\u663e\u793a\u8be5\u63a7\u4ef6\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.parameter_error_color","title":"parameter_error_color: Optional[str] = COLOR_FATAL
class-attribute
instance-attribute
","text":"ParameterError\u6587\u672c\u989c\u8272\u3002\u9ed8\u8ba4\u4e3a COLOR_FATAL
\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.parameter_error_font_size","title":"parameter_error_font_size: Optional[int] = None
class-attribute
instance-attribute
","text":"ParameterError\u6587\u672c\u5b57\u4f53\u5927\u5c0f\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidgetConfig.set_default_value_on_init","title":"set_default_value_on_init: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5728\u63a7\u4ef6\u521d\u59cb\u5316\u65f6\u8bbe\u7f6e\u9ed8\u8ba4\u503c\u3002\u9ed8\u8ba4\u4e3a True
\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidget","title":"CommonParameterWidget
","text":" Bases: BaseParameterWidget
\u901a\u7528\u53c2\u6570\u63a7\u4ef6\u57fa\u7c7b\u3002\u7ee7\u627f\u81ea BaseParameterWidget
\u7c7b\u3002\u4e3a\u6240\u6709\u53c2\u6570\u63a7\u4ef6\u5b9a\u4e49\u4e86\u57fa\u672c\u7684\u5e03\u5c40\u548c\u6574\u4f53\u5916\u89c2\u3002\u76ee\u524d\u5185\u7f6e\u63a7\u4ef6\u5747\u7ee7\u627f\u81ea\u6b64\u7c7b\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidget.value_widget","title":"value_widget: QWidget
abstractmethod
property
","text":"\u8fd4\u56de\u201c\u503c\u63a7\u4ef6\u201d\u3002\u6b64\u4e3a\u62bd\u8c61\u65b9\u6cd5\uff0c\u5fc5\u987b\u5728\u5b50\u7c7b\u4e2d\u5b9e\u73b0\u3002
Returns:
Type Description QWidget
\u63a7\u4ef6\u793a\u4f8b\u3002
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidget.get_value_from_widget","title":"get_value_from_widget() -> Any
abstractmethod
","text":"\u4ece\u201c\u503c\u63a7\u4ef6\u201d\u4e2d\u83b7\u53d6\u7528\u6237\u5f53\u524d\u8f93\u5165\u7684\u503c\u3002\u6b64\u4e3a\u62bd\u8c61\u65b9\u6cd5\uff0c\u5fc5\u987b\u5728\u5b50\u7c7b\u4e2d\u5b9e\u73b0\u3002
Returns:
Type Description Any
\u7528\u6237\u5f53\u524d\u8f93\u5165\u7684\u503c
"},{"location":"apis/pyguiadapter.widgets.common/#pyguiadapter.widgets.common.CommonParameterWidget.set_value_to_widget","title":"set_value_to_widget(value: Any) -> None
abstractmethod
","text":"\u5c06\u7528\u6237\u4f20\u5165\u7684\u503c\u8bbe\u7f6e\u5230\u201c\u503c\u63a7\u4ef6\u201d\u4e2d\u3002\u6b64\u4e3a\u62bd\u8c61\u65b9\u6cd5\uff0c\u5fc5\u987b\u5728\u5b50\u7c7b\u4e2d\u5b9e\u73b0\u3002
Parameters:
Name Type Description Default value
Any
\u7528\u6237\u4f20\u5165\u7684\u503c
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.widgets.dateedit/","title":"pyguiadapter.widgets.dateedit","text":""},{"location":"apis/pyguiadapter.widgets.dateedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEditConfig","title":"DateEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
DateEdit\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\basic\\dateedit.py
@dataclasses.dataclass(frozen=True)\nclass DateEditConfig(CommonParameterWidgetConfig):\n \"\"\"DateEdit\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Union[date, QDate, None] = date.today()\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n min_date: Union[date, QDate, None] = None\n \"\"\"\u63a7\u4ef6\u7684\u6700\u5c0f\u65e5\u671f\"\"\"\n\n max_date: Union[date, QDate, None] = None\n \"\"\"\u63a7\u4ef6\u7684\u6700\u5927\u65e5\u671f\"\"\"\n\n display_format: Optional[str] = None\n \"\"\"\u65e5\u671f\u7684\u663e\u793a\u683c\u5f0f\uff0c\u53ef\u4ee5\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863\uff1a\n [displayFormat](https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/QDateTimeEdit.html#PySide2.QtWidgets.PySide2.QtWidgets.QDateTimeEdit.displayFormat)\n \"\"\"\n\n time_spec: Optional[TimeSpec] = None\n \"\"\"\u65f6\u95f4\u65e5\u671f\u6807\u51c6\uff0c\u53ef\u4ee5\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863:\n [TimeSpec](https://doc.qt.io/qtforpython-5/PySide2/QtCore/Qt.html#PySide2.QtCore.PySide2.QtCore.Qt.TimeSpec)\n \"\"\"\n\n alignment: Alignment = Qt.AlignLeft | Qt.AlignVCenter\n \"\"\"\u5bf9\u9f50\u65b9\u5f0f\uff0c\u53ef\u9009\u503c\u6709\uff1aAlignLeft\u3001AlignRight\u3001AlignCenter\u3001AlignJustify\u7b49\u3002\"\"\"\n\n calendar_popup: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u65e5\u5386\u5f39\u7a97\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"DateEdit\"]:\n return DateEdit\n
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEditConfig.alignment","title":"alignment: Alignment = Qt.AlignLeft | Qt.AlignVCenter
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff0c\u53ef\u9009\u503c\u6709\uff1aAlignLeft\u3001AlignRight\u3001AlignCenter\u3001AlignJustify\u7b49\u3002
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEditConfig.calendar_popup","title":"calendar_popup: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u65e5\u5386\u5f39\u7a97
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEditConfig.default_value","title":"default_value: Union[date, QDate, None] = date.today()
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEditConfig.display_format","title":"display_format: Optional[str] = None
class-attribute
instance-attribute
","text":"\u65e5\u671f\u7684\u663e\u793a\u683c\u5f0f\uff0c\u53ef\u4ee5\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863\uff1a displayFormat
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEditConfig.max_date","title":"max_date: Union[date, QDate, None] = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u6700\u5927\u65e5\u671f
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEditConfig.min_date","title":"min_date: Union[date, QDate, None] = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u6700\u5c0f\u65e5\u671f
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEditConfig.time_spec","title":"time_spec: Optional[TimeSpec] = None
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u6807\u51c6\uff0c\u53ef\u4ee5\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863: TimeSpec
"},{"location":"apis/pyguiadapter.widgets.dateedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEdit","title":"DateEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEdit.AlignCenter","title":"AlignCenter = Qt.AlignCenter
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u5c45\u4e2d\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEdit.AlignJustify","title":"AlignJustify = Qt.AlignJustify
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u4e24\u7aef\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEdit.AlignLeft","title":"AlignLeft = Qt.AlignLeft
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u5de6\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEdit.AlignRight","title":"AlignRight = Qt.AlignRight
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u53f3\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEdit.LocalTime","title":"LocalTime = Qt.LocalTime
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1a\u672c\u5730\u65f6\u95f4
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEdit.OffsetFromUTC","title":"OffsetFromUTC = Qt.OffsetFromUTC
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1aOffsetFromUTC
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEdit.TimeZone","title":"TimeZone = Qt.TimeZone
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1aTimeZone
"},{"location":"apis/pyguiadapter.widgets.dateedit/#pyguiadapter.widgets.DateEdit.UTC","title":"UTC = Qt.UTC
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1aUTC
"},{"location":"apis/pyguiadapter.widgets.dateedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" datetime.date
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/","title":"pyguiadapter.widgets.datetimeedit","text":""},{"location":"apis/pyguiadapter.widgets.datetimeedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEditConfig","title":"DateTimeEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
DateTimeEdit\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\basic\\datetimeedit.py
@dataclasses.dataclass(frozen=True)\nclass DateTimeEditConfig(CommonParameterWidgetConfig):\n \"\"\"DateTimeEdit\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Union[datetime, QDateTime, None] = dataclasses.field(\n default_factory=datetime.now\n )\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n min_datetime: Union[datetime, QDateTime, None] = None\n \"\"\"\u65f6\u95f4\u65e5\u671f\u7684\u6700\u5c0f\u503c\"\"\"\n\n max_datetime: Union[datetime, QDateTime, None] = None\n \"\"\"\u65f6\u95f4\u65e5\u671f\u7684\u6700\u5927\u503c\"\"\"\n\n display_format: Optional[str] = None\n \"\"\"\u65f6\u95f4\u65e5\u671f\u7684\u663e\u793a\u683c\u5f0f\u3002\u53ef\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863\uff1a\n [displayFormat](https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/QDateTimeEdit.html#PySide2.QtWidgets.PySide2.QtWidgets.QDateTimeEdit.displayFormat)\n \"\"\"\n\n time_spec: Optional[TimeSpec] = None\n \"\"\"\u65f6\u95f4\u65e5\u671f\u6807\u51c6\uff0c\u53ef\u9009\u503c\u6709\uff1aLocalTime\u3001UTC\u3001OffsetFromUTC\u3001TimeZone\u3002\n \u53ef\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863\uff1a\n [TimeSpec](https://doc.qt.io/qtforpython-5/PySide2/QtCore/Qt.html#PySide2.QtCore.PySide2.QtCore.Qt.TimeSpec)\n \"\"\"\n\n alignment: Alignment = Qt.AlignLeft | Qt.AlignVCenter\n \"\"\"\u5bf9\u9f50\u65b9\u5f0f\uff0c\u53ef\u9009\u503c\u6709\uff1aAlignLeft\u3001AlignRight\u3001AlignCenter\u3001AlignJustify\u7b49\u3002\"\"\"\n\n calendar_popup: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u65e5\u5386\u5f39\u7a97\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"DateTimeEdit\"]:\n return DateTimeEdit\n
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEditConfig.alignment","title":"alignment: Alignment = Qt.AlignLeft | Qt.AlignVCenter
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff0c\u53ef\u9009\u503c\u6709\uff1aAlignLeft\u3001AlignRight\u3001AlignCenter\u3001AlignJustify\u7b49\u3002
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEditConfig.calendar_popup","title":"calendar_popup: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u65e5\u5386\u5f39\u7a97
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEditConfig.default_value","title":"default_value: Union[datetime, QDateTime, None] = dataclasses.field(default_factory=datetime.now)
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEditConfig.display_format","title":"display_format: Optional[str] = None
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u663e\u793a\u683c\u5f0f\u3002\u53ef\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863\uff1a displayFormat
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEditConfig.max_datetime","title":"max_datetime: Union[datetime, QDateTime, None] = None
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6700\u5927\u503c
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEditConfig.min_datetime","title":"min_datetime: Union[datetime, QDateTime, None] = None
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6700\u5c0f\u503c
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEditConfig.time_spec","title":"time_spec: Optional[TimeSpec] = None
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u6807\u51c6\uff0c\u53ef\u9009\u503c\u6709\uff1aLocalTime\u3001UTC\u3001OffsetFromUTC\u3001TimeZone\u3002 \u53ef\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863\uff1a TimeSpec
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEdit","title":"DateTimeEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEdit.AlignCenter","title":"AlignCenter = Qt.AlignCenter
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u5c45\u4e2d\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEdit.AlignJustify","title":"AlignJustify = Qt.AlignJustify
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u4e24\u7aef\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEdit.AlignLeft","title":"AlignLeft = Qt.AlignLeft
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u5de6\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEdit.AlignRight","title":"AlignRight = Qt.AlignRight
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u53f3\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEdit.LocalTime","title":"LocalTime = Qt.LocalTime
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1a\u672c\u5730\u65f6\u95f4
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEdit.OffsetFromUTC","title":"OffsetFromUTC = Qt.OffsetFromUTC
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1aOffsetFromUTC
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEdit.TimeZone","title":"TimeZone = Qt.TimeZone
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1aTimeZone
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#pyguiadapter.widgets.DateTimeEdit.UTC","title":"UTC = Qt.UTC
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1aUTC
"},{"location":"apis/pyguiadapter.widgets.datetimeedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" datetime.datetime
"},{"location":"apis/pyguiadapter.widgets.dial/","title":"pyguiadapter.widgets.dial","text":""},{"location":"apis/pyguiadapter.widgets.dial/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig","title":"DialConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
Dial\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\dial.py
@dataclasses.dataclass(frozen=True)\nclass DialConfig(CommonParameterWidgetConfig):\n \"\"\"Dial\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Optional[int] = 0\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n min_value: int = 0\n \"\"\"\u6700\u5c0f\u503c\"\"\"\n\n max_value: int = 100\n \"\"\"\u6700\u5927\u503c\"\"\"\n\n notch_target: Optional[float] = None\n \"\"\"\u7f3a\u53e3\u4e4b\u95f4\u7684\u76ee\u6807\u50cf\u7d20\u6570\"\"\"\n\n notches_visible: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u7f3a\u53e3\"\"\"\n\n wrapping: bool = False\n \"\"\"\u662f\u5426\u5faa\u73af\"\"\"\n\n single_step: int = 1\n \"\"\"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f\"\"\"\n\n page_step: Optional[int] = None\n \"\"\"\u4f7f\u7528PageUp/PageDown\u952e\u65f6\u8c03\u6574\u7684\u6b65\u957f\"\"\"\n\n tracking: bool = True\n \"\"\"\u662f\u5426\u8ddf\u8e2a\u9f20\u6807\"\"\"\n\n inverted_controls: bool = False\n \"\"\"\u662f\u5426\u542f\u7528\u53cd\u8f6c\u63a7\u5236\"\"\"\n\n inverted_appearance: bool = False\n \"\"\"\u662f\u5426\u542f\u7528\u53cd\u8f6c\u5916\u89c2\"\"\"\n\n show_value_label: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u503c\u6807\u7b7e\"\"\"\n\n prefix: str = \"\"\n \"\"\"\u503c\u6807\u7b7e\u7684\u524d\u7f00\"\"\"\n\n suffix: str = \"\"\n \"\"\"\u503c\u6807\u7b7e\u7684\u540e\u7f00\"\"\"\n\n height: Optional[int] = 120\n \"\"\"\u63a7\u4ef6\u7684\u9ad8\u5ea6\"\"\"\n\n width: Optional[int] = None\n \"\"\"\u63a7\u4ef6\u7684\u5bbd\u5ea6\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"Dial\"]:\n return Dial\n
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.default_value","title":"default_value: Optional[int] = 0
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.height","title":"height: Optional[int] = 120
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.inverted_appearance","title":"inverted_appearance: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u53cd\u8f6c\u5916\u89c2
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.inverted_controls","title":"inverted_controls: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u53cd\u8f6c\u63a7\u5236
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.max_value","title":"max_value: int = 100
class-attribute
instance-attribute
","text":"\u6700\u5927\u503c
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.min_value","title":"min_value: int = 0
class-attribute
instance-attribute
","text":"\u6700\u5c0f\u503c
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.notch_target","title":"notch_target: Optional[float] = None
class-attribute
instance-attribute
","text":"\u7f3a\u53e3\u4e4b\u95f4\u7684\u76ee\u6807\u50cf\u7d20\u6570
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.notches_visible","title":"notches_visible: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u7f3a\u53e3
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.page_step","title":"page_step: Optional[int] = None
class-attribute
instance-attribute
","text":"\u4f7f\u7528PageUp/PageDown\u952e\u65f6\u8c03\u6574\u7684\u6b65\u957f
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.prefix","title":"prefix: str = ''
class-attribute
instance-attribute
","text":"\u503c\u6807\u7b7e\u7684\u524d\u7f00
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.show_value_label","title":"show_value_label: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u503c\u6807\u7b7e
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.single_step","title":"single_step: int = 1
class-attribute
instance-attribute
","text":"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.suffix","title":"suffix: str = ''
class-attribute
instance-attribute
","text":"\u503c\u6807\u7b7e\u7684\u540e\u7f00
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.tracking","title":"tracking: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u8ddf\u8e2a\u9f20\u6807
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.DialConfig.wrapping","title":"wrapping: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5faa\u73af
"},{"location":"apis/pyguiadapter.widgets.dial/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.dial/#pyguiadapter.widgets.Dial","title":"Dial
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.dial/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" int_dial_t
"},{"location":"apis/pyguiadapter.widgets.dictedit/","title":"pyguiadapter.widgets.dictedit","text":""},{"location":"apis/pyguiadapter.widgets.dictedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.DictEditConfig","title":"DictEditConfig
dataclass
","text":" Bases: PyLiteralEditConfig
DictEdit\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\dictedit.py
@dataclasses.dataclass(frozen=True)\nclass DictEditConfig(PyLiteralEditConfig):\n \"\"\"DictEdit\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[dict] = dataclasses.field(default_factory=dict)\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n height: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6\"\"\"\n\n width: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6\"\"\"\n\n standalone_editor: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668\"\"\"\n\n standalone_editor_button_text: str = \"Edit Dict\"\n \"\"\"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c\"\"\"\n\n standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(\n default_factory=StandaloneCodeEditorConfig\n )\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\"\"\"\n\n initial_text: str = \"{}\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"DictEdit\"]:\n return DictEdit\n
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.DictEditConfig.default_value","title":"default_value: Optional[dict] = dataclasses.field(default_factory=dict)
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.DictEditConfig.height","title":"height: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.DictEditConfig.standalone_editor","title":"standalone_editor: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.DictEditConfig.standalone_editor_button_text","title":"standalone_editor_button_text: str = 'Edit Dict'
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.DictEditConfig.standalone_editor_config","title":"standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(default_factory=StandaloneCodeEditorConfig)
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u914d\u7f6e
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.DictEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig","title":"StandaloneCodeEditorConfig
dataclass
","text":" Bases: object
standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\base.py
@dataclasses.dataclass\nclass StandaloneCodeEditorConfig(object):\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b\"\"\"\n\n title: str = STANDALONE_EDITOR_TITLE\n \"\"\"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898\"\"\"\n\n text_font_family: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\"\"\"\n\n text_font_size: Optional[int] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f\"\"\"\n\n line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n line_wrap_width: int = LINE_WRAP_WIDTH\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6\"\"\"\n\n word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n file_filters: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668\"\"\"\n\n start_dir: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55\"\"\"\n\n use_default_menus: bool = True\n \"\"\"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f\"\"\"\n\n excluded_menus: Tuple[str] = ()\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\"\"\"\n\n excluded_menu_actions: Tuple[Tuple[str, str]] = (\n (MENU_FILE, ACTION_SAVE),\n (MENU_FILE, ACTION_SAVE_AS),\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879\"\"\"\n\n use_default_toolbar: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f\"\"\"\n\n excluded_toolbar_actions: Tuple[str] = (\n ACTION_SAVE,\n ACTION_SAVE_AS,\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879\"\"\"\n\n confirm_dialog: bool = True\n \"\"\"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n confirm_dialog_title: str = CONFIRM_DIALOG_TITLE\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_dialog_message: str = CONFIRM_MSG\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9\"\"\"\n
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog","title":"confirm_dialog: bool = True
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_message","title":"confirm_dialog_message: str = CONFIRM_MSG
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_title","title":"confirm_dialog_title: str = CONFIRM_DIALOG_TITLE
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menu_actions","title":"excluded_menu_actions: Tuple[Tuple[str, str]] = ((MENU_FILE, ACTION_SAVE), (MENU_FILE, ACTION_SAVE_AS))
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menus","title":"excluded_menus: Tuple[str] = ()
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_toolbar_actions","title":"excluded_toolbar_actions: Tuple[str] = (ACTION_SAVE, ACTION_SAVE_AS)
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.file_filters","title":"file_filters: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_mode","title":"line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_width","title":"line_wrap_width: int = LINE_WRAP_WIDTH
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.start_dir","title":"start_dir: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_family","title":"text_font_family: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_size","title":"text_font_size: Optional[int] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.title","title":"title: str = STANDALONE_EDITOR_TITLE
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_menus","title":"use_default_menus: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_toolbar","title":"use_default_toolbar: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f
"},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.word_wrap_mode","title":"word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.dictedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.dictedit/#pyguiadapter.widgets.DictEdit","title":"DictEdit
","text":" Bases: PyLiteralEdit
"},{"location":"apis/pyguiadapter.widgets.dictedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" dict
typing.Dict
typing.Mapping
typing.MutableMapping
typing.TypedDict
"},{"location":"apis/pyguiadapter.widgets.dirselect/","title":"pyguiadapter.widgets.dirselect","text":""},{"location":"apis/pyguiadapter.widgets.dirselect/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelectConfig","title":"DirSelectConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
DirSelect\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\dirselect.py
@dataclasses.dataclass(frozen=True)\nclass DirSelectConfig(CommonParameterWidgetConfig):\n \"\"\"DirSelect\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Optional[str] = \"\"\n \"\"\"\u9ed8\u8ba4\u503c\"\"\"\n\n placeholder: str = \"\"\n \"\"\"\u5360\u4f4d\u7b26\u6587\u5b57\"\"\"\n\n start_dir: str = \"\"\n \"\"\"\u8d77\u59cb\u76ee\u5f55\"\"\"\n\n dialog_title: str = \"\"\n \"\"\"\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n select_button_text: str = \"...\"\n \"\"\"\u9009\u62e9\u6309\u94ae\u6587\u5b57\"\"\"\n\n clear_button: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae\"\"\"\n\n normalize_path: bool = False\n \"\"\"\u662f\u5426\u5c06\u8def\u5f84\u6807\u51c6\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u8bbe\u7f6e\u63a7\u4ef6\u503c\u6216\u8005\u4ece\u63a7\u4ef6\u83b7\u53d6\u503c\u65f6\uff0c\u4f7f\u7528os.path.normpath()\u51fd\u6570\u8fdb\u884c\u6807\u51c6\u5316\"\"\"\n\n absolutize_path: bool = False\n \"\"\"\u662f\u5426\u5c06\u8def\u5f84\u7edd\u5bf9\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u8bbe\u7f6e\u63a7\u4ef6\u503c\u6216\u8005\u4ece\u63a7\u4ef6\u83b7\u53d6\u503c\u65f6\uff0c\u5c06\u4f7f\u7528os.path.abspath()\u51fd\u6570\u8fdb\u884c\u7edd\u5bf9\u5316\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"DirSelect\"]:\n return DirSelect\n
"},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelectConfig.absolutize_path","title":"absolutize_path: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8def\u5f84\u7edd\u5bf9\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u8bbe\u7f6e\u63a7\u4ef6\u503c\u6216\u8005\u4ece\u63a7\u4ef6\u83b7\u53d6\u503c\u65f6\uff0c\u5c06\u4f7f\u7528os.path.abspath()\u51fd\u6570\u8fdb\u884c\u7edd\u5bf9\u5316
"},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelectConfig.clear_button","title":"clear_button: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae
"},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelectConfig.default_value","title":"default_value: Optional[str] = ''
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelectConfig.dialog_title","title":"dialog_title: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelectConfig.normalize_path","title":"normalize_path: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8def\u5f84\u6807\u51c6\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u8bbe\u7f6e\u63a7\u4ef6\u503c\u6216\u8005\u4ece\u63a7\u4ef6\u83b7\u53d6\u503c\u65f6\uff0c\u4f7f\u7528os.path.normpath()\u51fd\u6570\u8fdb\u884c\u6807\u51c6\u5316
"},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelectConfig.placeholder","title":"placeholder: str = ''
class-attribute
instance-attribute
","text":"\u5360\u4f4d\u7b26\u6587\u5b57
"},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelectConfig.select_button_text","title":"select_button_text: str = '...'
class-attribute
instance-attribute
","text":"\u9009\u62e9\u6309\u94ae\u6587\u5b57
"},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelectConfig.start_dir","title":"start_dir: str = ''
class-attribute
instance-attribute
","text":"\u8d77\u59cb\u76ee\u5f55
"},{"location":"apis/pyguiadapter.widgets.dirselect/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.dirselect/#pyguiadapter.widgets.DirSelect","title":"DirSelect
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.dirselect/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" directory_t
dir_t
"},{"location":"apis/pyguiadapter.widgets.enumselect/","title":"pyguiadapter.widgets.enumselect","text":""},{"location":"apis/pyguiadapter.widgets.enumselect/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.enumselect/#pyguiadapter.widgets.EnumSelectConfig","title":"EnumSelectConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
EnumSelect\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\enumselect.py
@dataclasses.dataclass(frozen=True)\nclass EnumSelectConfig(CommonParameterWidgetConfig):\n \"\"\"EnumSelect\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Union[Enum, str, int, None] = 0\n \"\"\"\u9ed8\u8ba4\u7684\u679a\u4e3e\u503c\uff0c\u53ef\u4ee5\u4e3a\u679a\u4e3e\u7c7b\u5bf9\u8c61\u3001\u679a\u4e3e\u5bf9\u8c61\u7684\u540d\u79f0\u6216\u8005\u662f\u9009\u9879\u7684\u7d22\u5f15\"\"\"\n\n icons: Optional[Dict[Union[Enum, str], IconType]] = None\n \"\"\"\u9009\u9879\u7684\u56fe\u6807\uff0c\u9700\u63d0\u4f9b\u679a\u4e3e\u5bf9\u8c61\uff08\u6216\u679a\u4e3e\u5bf9\u8c61\u7684\u540d\u79f0\uff09\u5230\u56fe\u6807\u7684\u6620\u5c04\"\"\"\n\n icon_size: Union[int, Tuple[int, int], QSize, None] = None\n \"\"\"\u9009\u9879\u56fe\u6807\u7684\u5927\u5c0f\"\"\"\n\n enum_class: Optional[Type[Enum]] = None\n\n @classmethod\n def target_widget_class(cls) -> Type[\"EnumSelect\"]:\n return EnumSelect\n
"},{"location":"apis/pyguiadapter.widgets.enumselect/#pyguiadapter.widgets.EnumSelectConfig.default_value","title":"default_value: Union[Enum, str, int, None] = 0
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u7684\u679a\u4e3e\u503c\uff0c\u53ef\u4ee5\u4e3a\u679a\u4e3e\u7c7b\u5bf9\u8c61\u3001\u679a\u4e3e\u5bf9\u8c61\u7684\u540d\u79f0\u6216\u8005\u662f\u9009\u9879\u7684\u7d22\u5f15
"},{"location":"apis/pyguiadapter.widgets.enumselect/#pyguiadapter.widgets.EnumSelectConfig.icon_size","title":"icon_size: Union[int, Tuple[int, int], QSize, None] = None
class-attribute
instance-attribute
","text":"\u9009\u9879\u56fe\u6807\u7684\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.enumselect/#pyguiadapter.widgets.EnumSelectConfig.icons","title":"icons: Optional[Dict[Union[Enum, str], IconType]] = None
class-attribute
instance-attribute
","text":"\u9009\u9879\u7684\u56fe\u6807\uff0c\u9700\u63d0\u4f9b\u679a\u4e3e\u5bf9\u8c61\uff08\u6216\u679a\u4e3e\u5bf9\u8c61\u7684\u540d\u79f0\uff09\u5230\u56fe\u6807\u7684\u6620\u5c04
"},{"location":"apis/pyguiadapter.widgets.enumselect/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.enumselect/#pyguiadapter.widgets.EnumSelect","title":"EnumSelect
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.enumselect/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" enum.Enum
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/","title":"pyguiadapter.widgets.exclusivechoice","text":""},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig","title":"ExclusiveChoiceBoxConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
ExclusiveChoiceBox\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\basic\\exclusivechoice.py
@dataclasses.dataclass(frozen=True)\nclass ExclusiveChoiceBoxConfig(CommonParameterWidgetConfig):\n \"\"\"ExclusiveChoiceBox\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Any = _FIRST_OPTION\n \"\"\"\u9ed8\u8ba4\u9009\u9879\u3002`_FIRST_OPTION`\u662f\u4e00\u4e2a\u7279\u6b8a\u503c\uff0c\u8868\u793a\u9009\u62e9\u9009\u9879\u5217\u8868\u4e2d\u7684\u7b2c\u4e00\u4e2a\u9009\u9879\u3002\"\"\"\n\n choices: Optional[List[Any]] = None\n \"\"\"\u9009\u9879\u5217\u8868\"\"\"\n\n columns: int = 1\n \"\"\"\u9009\u9879\u5217\u6570\"\"\"\n\n show_type_icon: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u9009\u9879\u7c7b\u578b\u56fe\u6807\"\"\"\n\n int_icon: IconType = \"mdi6.alpha-i-circle\"\n \"\"\"\u6574\u6570\u7c7b\u578b\u9009\u9879\u7684\u56fe\u6807\"\"\"\n\n bool_icon: str = \"mdi6.alpha-b-circle\"\n \"\"\"\u5e03\u5c14\u7c7b\u578b\u9009\u9879\u7684\u56fe\u6807\"\"\"\n\n str_icon: str = \"mdi6.alpha-s-box\"\n \"\"\"\u5b57\u7b26\u4e32\u7c7b\u578b\u9009\u9879\u7684\u56fe\u6807\"\"\"\n\n object_icon: str_icon = \"mdi6.alpha-o-box\"\n \"\"\"\u5bf9\u8c61\u7c7b\u578b\u9009\u9879\u7684\u56fe\u6807\"\"\"\n\n icon_size: Union[Tuple[int, int], int, QSize, None] = None\n \"\"\"\u9009\u9879\u56fe\u6807\u5927\u5c0f\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"ExclusiveChoiceBox\"]:\n return ExclusiveChoiceBox\n
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig.bool_icon","title":"bool_icon: str = 'mdi6.alpha-b-circle'
class-attribute
instance-attribute
","text":"\u5e03\u5c14\u7c7b\u578b\u9009\u9879\u7684\u56fe\u6807
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig.choices","title":"choices: Optional[List[Any]] = None
class-attribute
instance-attribute
","text":"\u9009\u9879\u5217\u8868
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig.columns","title":"columns: int = 1
class-attribute
instance-attribute
","text":"\u9009\u9879\u5217\u6570
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig.default_value","title":"default_value: Any = _FIRST_OPTION
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u9009\u9879\u3002_FIRST_OPTION
\u662f\u4e00\u4e2a\u7279\u6b8a\u503c\uff0c\u8868\u793a\u9009\u62e9\u9009\u9879\u5217\u8868\u4e2d\u7684\u7b2c\u4e00\u4e2a\u9009\u9879\u3002
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig.icon_size","title":"icon_size: Union[Tuple[int, int], int, QSize, None] = None
class-attribute
instance-attribute
","text":"\u9009\u9879\u56fe\u6807\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig.int_icon","title":"int_icon: IconType = 'mdi6.alpha-i-circle'
class-attribute
instance-attribute
","text":"\u6574\u6570\u7c7b\u578b\u9009\u9879\u7684\u56fe\u6807
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig.object_icon","title":"object_icon: str_icon = 'mdi6.alpha-o-box'
class-attribute
instance-attribute
","text":"\u5bf9\u8c61\u7c7b\u578b\u9009\u9879\u7684\u56fe\u6807
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig.show_type_icon","title":"show_type_icon: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u9009\u9879\u7c7b\u578b\u56fe\u6807
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBoxConfig.str_icon","title":"str_icon: str = 'mdi6.alpha-s-box'
class-attribute
instance-attribute
","text":"\u5b57\u7b26\u4e32\u7c7b\u578b\u9009\u9879\u7684\u56fe\u6807
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#pyguiadapter.widgets.ExclusiveChoiceBox","title":"ExclusiveChoiceBox
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.exclusivechoice/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" typing.Literal
"},{"location":"apis/pyguiadapter.widgets.fileselect/","title":"pyguiadapter.widgets.fileselect","text":""},{"location":"apis/pyguiadapter.widgets.fileselect/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig","title":"FileSelectConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
FileSelect\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\fileselect.py
@dataclasses.dataclass(frozen=True)\nclass FileSelectConfig(CommonParameterWidgetConfig):\n \"\"\"FileSelect\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Optional[str] = \"\"\n \"\"\"\u9ed8\u8ba4\u503c\"\"\"\n\n placeholder: str = \"\"\n \"\"\"\u5360\u4f4d\u7b26\u6587\u5b57\"\"\"\n\n dialog_title: str = \"\"\n \"\"\"\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n start_dir: str = \"\"\n \"\"\"\u6587\u4ef6\u5bf9\u8bdd\u6846\u8d77\u59cb\u8def\u5f84\"\"\"\n\n filters: str = \"\"\n \"\"\"\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668\"\"\"\n\n save_file: bool = False\n \"\"\"\u662f\u5426\u4e3a\u4fdd\u5b58\u6587\u4ef6\u5bf9\u8bdd\u6846\"\"\"\n\n select_button_text: str = \"...\"\n \"\"\"\u9009\u62e9\u6309\u94ae\u6587\u5b57\"\"\"\n\n clear_button: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae\"\"\"\n\n drag_n_drop: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u6587\u4ef6\u62d6\u653e\u529f\u80fd\"\"\"\n\n drag_n_drop_filter: Optional[Callable[[str, str], bool]] = default_dnd_filter\n \"\"\"\u6587\u4ef6\u62d6\u653e\u529f\u80fd\u7684\u8fc7\u6ee4\u51fd\u6570\u3002\u8be5\u51fd\u6570\u5e94\u63a5\u6536\u4e24\u4e2a\u53c2\u6570\uff1a\u6587\u4ef6\u8fc7\u6ee4\u5668\uff08\u5373\u672c\u7c7b\u7684`filters`\u5c5e\u6027\uff09\u548c\u62d6\u653e\u7684\u6587\u4ef6\u8def\u5f84\u3002\n \u82e5\u8fd4\u56deTrue\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u53ef\u4ee5\u88ab\u62d6\u653e\uff1b\u5426\u5219\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u4e0d\u80fd\u88ab\u62d6\u653e\u3002\u8be5\u5c5e\u6027\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u4e3aNone\uff0c\u8868\u793a\u4e0d\u5bf9\u62d6\u653e\u6587\u4ef6\u8fdb\u884c\u8fc7\u6ee4\u3002\n \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528`default_dnd_filter`\u51fd\u6570\u4f5c\u4e3a\u8fc7\u6ee4\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u4f1a\u5c06\u5f85\u62d6\u653e\u7684\u6587\u4ef6\u7684\u6587\u4ef6\u540d\u4e0e\u6587\u4ef6\u8fc7\u6ee4\u5668\u8fdb\u884c\u5339\u914d\uff0c\u82e5\u547d\u4e2d\u4efb\u610f\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u5219\u8fd4\u56deTrue\uff0c\n \u5426\u5219\u8fd4\u56deFalse\u3002\u6bd4\u5982\uff0c\u82e5\u6587\u4ef6\u8fc7\u6ee4\u5668\u4e3a'Text files (*.txt);;Python files (*.py)', \u5219\u6587\u4ef6'hello.txt'\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Text files (*.txt)';\n \u6587\u4ef6'hello.py'\u4e5f\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Python files (*.py)'\uff1b\u6587\u4ef6'hello.png'\u5219\u4e0d\u80fd\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u6ca1\u6709\u547d\u4e2d\u4efb\u4f55\u6587\u4ef6\u8fc7\u6ee4\u5668\u3002\"\"\"\n\n normalize_path: bool = False\n \"\"\"\u662f\u5426\u5c06\u8def\u5f84\u6807\u51c6\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u83b7\u53d6\u8def\u5f84\u65f6\uff0c\u5c06\u4f7f\u7528os.path.normpath()\u51fd\u6570\u8fdb\u884c\u6807\u51c6\u5316\"\"\"\n\n absolutize_path: bool = False\n \"\"\"\u662f\u5426\u5c06\u8def\u5f84\u7edd\u5bf9\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u83b7\u53d6\u8def\u5f84\u65f6\uff0c\u5c06\u4f7f\u7528os.path.abspath()\u51fd\u6570\u8fdb\u884c\u7edd\u5bf9\u5316\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"FileSelect\"]:\n return FileSelect\n
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.absolutize_path","title":"absolutize_path: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8def\u5f84\u7edd\u5bf9\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u83b7\u53d6\u8def\u5f84\u65f6\uff0c\u5c06\u4f7f\u7528os.path.abspath()\u51fd\u6570\u8fdb\u884c\u7edd\u5bf9\u5316
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.clear_button","title":"clear_button: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.default_value","title":"default_value: Optional[str] = ''
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.dialog_title","title":"dialog_title: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.drag_n_drop","title":"drag_n_drop: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u6587\u4ef6\u62d6\u653e\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.drag_n_drop_filter","title":"drag_n_drop_filter: Optional[Callable[[str, str], bool]] = default_dnd_filter
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u62d6\u653e\u529f\u80fd\u7684\u8fc7\u6ee4\u51fd\u6570\u3002\u8be5\u51fd\u6570\u5e94\u63a5\u6536\u4e24\u4e2a\u53c2\u6570\uff1a\u6587\u4ef6\u8fc7\u6ee4\u5668\uff08\u5373\u672c\u7c7b\u7684filters
\u5c5e\u6027\uff09\u548c\u62d6\u653e\u7684\u6587\u4ef6\u8def\u5f84\u3002 \u82e5\u8fd4\u56deTrue\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u53ef\u4ee5\u88ab\u62d6\u653e\uff1b\u5426\u5219\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u4e0d\u80fd\u88ab\u62d6\u653e\u3002\u8be5\u5c5e\u6027\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u4e3aNone\uff0c\u8868\u793a\u4e0d\u5bf9\u62d6\u653e\u6587\u4ef6\u8fdb\u884c\u8fc7\u6ee4\u3002 \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528default_dnd_filter
\u51fd\u6570\u4f5c\u4e3a\u8fc7\u6ee4\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u4f1a\u5c06\u5f85\u62d6\u653e\u7684\u6587\u4ef6\u7684\u6587\u4ef6\u540d\u4e0e\u6587\u4ef6\u8fc7\u6ee4\u5668\u8fdb\u884c\u5339\u914d\uff0c\u82e5\u547d\u4e2d\u4efb\u610f\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u5219\u8fd4\u56deTrue\uff0c \u5426\u5219\u8fd4\u56deFalse\u3002\u6bd4\u5982\uff0c\u82e5\u6587\u4ef6\u8fc7\u6ee4\u5668\u4e3a'Text files (.txt);;Python files (.py)', \u5219\u6587\u4ef6'hello.txt'\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Text files (.txt)'; \u6587\u4ef6'hello.py'\u4e5f\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Python files (.py)'\uff1b\u6587\u4ef6'hello.png'\u5219\u4e0d\u80fd\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u6ca1\u6709\u547d\u4e2d\u4efb\u4f55\u6587\u4ef6\u8fc7\u6ee4\u5668\u3002
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.filters","title":"filters: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.normalize_path","title":"normalize_path: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8def\u5f84\u6807\u51c6\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u83b7\u53d6\u8def\u5f84\u65f6\uff0c\u5c06\u4f7f\u7528os.path.normpath()\u51fd\u6570\u8fdb\u884c\u6807\u51c6\u5316
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.placeholder","title":"placeholder: str = ''
class-attribute
instance-attribute
","text":"\u5360\u4f4d\u7b26\u6587\u5b57
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.save_file","title":"save_file: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u4e3a\u4fdd\u5b58\u6587\u4ef6\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.select_button_text","title":"select_button_text: str = '...'
class-attribute
instance-attribute
","text":"\u9009\u62e9\u6309\u94ae\u6587\u5b57
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelectConfig.start_dir","title":"start_dir: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5bf9\u8bdd\u6846\u8d77\u59cb\u8def\u5f84
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig","title":"MultiFileSelectConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
MultiFileSelect\u7684\u914d\u7f6e\u7c7b\u3002
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.absolutize_path","title":"absolutize_path: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8def\u5f84\u7edd\u5bf9\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u8bbe\u7f6e\u63a7\u4ef6\u503c\u6216\u8005\u4ece\u63a7\u4ef6\u83b7\u53d6\u503c\u65f6\uff0c\u5c06\u4f7f\u7528os.path.abspath()\u51fd\u6570\u8fdb\u884c\u7edd\u5bf9\u5316
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.clear_button","title":"clear_button: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.default_value","title":"default_value: Union[Sequence[str], str, type(None)] = ()
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.dialog_title","title":"dialog_title: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.drag_n_drop","title":"drag_n_drop: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u6587\u4ef6\u62d6\u653e\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.drag_n_drop_filter","title":"drag_n_drop_filter: Optional[Callable[[str, str], bool]] = default_dnd_filter
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u62d6\u653e\u529f\u80fd\u7684\u8fc7\u6ee4\u51fd\u6570\u3002\u8be5\u51fd\u6570\u5e94\u63a5\u6536\u4e24\u4e2a\u53c2\u6570\uff1a\u6587\u4ef6\u8fc7\u6ee4\u5668\uff08\u5373\u672c\u7c7b\u7684filters
\u5c5e\u6027\uff09\u548c\u62d6\u653e\u7684\u6587\u4ef6\u8def\u5f84\u3002 \u82e5\u8fd4\u56deTrue\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u53ef\u4ee5\u88ab\u62d6\u653e\uff1b\u5426\u5219\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u4e0d\u80fd\u88ab\u62d6\u653e\u3002\u8be5\u5c5e\u6027\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u4e3aNone\uff0c\u8868\u793a\u4e0d\u5bf9\u62d6\u653e\u6587\u4ef6\u8fdb\u884c\u8fc7\u6ee4\u3002 \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528default_dnd_filter
\u51fd\u6570\u4f5c\u4e3a\u8fc7\u6ee4\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u4f1a\u5c06\u5f85\u62d6\u653e\u7684\u6587\u4ef6\u7684\u6587\u4ef6\u540d\u4e0e\u6587\u4ef6\u8fc7\u6ee4\u5668\u8fdb\u884c\u5339\u914d\uff0c\u82e5\u547d\u4e2d\u4efb\u610f\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u5219\u8fd4\u56deTrue\uff0c \u5426\u5219\u8fd4\u56deFalse\u3002\u6bd4\u5982\uff0c\u82e5\u6587\u4ef6\u8fc7\u6ee4\u5668\u4e3a'Text files (.txt);;Python files (.py)', \u5219\u6587\u4ef6'hello.txt'\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Text files (.txt)'; \u6587\u4ef6'hello.py'\u4e5f\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Python files (.py)'\uff1b\u6587\u4ef6'hello.png'\u5219\u4e0d\u80fd\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u6ca1\u6709\u547d\u4e2d\u4efb\u4f55\u6587\u4ef6\u8fc7\u6ee4\u5668\u3002
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.file_separator","title":"file_separator: str = ';;'
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5206\u9694\u7b26
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.filters","title":"filters: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.normalize_path","title":"normalize_path: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8def\u5f84\u6807\u51c6\u5316\u3002\u82e5\u8bbe\u7f6e\u4e3aTrue\uff0c\u5219\u5728\u8bbe\u7f6e\u63a7\u4ef6\u503c\u6216\u8005\u4ece\u63a7\u4ef6\u83b7\u53d6\u503c\u65f6\uff0c\u4f7f\u7528os.path.normpath()\u51fd\u6570\u8fdb\u884c\u6807\u51c6\u5316
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.placeholder","title":"placeholder: str = ''
class-attribute
instance-attribute
","text":"\u5360\u4f4d\u7b26\u6587\u5b57
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.select_button_text","title":"select_button_text: str = '...'
class-attribute
instance-attribute
","text":"\u9009\u62e9\u6309\u94ae\u6587\u5b57
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelectConfig.start_dir","title":"start_dir: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5bf9\u8bdd\u6846\u8d77\u59cb\u8def\u5f84
"},{"location":"apis/pyguiadapter.widgets.fileselect/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.FileSelect","title":"FileSelect
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.fileselect/#pyguiadapter.widgets.MultiFileSelect","title":"MultiFileSelect
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.fileselect/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" file_t
files_t
"},{"location":"apis/pyguiadapter.widgets.floatedit/","title":"pyguiadapter.widgets.floatedit","text":""},{"location":"apis/pyguiadapter.widgets.floatedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEditConfig","title":"FloatLineEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
FloatLineEdit\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\floatedit.py
@dataclasses.dataclass(frozen=True)\nclass FloatLineEditConfig(CommonParameterWidgetConfig):\n \"\"\"FloatLineEdit\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Optional[float] = 0.0\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n min_value: float = -2147483648.0\n \"\"\"\u6700\u5c0f\u503c\"\"\"\n\n max_value: float = 2147483647.0\n \"\"\"\u6700\u5927\u503c\"\"\"\n\n decimals: int = 2\n \"\"\"\u5c0f\u6570\u70b9\u540e\u4f4d\u6570\"\"\"\n\n scientific_notation: bool = False\n \"\"\"\u662f\u5426\u4f7f\u7528\u79d1\u5b66\u8ba1\u6570\u6cd5\"\"\"\n\n placeholder: str = \"\"\n \"\"\"\u5360\u4f4d\u7b26\u6587\u672c\"\"\"\n\n clear_button: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae\"\"\"\n\n empty_value: Optional[float] = 0.0\n \"\"\"\u8f93\u5165\u6846\u4e3a\u7a7a\u65f6\u7684\u9ed8\u8ba4\u503c\uff0c\u82e5\u8bbe\u7f6e\u4e3aNone\u5219\u8868\u793a\u4e0d\u5141\u8bb8\u8f93\u5165\u7a7a\u503c\uff0c\u7528\u6237\u8f93\u5165\u7a7a\u503c\uff0c\u83b7\u53d6\u548c\u8bbe\u7f6e\u503c\u65f6\u4f1a\u629b\u51faParameterError\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"FloatLineEdit\"]:\n return FloatLineEdit\n
"},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEditConfig.clear_button","title":"clear_button: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae
"},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEditConfig.decimals","title":"decimals: int = 2
class-attribute
instance-attribute
","text":"\u5c0f\u6570\u70b9\u540e\u4f4d\u6570
"},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEditConfig.default_value","title":"default_value: Optional[float] = 0.0
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEditConfig.empty_value","title":"empty_value: Optional[float] = 0.0
class-attribute
instance-attribute
","text":"\u8f93\u5165\u6846\u4e3a\u7a7a\u65f6\u7684\u9ed8\u8ba4\u503c\uff0c\u82e5\u8bbe\u7f6e\u4e3aNone\u5219\u8868\u793a\u4e0d\u5141\u8bb8\u8f93\u5165\u7a7a\u503c\uff0c\u7528\u6237\u8f93\u5165\u7a7a\u503c\uff0c\u83b7\u53d6\u548c\u8bbe\u7f6e\u503c\u65f6\u4f1a\u629b\u51faParameterError
"},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEditConfig.max_value","title":"max_value: float = 2147483647.0
class-attribute
instance-attribute
","text":"\u6700\u5927\u503c
"},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEditConfig.min_value","title":"min_value: float = -2147483648.0
class-attribute
instance-attribute
","text":"\u6700\u5c0f\u503c
"},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEditConfig.placeholder","title":"placeholder: str = ''
class-attribute
instance-attribute
","text":"\u5360\u4f4d\u7b26\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEditConfig.scientific_notation","title":"scientific_notation: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7f\u7528\u79d1\u5b66\u8ba1\u6570\u6cd5
"},{"location":"apis/pyguiadapter.widgets.floatedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.floatedit/#pyguiadapter.widgets.FloatLineEdit","title":"FloatLineEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.floatedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" float_t
"},{"location":"apis/pyguiadapter.widgets.floatspin/","title":"pyguiadapter.widgets.floatspin","text":""},{"location":"apis/pyguiadapter.widgets.floatspin/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.floatspin/#pyguiadapter.widgets.FloatSpinBoxConfig","title":"FloatSpinBoxConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
Source code in pyguiadapter\\widgets\\basic\\floatspin.py
@dataclasses.dataclass(frozen=True)\nclass FloatSpinBoxConfig(CommonParameterWidgetConfig):\n default_value: Optional[float] = 0.0\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n min_value: float = -2147483648.0\n \"\"\"\u6700\u5c0f\u503c\"\"\"\n\n max_value: float = 2147483647.0\n \"\"\"\u6700\u5927\u503c\"\"\"\n\n step: Optional[float] = 1.0\n \"\"\"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f\"\"\"\n\n decimals: Optional[int] = 2\n \"\"\"\u5c0f\u6570\u70b9\u540e\u663e\u793a\u7684\u4f4d\u6570\"\"\"\n\n prefix: str = \"\"\n \"\"\"\u524d\u7f00\"\"\"\n\n suffix: str = \"\"\n \"\"\"\u540e\u7f00\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"FloatSpinBox\"]:\n return FloatSpinBox\n
"},{"location":"apis/pyguiadapter.widgets.floatspin/#pyguiadapter.widgets.FloatSpinBoxConfig.decimals","title":"decimals: Optional[int] = 2
class-attribute
instance-attribute
","text":"\u5c0f\u6570\u70b9\u540e\u663e\u793a\u7684\u4f4d\u6570
"},{"location":"apis/pyguiadapter.widgets.floatspin/#pyguiadapter.widgets.FloatSpinBoxConfig.default_value","title":"default_value: Optional[float] = 0.0
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.floatspin/#pyguiadapter.widgets.FloatSpinBoxConfig.max_value","title":"max_value: float = 2147483647.0
class-attribute
instance-attribute
","text":"\u6700\u5927\u503c
"},{"location":"apis/pyguiadapter.widgets.floatspin/#pyguiadapter.widgets.FloatSpinBoxConfig.min_value","title":"min_value: float = -2147483648.0
class-attribute
instance-attribute
","text":"\u6700\u5c0f\u503c
"},{"location":"apis/pyguiadapter.widgets.floatspin/#pyguiadapter.widgets.FloatSpinBoxConfig.prefix","title":"prefix: str = ''
class-attribute
instance-attribute
","text":"\u524d\u7f00
"},{"location":"apis/pyguiadapter.widgets.floatspin/#pyguiadapter.widgets.FloatSpinBoxConfig.step","title":"step: Optional[float] = 1.0
class-attribute
instance-attribute
","text":"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f
"},{"location":"apis/pyguiadapter.widgets.floatspin/#pyguiadapter.widgets.FloatSpinBoxConfig.suffix","title":"suffix: str = ''
class-attribute
instance-attribute
","text":"\u540e\u7f00
"},{"location":"apis/pyguiadapter.widgets.floatspin/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.floatspin/#pyguiadapter.widgets.FloatSpinBox","title":"FloatSpinBox
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.floatspin/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" float
"},{"location":"apis/pyguiadapter.widgets.fontselect/","title":"pyguiadapter.widgets.fontselect","text":""},{"location":"apis/pyguiadapter.widgets.fontselect/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelectConfig","title":"FontSelectConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
FontSelect\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\extend\\fontselect.py
@dataclasses.dataclass(frozen=True)\nclass FontSelectConfig(CommonParameterWidgetConfig):\n \"\"\"FontSelect\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Union[str, Type[_DefaultFont], Type[_FirstFont], None] = _DefaultFont\n \"\"\"\u9ed8\u8ba4\u503c\uff0c\u53ef\u4ee5\u4e3a\u5b57\u4f53\u540d\u79f0\uff08\u5b57\u7b26\u4e32\uff09\uff0c\u6216\u8005\u4ee5\u4e0b\u7279\u6b8a\u503c\uff1a`_DefaultFont`(\u9ed8\u8ba4\u5b57\u4f53)\uff0c`_FirstFont`(\u7b2c\u4e00\u4e2a\u53ef\u7528\u5b57\u4f53)\"\"\"\n\n font_filters: Union[FontFilter, int, None] = None\n \"\"\"\u5b57\u4f53\u8fc7\u6ee4\u5668\uff0c\u53ef\u4ee5\u4e3a\u5355\u4e2a`FontFilter`\u679a\u4e3e\u503c\uff0c\u591a\u79cd\u591a\u4e2a\u679a\u4e3e\u503c\u7684\u8054\u5408\uff0c\u6bd4\u5982\uff1a`FontFilter.ScalableFonts | FontFilter.ProportionalFonts`\"\"\"\n\n writing_system: Optional[WritingSystem] = None\n \"\"\"\u4e66\u5199\u7cfb\u7edf\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"FontSelect\"]:\n return FontSelect\n
"},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelectConfig.default_value","title":"default_value: Union[str, Type[_DefaultFont], Type[_FirstFont], None] = _DefaultFont
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c\uff0c\u53ef\u4ee5\u4e3a\u5b57\u4f53\u540d\u79f0\uff08\u5b57\u7b26\u4e32\uff09\uff0c\u6216\u8005\u4ee5\u4e0b\u7279\u6b8a\u503c\uff1a_DefaultFont
(\u9ed8\u8ba4\u5b57\u4f53)\uff0c_FirstFont
(\u7b2c\u4e00\u4e2a\u53ef\u7528\u5b57\u4f53)
"},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelectConfig.font_filters","title":"font_filters: Union[FontFilter, int, None] = None
class-attribute
instance-attribute
","text":"\u5b57\u4f53\u8fc7\u6ee4\u5668\uff0c\u53ef\u4ee5\u4e3a\u5355\u4e2aFontFilter
\u679a\u4e3e\u503c\uff0c\u591a\u79cd\u591a\u4e2a\u679a\u4e3e\u503c\u7684\u8054\u5408\uff0c\u6bd4\u5982\uff1aFontFilter.ScalableFonts | FontFilter.ProportionalFonts
"},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelectConfig.writing_system","title":"writing_system: Optional[WritingSystem] = None
class-attribute
instance-attribute
","text":"\u4e66\u5199\u7cfb\u7edf
"},{"location":"apis/pyguiadapter.widgets.fontselect/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelect","title":"FontSelect
","text":" Bases: CommonParameterWidget
\u5b57\u4f53\u9009\u62e9\u63a7\u4ef6
"},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelect.AllFonts","title":"AllFonts = FontFilter.AllFonts
class-attribute
instance-attribute
","text":"\u5b57\u4f53\u8fc7\u6ee4\u5668\uff1a\u6240\u6709\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelect.MonospacedFonts","title":"MonospacedFonts = FontFilter.MonospacedFonts
class-attribute
instance-attribute
","text":"\u5b57\u4f53\u8fc7\u6ee4\u5668\uff1a\u7b49\u5bbd\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelect.NonScalableFonts","title":"NonScalableFonts = FontFilter.NonScalableFonts
class-attribute
instance-attribute
","text":"\u5b57\u4f53\u8fc7\u6ee4\u5668\uff1a\u4e0d\u53ef\u7f29\u653e\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelect.ProportionalFonts","title":"ProportionalFonts = FontFilter.ProportionalFonts
class-attribute
instance-attribute
","text":"\u5b57\u4f53\u8fc7\u6ee4\u5668\uff1a\u6bd4\u4f8b\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelect.ScalableFonts","title":"ScalableFonts = FontFilter.ScalableFonts
class-attribute
instance-attribute
","text":"\u5b57\u4f53\u8fc7\u6ee4\u5668\uff1a\u53ef\u7f29\u653e\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.fontselect/#pyguiadapter.widgets.FontSelect.WritingSystem","title":"WritingSystem = QFontDatabase.WritingSystem
class-attribute
instance-attribute
","text":"\u4e66\u5199\u7cfb\u7edf
"},{"location":"apis/pyguiadapter.widgets.fontselect/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" font_t
"},{"location":"apis/pyguiadapter.widgets.intedit/","title":"pyguiadapter.widgets.intedit","text":""},{"location":"apis/pyguiadapter.widgets.intedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.intedit/#pyguiadapter.widgets.IntLineEditConfig","title":"IntLineEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
IntLineEdit\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\extend\\intedit.py
@dataclasses.dataclass(frozen=True)\nclass IntLineEditConfig(CommonParameterWidgetConfig):\n \"\"\"IntLineEdit\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[int] = 0\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n placeholder: str = \"\"\n \"\"\"\u8f93\u5165\u6846\u7684\u5360\u4f4d\u7b26\u6587\u672c\"\"\"\n\n clear_button: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae\"\"\"\n\n min_value: int = -2147483648\n \"\"\"\u6700\u5c0f\u503c\"\"\"\n\n max_value: int = 2147483647\n \"\"\"\u6700\u5927\u503c\"\"\"\n\n empty_value: Optional[int] = 0\n \"\"\"\u8f93\u5165\u6846\u4e3a\u7a7a\u65f6\u7684\u9ed8\u8ba4\u503c\uff0c\u82e5\u8bbe\u7f6e\u4e3aNone\u5219\u8868\u793a\u4e0d\u5141\u8bb8\u8f93\u5165\u7a7a\u503c\uff0c\u7528\u6237\u8f93\u5165\u7a7a\u503c\uff0c\u83b7\u53d6\u548c\u8bbe\u7f6e\u503c\u65f6\u4f1a\u629b\u51faParameterError\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"IntLineEdit\"]:\n return IntLineEdit\n
"},{"location":"apis/pyguiadapter.widgets.intedit/#pyguiadapter.widgets.IntLineEditConfig.clear_button","title":"clear_button: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae
"},{"location":"apis/pyguiadapter.widgets.intedit/#pyguiadapter.widgets.IntLineEditConfig.default_value","title":"default_value: Optional[int] = 0
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.intedit/#pyguiadapter.widgets.IntLineEditConfig.empty_value","title":"empty_value: Optional[int] = 0
class-attribute
instance-attribute
","text":"\u8f93\u5165\u6846\u4e3a\u7a7a\u65f6\u7684\u9ed8\u8ba4\u503c\uff0c\u82e5\u8bbe\u7f6e\u4e3aNone\u5219\u8868\u793a\u4e0d\u5141\u8bb8\u8f93\u5165\u7a7a\u503c\uff0c\u7528\u6237\u8f93\u5165\u7a7a\u503c\uff0c\u83b7\u53d6\u548c\u8bbe\u7f6e\u503c\u65f6\u4f1a\u629b\u51faParameterError
"},{"location":"apis/pyguiadapter.widgets.intedit/#pyguiadapter.widgets.IntLineEditConfig.max_value","title":"max_value: int = 2147483647
class-attribute
instance-attribute
","text":"\u6700\u5927\u503c
"},{"location":"apis/pyguiadapter.widgets.intedit/#pyguiadapter.widgets.IntLineEditConfig.min_value","title":"min_value: int = -2147483648
class-attribute
instance-attribute
","text":"\u6700\u5c0f\u503c
"},{"location":"apis/pyguiadapter.widgets.intedit/#pyguiadapter.widgets.IntLineEditConfig.placeholder","title":"placeholder: str = ''
class-attribute
instance-attribute
","text":"\u8f93\u5165\u6846\u7684\u5360\u4f4d\u7b26\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.intedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.intedit/#pyguiadapter.widgets.IntLineEdit","title":"IntLineEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.intedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" int_t
"},{"location":"apis/pyguiadapter.widgets.intspin/","title":"pyguiadapter.widgets.intspin","text":""},{"location":"apis/pyguiadapter.widgets.intspin/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.intspin/#pyguiadapter.widgets.IntSpinBoxConfig","title":"IntSpinBoxConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
IntSpinBox\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\intspin.py
@dataclasses.dataclass(frozen=True)\nclass IntSpinBoxConfig(CommonParameterWidgetConfig):\n \"\"\"IntSpinBox\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[int] = 0\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n min_value: int = -2147483648\n \"\"\"\u6700\u5c0f\u503c\"\"\"\n\n max_value: int = 2147483647\n \"\"\"\u6700\u5927\u503c\"\"\"\n\n step: int = 1\n \"\"\"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f\"\"\"\n\n prefix: str = \"\"\n \"\"\"\u524d\u7f00\"\"\"\n\n suffix: str = \"\"\n \"\"\"\u540e\u7f00\"\"\"\n\n display_integer_base: int = 10\n \"\"\"\u6574\u6570\u663e\u793a\u8fdb\u5236\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"IntSpinBox\"]:\n return IntSpinBox\n
"},{"location":"apis/pyguiadapter.widgets.intspin/#pyguiadapter.widgets.IntSpinBoxConfig.default_value","title":"default_value: Optional[int] = 0
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.intspin/#pyguiadapter.widgets.IntSpinBoxConfig.display_integer_base","title":"display_integer_base: int = 10
class-attribute
instance-attribute
","text":"\u6574\u6570\u663e\u793a\u8fdb\u5236
"},{"location":"apis/pyguiadapter.widgets.intspin/#pyguiadapter.widgets.IntSpinBoxConfig.max_value","title":"max_value: int = 2147483647
class-attribute
instance-attribute
","text":"\u6700\u5927\u503c
"},{"location":"apis/pyguiadapter.widgets.intspin/#pyguiadapter.widgets.IntSpinBoxConfig.min_value","title":"min_value: int = -2147483648
class-attribute
instance-attribute
","text":"\u6700\u5c0f\u503c
"},{"location":"apis/pyguiadapter.widgets.intspin/#pyguiadapter.widgets.IntSpinBoxConfig.prefix","title":"prefix: str = ''
class-attribute
instance-attribute
","text":"\u524d\u7f00
"},{"location":"apis/pyguiadapter.widgets.intspin/#pyguiadapter.widgets.IntSpinBoxConfig.step","title":"step: int = 1
class-attribute
instance-attribute
","text":"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f
"},{"location":"apis/pyguiadapter.widgets.intspin/#pyguiadapter.widgets.IntSpinBoxConfig.suffix","title":"suffix: str = ''
class-attribute
instance-attribute
","text":"\u540e\u7f00
"},{"location":"apis/pyguiadapter.widgets.intspin/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.intspin/#pyguiadapter.widgets.IntSpinBox","title":"IntSpinBox
","text":" Bases: CommonParameterWidget
\u6574\u6570\u8f93\u5165\u6846\u63a7\u4ef6\uff0cSpinBox\u5f62\u5f0f\u3002\u662fint
\u7c7b\u578b\u53c2\u6570\u7684\u9ed8\u8ba4\u63a7\u4ef6\u3002
"},{"location":"apis/pyguiadapter.widgets.intspin/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" int
"},{"location":"apis/pyguiadapter.widgets.jsonedit/","title":"pyguiadapter.widgets.jsonedit","text":""},{"location":"apis/pyguiadapter.widgets.jsonedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.jsonedit/#pyguiadapter.widgets.JsonEditConfig","title":"JsonEditConfig
dataclass
","text":" Bases: BaseCodeEditConfig
JsonEdit\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\jsonedit.py
@dataclasses.dataclass(frozen=True)\nclass JsonEditConfig(BaseCodeEditConfig):\n \"\"\"JsonEdit\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Optional[Any] = dataclasses.field(default_factory=dict)\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n height: Optional[int] = 230\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6\"\"\"\n\n width: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6\"\"\"\n\n standalone_editor: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668\"\"\"\n\n standalone_editor_button_text: str = \"Edit Json\"\n \"\"\"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c\"\"\"\n\n standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(\n default_factory=StandaloneCodeEditorConfig\n )\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\"\"\"\n\n indent_size: int = 2\n \"\"\"json\u683c\u5f0f\u5316\u7f29\u8fdb\u5927\u5c0f\"\"\"\n\n initial_text: str = \"{}\"\n\n highlighter: Type[QJSONHighlighter] = QJSONHighlighter\n formatter: JsonFormatter = dataclasses.field(default_factory=JsonFormatter)\n\n @classmethod\n def target_widget_class(cls) -> Type[\"JsonEdit\"]:\n return JsonEdit\n
"},{"location":"apis/pyguiadapter.widgets.jsonedit/#pyguiadapter.widgets.JsonEditConfig.default_value","title":"default_value: Optional[Any] = dataclasses.field(default_factory=dict)
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.jsonedit/#pyguiadapter.widgets.JsonEditConfig.height","title":"height: Optional[int] = 230
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.jsonedit/#pyguiadapter.widgets.JsonEditConfig.indent_size","title":"indent_size: int = 2
class-attribute
instance-attribute
","text":"json\u683c\u5f0f\u5316\u7f29\u8fdb\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.jsonedit/#pyguiadapter.widgets.JsonEditConfig.standalone_editor","title":"standalone_editor: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668
"},{"location":"apis/pyguiadapter.widgets.jsonedit/#pyguiadapter.widgets.JsonEditConfig.standalone_editor_button_text","title":"standalone_editor_button_text: str = 'Edit Json'
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.jsonedit/#pyguiadapter.widgets.JsonEditConfig.standalone_editor_config","title":"standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(default_factory=StandaloneCodeEditorConfig)
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u914d\u7f6e
"},{"location":"apis/pyguiadapter.widgets.jsonedit/#pyguiadapter.widgets.JsonEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.jsonedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.jsonedit/#pyguiadapter.widgets.JsonEdit","title":"JsonEdit
","text":" Bases: BaseCodeEdit
"},{"location":"apis/pyguiadapter.widgets.jsonedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" json_obj_t
"},{"location":"apis/pyguiadapter.widgets.keysequenceedit/","title":"pyguiadapter.widgets.keysequenceedit","text":""},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#pyguiadapter.widgets.KeySequenceEditConfig","title":"KeySequenceEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
KeySequenceEdit\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\keysequenceedit.py
@dataclasses.dataclass(frozen=True)\nclass KeySequenceEditConfig(CommonParameterWidgetConfig):\n \"\"\"KeySequenceEdit\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Union[str, QKeySequence, None] = \"\"\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n key_sequence_format: KeySequenceFormat = QKeySequence.PortableText\n \"\"\"\u6309\u952e\u5e8f\u5217\u683c\u5f0f\"\"\"\n\n return_type: Literal[\"str\", \"list\"] = \"str\"\n \"\"\"\u8fd4\u56de\u503c\u7c7b\u578b\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"KeySequenceEdit\"]:\n return KeySequenceEdit\n
"},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#pyguiadapter.widgets.KeySequenceEditConfig.default_value","title":"default_value: Union[str, QKeySequence, None] = ''
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#pyguiadapter.widgets.KeySequenceEditConfig.key_sequence_format","title":"key_sequence_format: KeySequenceFormat = QKeySequence.PortableText
class-attribute
instance-attribute
","text":"\u6309\u952e\u5e8f\u5217\u683c\u5f0f
"},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#pyguiadapter.widgets.KeySequenceEditConfig.return_type","title":"return_type: Literal['str', 'list'] = 'str'
class-attribute
instance-attribute
","text":"\u8fd4\u56de\u503c\u7c7b\u578b
"},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#pyguiadapter.widgets.KeySequenceEdit","title":"KeySequenceEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#pyguiadapter.widgets.KeySequenceEdit.NativeText","title":"NativeText = QKeySequence.NativeText
class-attribute
instance-attribute
","text":"\u6309\u952e\u5e8f\u5217\u683c\u5f0f\uff1aNativeText
"},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#pyguiadapter.widgets.KeySequenceEdit.PortableText","title":"PortableText = QKeySequence.PortableText
class-attribute
instance-attribute
","text":"\u6309\u952e\u5e8f\u5217\u683c\u5f0f\uff1aPortableText
"},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#pyguiadapter.widgets.KeySequenceEdit.split_key_sequences","title":"split_key_sequences(key_sequences: str) -> list
staticmethod
","text":"\u5c06\u4e00\u7ec4\u6309\u952e\u5e8f\u5217\u5b57\u7b26\u4e32\u5206\u5272\u6210\u5355\u4e2a\u6309\u952e\u5e8f\u5217\u7ec4\u6210\u7684\u5217\u8868\u3002
\u6bd4\u5982\uff1a
\"Ctrl+Alt+A, Ctrl+B, Ctrl+C\" -> [\"Ctrl+Alt+A\", \"Ctrl+B\", \"Ctrl+C\"]
\u53c8\u6bd4\u5982\uff1a
\"Ctrl+A, Ctrl+B, ,, Ctrl+,, B, C\" -> [\"Ctrl+A\", \"Ctrl+B\", \"Ctrl+,\", \",\", \"B\", \"C\"]
Parameters:
Name Type Description Default key_sequences
str
\u6309\u952e\u5e8f\u5217\u5b57\u7b26\u4e32
required Returns:
Type Description list
\u6309\u952e\u5e8f\u5217\u7ec4\u6210\u7684\u5217\u8868
"},{"location":"apis/pyguiadapter.widgets.keysequenceedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" key_sequence_t
"},{"location":"apis/pyguiadapter.widgets.lineedit/","title":"pyguiadapter.widgets.lineedit","text":""},{"location":"apis/pyguiadapter.widgets.lineedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig","title":"LineEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
LineEdit\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\lineedit.py
@dataclasses.dataclass(frozen=True)\nclass LineEditConfig(CommonParameterWidgetConfig):\n \"\"\"LineEdit\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[str] = \"\"\n \"\"\"\u9ed8\u8ba4\u503c\"\"\"\n\n placeholder: str = \"\"\n \"\"\"\u5360\u4f4d\u6587\u672c\uff0c\u8f93\u5165\u6846\u4e3a\u7a7a\u65f6\u5c06\u663e\u793a\u8be5\u6587\u672c\"\"\"\n\n clear_button: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae\"\"\"\n\n echo_mode: Optional[EchoMode] = None\n \"\"\"\u56de\u663e\u6a21\u5f0f\uff0c\u9ed8\u8ba4\u4e3aNormal\"\"\"\n\n alignment: Optional[Alignment] = None\n \"\"\"\u8f93\u5165\u6587\u672c\u7684\u5bf9\u9f50\u65b9\u5f0f\uff0c\u9ed8\u8ba4\u4e3aAlignLeft\"\"\"\n\n input_mask: Optional[str] = None\n \"\"\"\u8f93\u5165\u63a9\u7801\uff0c\u7528\u4e8e\u9650\u5236\u7528\u6237\u8f93\u5165\uff0c\u53ef\u4ee5\u53c2\u8003\uff1ahttps://doc.qt.io/qt-5/qlineedit.html#inputMask-prop\"\"\"\n\n max_length: Optional[int] = None\n \"\"\"\u6700\u5927\u957f\u5ea6\"\"\"\n\n validator: Union[QValidator, str, None] = None\n \"\"\"\u8f93\u5165\u9a8c\u8bc1\u5668\uff0c\u53ef\u4ee5\u662fQValidator\u5bf9\u8c61\uff0c\u4e5f\u53ef\u4ee5\u662f\u6b63\u5219\u8868\u8fbe\u5f0f\u5b57\u7b26\u4e32\uff0c\u9ed8\u8ba4\u65e0\u9a8c\u8bc1\u5668\"\"\"\n\n drag_enabled: bool = True\n \"\"\"\u662f\u5426\u5141\u8bb8\u62d6\u62fd\"\"\"\n\n frame: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u8fb9\u6846\"\"\"\n\n readonly: bool = False\n \"\"\"\u662f\u5426\u53ea\u8bfb\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"LineEdit\"]:\n return LineEdit\n
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.alignment","title":"alignment: Optional[Alignment] = None
class-attribute
instance-attribute
","text":"\u8f93\u5165\u6587\u672c\u7684\u5bf9\u9f50\u65b9\u5f0f\uff0c\u9ed8\u8ba4\u4e3aAlignLeft
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.clear_button","title":"clear_button: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.default_value","title":"default_value: Optional[str] = ''
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.drag_enabled","title":"drag_enabled: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5141\u8bb8\u62d6\u62fd
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.echo_mode","title":"echo_mode: Optional[EchoMode] = None
class-attribute
instance-attribute
","text":"\u56de\u663e\u6a21\u5f0f\uff0c\u9ed8\u8ba4\u4e3aNormal
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.frame","title":"frame: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u8fb9\u6846
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.input_mask","title":"input_mask: Optional[str] = None
class-attribute
instance-attribute
","text":"\u8f93\u5165\u63a9\u7801\uff0c\u7528\u4e8e\u9650\u5236\u7528\u6237\u8f93\u5165\uff0c\u53ef\u4ee5\u53c2\u8003\uff1ahttps://doc.qt.io/qt-5/qlineedit.html#inputMask-prop
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.max_length","title":"max_length: Optional[int] = None
class-attribute
instance-attribute
","text":"\u6700\u5927\u957f\u5ea6
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.placeholder","title":"placeholder: str = ''
class-attribute
instance-attribute
","text":"\u5360\u4f4d\u6587\u672c\uff0c\u8f93\u5165\u6846\u4e3a\u7a7a\u65f6\u5c06\u663e\u793a\u8be5\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.readonly","title":"readonly: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u53ea\u8bfb
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEditConfig.validator","title":"validator: Union[QValidator, str, None] = None
class-attribute
instance-attribute
","text":"\u8f93\u5165\u9a8c\u8bc1\u5668\uff0c\u53ef\u4ee5\u662fQValidator\u5bf9\u8c61\uff0c\u4e5f\u53ef\u4ee5\u662f\u6b63\u5219\u8868\u8fbe\u5f0f\u5b57\u7b26\u4e32\uff0c\u9ed8\u8ba4\u65e0\u9a8c\u8bc1\u5668
"},{"location":"apis/pyguiadapter.widgets.lineedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEdit","title":"LineEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEdit.AlignCenter","title":"AlignCenter = Alignment.AlignCenter
class-attribute
instance-attribute
","text":"\u6587\u672c\u5bf9\u9f50\u65b9\u5f0f\uff1a\u5c45\u4e2d\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEdit.AlignLeft","title":"AlignLeft = Alignment.AlignRight
class-attribute
instance-attribute
","text":"\u6587\u672c\u5bf9\u9f50\u65b9\u5f0f\uff1a\u5de6\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEdit.AlignRight","title":"AlignRight = Alignment.AlignRight
class-attribute
instance-attribute
","text":"\u6587\u672c\u5bf9\u9f50\u65b9\u5f0f\uff1a\u53f3\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEdit.NoEchoMode","title":"NoEchoMode = EchoMode.NoEcho
class-attribute
instance-attribute
","text":"\u56de\u663e\u6a21\u5f0f\uff1a\u9690\u85cf\u8f93\u5165\u5185\u5bb9
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEdit.NormalEchoMode","title":"NormalEchoMode = EchoMode.Normal
class-attribute
instance-attribute
","text":"\u56de\u663e\u6a21\u5f0f\uff1a\u6b63\u5e38\u663e\u793a
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEdit.PasswordEchoMode","title":"PasswordEchoMode = EchoMode.Password
class-attribute
instance-attribute
","text":"\u56de\u663e\u6a21\u5f0f\uff1a\u663e\u793a\u4e3a\u5bc6\u7801
"},{"location":"apis/pyguiadapter.widgets.lineedit/#pyguiadapter.widgets.LineEdit.PasswordEchoOnEditMode","title":"PasswordEchoOnEditMode = EchoMode.PasswordEchoOnEdit
class-attribute
instance-attribute
","text":"\u56de\u663e\u6a21\u5f0f\uff1a\u8f93\u5165\u65f6\u6b63\u5e38\u663e\u793a\uff0c\u8f93\u5165\u7ed3\u675f\u540e\u663e\u793a\u4e3a\u5bc6\u7801
"},{"location":"apis/pyguiadapter.widgets.lineedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" str
"},{"location":"apis/pyguiadapter.widgets.listedit/","title":"pyguiadapter.widgets.listedit","text":""},{"location":"apis/pyguiadapter.widgets.listedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.ListEditConfig","title":"ListEditConfig
dataclass
","text":" Bases: PyLiteralEditConfig
ListEdit\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\listedit.py
@dataclasses.dataclass(frozen=True)\nclass ListEditConfig(PyLiteralEditConfig):\n \"\"\"ListEdit\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[list] = dataclasses.field(default_factory=list)\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n height: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6\"\"\"\n\n width: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6\"\"\"\n\n standalone_editor: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668\"\"\"\n\n standalone_editor_button_text: str = \"Edit List\"\n \"\"\"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c\"\"\"\n\n standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(\n default_factory=StandaloneCodeEditorConfig\n )\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\"\"\"\n\n initial_text: str = \"[]\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"ListEdit\"]:\n return ListEdit\n
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.ListEditConfig.default_value","title":"default_value: Optional[list] = dataclasses.field(default_factory=list)
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.ListEditConfig.height","title":"height: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.ListEditConfig.standalone_editor","title":"standalone_editor: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.ListEditConfig.standalone_editor_button_text","title":"standalone_editor_button_text: str = 'Edit List'
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.ListEditConfig.standalone_editor_config","title":"standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(default_factory=StandaloneCodeEditorConfig)
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u914d\u7f6e
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.ListEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig","title":"StandaloneCodeEditorConfig
dataclass
","text":" Bases: object
standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\base.py
@dataclasses.dataclass\nclass StandaloneCodeEditorConfig(object):\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b\"\"\"\n\n title: str = STANDALONE_EDITOR_TITLE\n \"\"\"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898\"\"\"\n\n text_font_family: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\"\"\"\n\n text_font_size: Optional[int] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f\"\"\"\n\n line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n line_wrap_width: int = LINE_WRAP_WIDTH\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6\"\"\"\n\n word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n file_filters: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668\"\"\"\n\n start_dir: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55\"\"\"\n\n use_default_menus: bool = True\n \"\"\"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f\"\"\"\n\n excluded_menus: Tuple[str] = ()\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\"\"\"\n\n excluded_menu_actions: Tuple[Tuple[str, str]] = (\n (MENU_FILE, ACTION_SAVE),\n (MENU_FILE, ACTION_SAVE_AS),\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879\"\"\"\n\n use_default_toolbar: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f\"\"\"\n\n excluded_toolbar_actions: Tuple[str] = (\n ACTION_SAVE,\n ACTION_SAVE_AS,\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879\"\"\"\n\n confirm_dialog: bool = True\n \"\"\"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n confirm_dialog_title: str = CONFIRM_DIALOG_TITLE\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_dialog_message: str = CONFIRM_MSG\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9\"\"\"\n
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog","title":"confirm_dialog: bool = True
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_message","title":"confirm_dialog_message: str = CONFIRM_MSG
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_title","title":"confirm_dialog_title: str = CONFIRM_DIALOG_TITLE
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menu_actions","title":"excluded_menu_actions: Tuple[Tuple[str, str]] = ((MENU_FILE, ACTION_SAVE), (MENU_FILE, ACTION_SAVE_AS))
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menus","title":"excluded_menus: Tuple[str] = ()
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_toolbar_actions","title":"excluded_toolbar_actions: Tuple[str] = (ACTION_SAVE, ACTION_SAVE_AS)
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.file_filters","title":"file_filters: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_mode","title":"line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_width","title":"line_wrap_width: int = LINE_WRAP_WIDTH
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.start_dir","title":"start_dir: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_family","title":"text_font_family: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_size","title":"text_font_size: Optional[int] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.title","title":"title: str = STANDALONE_EDITOR_TITLE
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_menus","title":"use_default_menus: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_toolbar","title":"use_default_toolbar: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f
"},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.word_wrap_mode","title":"word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.listedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.listedit/#pyguiadapter.widgets.ListEdit","title":"ListEdit
","text":" Bases: PyLiteralEdit
"},{"location":"apis/pyguiadapter.widgets.listedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" list
typing.List
"},{"location":"apis/pyguiadapter.widgets.multichoice/","title":"pyguiadapter.widgets.multichoice","text":""},{"location":"apis/pyguiadapter.widgets.multichoice/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.multichoice/#pyguiadapter.widgets.MultiChoiceBoxConfig","title":"MultiChoiceBoxConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
MultiChoiceBox\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\multichoice.py
@dataclasses.dataclass(frozen=True)\nclass MultiChoiceBoxConfig(CommonParameterWidgetConfig):\n \"\"\"MultiChoiceBox\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Optional[Sequence[Any]] = dataclasses.field(default_factory=list)\n \"\"\"\u9ed8\u8ba4\u9009\u4e2d\u7684\u503c\"\"\"\n\n choices: Union[Sequence[Any], Dict[str, Any]] = dataclasses.field(\n default_factory=list\n )\n \"\"\"\u53ef\u9009\u9879\u5217\u8868\u3002\u4e3a\u5b57\u5178\u65f6\uff0c\u5c06\u952e\u503c\u5bf9\u7684\u952e\u4f5c\u4e3a\u663e\u793a\u6587\u672c\uff0c\u952e\u503c\u5bf9\u7684\u503c\u4f5c\u4e3a\u5b9e\u9645\u7684\u503c\uff1b\u5426\u5219\uff0c\u5bf9\u6bcf\u4e2a\u9009\u9879\u8c03\u7528str()\uff0c\u5c06\u8fd4\u56de\u503c\u4f5c\u4e3a\u663e\u793a\u6587\u672c\uff0c\u9009\u9879\u672c\u8eab\u4f5c\u4e3a\u5b9e\u9645\u7684\u503c\u3002\"\"\"\n\n columns: int = 1\n \"\"\"\u9009\u9879\u7684\u5217\u6570\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"MultiChoiceBox\"]:\n return MultiChoiceBox\n
"},{"location":"apis/pyguiadapter.widgets.multichoice/#pyguiadapter.widgets.MultiChoiceBoxConfig.choices","title":"choices: Union[Sequence[Any], Dict[str, Any]] = dataclasses.field(default_factory=list)
class-attribute
instance-attribute
","text":"\u53ef\u9009\u9879\u5217\u8868\u3002\u4e3a\u5b57\u5178\u65f6\uff0c\u5c06\u952e\u503c\u5bf9\u7684\u952e\u4f5c\u4e3a\u663e\u793a\u6587\u672c\uff0c\u952e\u503c\u5bf9\u7684\u503c\u4f5c\u4e3a\u5b9e\u9645\u7684\u503c\uff1b\u5426\u5219\uff0c\u5bf9\u6bcf\u4e2a\u9009\u9879\u8c03\u7528str()\uff0c\u5c06\u8fd4\u56de\u503c\u4f5c\u4e3a\u663e\u793a\u6587\u672c\uff0c\u9009\u9879\u672c\u8eab\u4f5c\u4e3a\u5b9e\u9645\u7684\u503c\u3002
"},{"location":"apis/pyguiadapter.widgets.multichoice/#pyguiadapter.widgets.MultiChoiceBoxConfig.columns","title":"columns: int = 1
class-attribute
instance-attribute
","text":"\u9009\u9879\u7684\u5217\u6570
"},{"location":"apis/pyguiadapter.widgets.multichoice/#pyguiadapter.widgets.MultiChoiceBoxConfig.default_value","title":"default_value: Optional[Sequence[Any]] = dataclasses.field(default_factory=list)
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u9009\u4e2d\u7684\u503c
"},{"location":"apis/pyguiadapter.widgets.multichoice/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.multichoice/#pyguiadapter.widgets.MultiChoiceBox","title":"MultiChoiceBox
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.multichoice/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" choice_t
"},{"location":"apis/pyguiadapter.widgets.objecteditor/","title":"pyguiadapter.widgets.objecteditor","text":""},{"location":"apis/pyguiadapter.widgets.objecteditor/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.objecteditor/#pyguiadapter.widgets.SchemaObjectEditorConfig","title":"SchemaObjectEditorConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
Source code in pyguiadapter\\widgets\\extend\\objecteditor.py
@dataclasses.dataclass(frozen=True)\nclass SchemaObjectEditorConfig(CommonParameterWidgetConfig):\n default_value: Optional[Dict[str, Any]] = None\n schema: Dict[str, ValueType] = None\n ignore_unknown_keys: bool = False\n fill_missing_keys: bool = False\n display_text: str = \"Edit\"\n window_title: str = \"Object Editor\"\n window_size: Tuple[int, int] = (500, 600)\n center_container_title: str = \"\"\n key_column_header: str = \"Key\"\n value_column_header: str = \"Value\"\n item_text_alignment: Union[Qt.AlignmentFlag, int, None] = Qt.AlignCenter\n value_item_alignment: Union[Qt.AlignmentFlag, int, None] = None\n key_item_selectable: bool = False\n row_selection_mode: bool = True\n real_key_as_tooltip: bool = False\n stretch_last_section: bool = True\n alternating_row_colors: bool = False\n show_vertical_header: bool = False\n\n @classmethod\n def target_widget_class(cls) -> Type[\"SchemaObjectEditor\"]:\n return SchemaObjectEditor\n
"},{"location":"apis/pyguiadapter.widgets.objecteditor/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.objecteditor/#pyguiadapter.widgets.SchemaObjectEditor","title":"SchemaObjectEditor
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.objectseditor/","title":"pyguiadapter.widgets.objectseditor","text":""},{"location":"apis/pyguiadapter.widgets.objectseditor/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.objectseditor/#pyguiadapter.widgets.SchemaObjectsEditorConfig","title":"SchemaObjectsEditorConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
Source code in pyguiadapter\\widgets\\extend\\objectseditor.py
@dataclasses.dataclass(frozen=True)\nclass SchemaObjectsEditorConfig(CommonParameterWidgetConfig):\n default_value: Optional[List[Dict[str, Any]]] = None\n schema: Dict[str, ValueType] = None\n ignore_unknown_keys: bool = False\n fill_missing_keys: bool = False\n display_text: str = \"Edit - {object_count} objects in list\"\n window_title: str = \"Objects Editor\"\n window_size: Tuple[int, int] = (800, 600)\n center_container_title: str = \"\"\n item_editor_title: str = \"\"\n item_editor_size: Tuple[int, int] = (500, 600)\n item_editor_center_container_title: str = \"\"\n wrap_movement: bool = False\n add_button_text: str = \"Add\"\n edit_button_text: str = \"Edit\"\n remove_button_text: str = \"Remove\"\n clear_button_text: str = \"Clear\"\n move_up_button_text: str = \"Move Up\"\n move_down_button_text: str = \"Move Down\"\n stretch_last_section: bool = True\n no_selection_warning_message: Optional[str] = NO_OBJECT_SELECTED_WARNING_MESSAGE\n no_items_warning_message: Optional[str] = NO_OBJECT_ADDED_WARNING_MESSAGE\n remove_confirm_message: Optional[str] = REMOVE_CONFIRM_MESSAGE\n clear_confirm_message: Optional[str] = CLEAR_CONFIRM_MESSAGE\n multiple_selection_warning_message: Optional[str] = MULTIPLE_OBJECTS_WARNING_MESSAGE\n double_click_to_edit: bool = False\n resize_rows_to_contents: bool = True\n alternating_row_colors: bool = False\n show_horizontal_header: bool = True\n show_vertical_header: bool = True\n show_grid: bool = True\n continuous_selection: bool = True\n item_text_alignment: Union[int, Qt.AlignmentFlag, None] = None\n item_data_as_tooltip: bool = False\n item_data_as_status_tip: bool = False\n column_widths: Optional[Dict[int, int]] = None\n horizontal_resize_modes: Union[\n Dict[int, QHeaderView.ResizeMode], QHeaderView.ResizeMode, None\n ] = None\n vertical_resize_modes: Union[\n Dict[int, QHeaderView.ResizeMode], QHeaderView.ResizeMode, None\n ] = None\n\n @classmethod\n def target_widget_class(cls) -> Type[\"SchemaObjectsEditor\"]:\n return SchemaObjectsEditor\n
"},{"location":"apis/pyguiadapter.widgets.objectseditor/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.objectseditor/#pyguiadapter.widgets.SchemaObjectsEditor","title":"SchemaObjectsEditor
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.pathlist/","title":"pyguiadapter.widgets.pathlist","text":""},{"location":"apis/pyguiadapter.widgets.pathlist/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig","title":"PathEditDialogConfig
dataclass
","text":" Bases: object
PathEditDialog\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\pathlist.py
@dataclasses.dataclass(frozen=True)\nclass PathEditDialogConfig(object):\n \"\"\"PathEditDialog\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n title: str = \"Edit Path\"\n \"\"\"\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n select_file: bool = True\n \"\"\"\u662f\u5426\u5f00\u542f\u9009\u62e9\u6587\u4ef6\u529f\u80fd\"\"\"\n\n select_dir: bool = True\n \"\"\"\u662f\u5426\u5f00\u542f\u9009\u62e9\u76ee\u5f55\u529f\u80fd\"\"\"\n\n select_file_button_text: str = \"File\"\n \"\"\"\u9009\u62e9\u6587\u4ef6\u6309\u94ae\u6587\u672c\"\"\"\n\n select_dir_button_text: str = \"Directory\"\n \"\"\"\u9009\u62e9\u76ee\u5f55\u6309\u94ae\u6587\u672c\"\"\"\n\n cancel_button_text: str = \"Cancel\"\n \"\"\"\u53d6\u6d88\u6309\u94ae\u6587\u672c\"\"\"\n\n confirm_button_text: str = \"Confirm\"\n \"\"\"\u786e\u8ba4\u6309\u94ae\u6587\u672c\"\"\"\n\n file_dialog_title: str = \"Select File\"\n \"\"\"\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n dir_dialog_title: str = \"Select Directory\"\n \"\"\"\u76ee\u5f55\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n file_filters: str = \"\"\n \"\"\"\u6587\u4ef6\u8fc7\u6ee4\u5668\"\"\"\n\n start_dir: str = \"\"\n \"\"\"\u8d77\u59cb\u8def\u5f84\"\"\"\n
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.cancel_button_text","title":"cancel_button_text: str = 'Cancel'
class-attribute
instance-attribute
","text":"\u53d6\u6d88\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.confirm_button_text","title":"confirm_button_text: str = 'Confirm'
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.dir_dialog_title","title":"dir_dialog_title: str = 'Select Directory'
class-attribute
instance-attribute
","text":"\u76ee\u5f55\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.file_dialog_title","title":"file_dialog_title: str = 'Select File'
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.file_filters","title":"file_filters: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u8fc7\u6ee4\u5668
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.select_dir","title":"select_dir: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f00\u542f\u9009\u62e9\u76ee\u5f55\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.select_dir_button_text","title":"select_dir_button_text: str = 'Directory'
class-attribute
instance-attribute
","text":"\u9009\u62e9\u76ee\u5f55\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.select_file","title":"select_file: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f00\u542f\u9009\u62e9\u6587\u4ef6\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.select_file_button_text","title":"select_file_button_text: str = 'File'
class-attribute
instance-attribute
","text":"\u9009\u62e9\u6587\u4ef6\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.start_dir","title":"start_dir: str = ''
class-attribute
instance-attribute
","text":"\u8d77\u59cb\u8def\u5f84
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathEditDialogConfig.title","title":"title: str = 'Edit Path'
class-attribute
instance-attribute
","text":"\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig","title":"PathListEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
PathListEdit\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\pathlist.py
@dataclasses.dataclass(frozen=True)\nclass PathListEditConfig(CommonParameterWidgetConfig):\n \"\"\"PathListEdit\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Optional[List[str]] = dataclasses.field(default_factory=list)\n \"\"\"\u9ed8\u8ba4\u503c\"\"\"\n\n empty_string_strategy: Literal[\"keep_all\", \"keep_one\", \"remove_all\"] = \"remove_all\"\n \"\"\"\u5bf9\u5f85\u5217\u8868\u4e2d\u7a7a\u5b57\u7b26\u4e32\u7684\u7b56\u7565\uff0ckeep_all\u8868\u793a\u4fdd\u7559\u6240\u6709\u7a7a\u5b57\u7b26\u4e32\uff0ckeep_one\u8868\u793a\u53ea\u4fdd\u7559\u7b2c\u4e00\u4e2a\u7a7a\u5b57\u7b26\u4e32\uff0cremove_all\u8868\u793a\u5220\u9664\u6240\u6709\u7a7a\u5b57\u7b26\u4e32\"\"\"\n\n add_files: bool = True\n \"\"\"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u529f\u80fd\"\"\"\n\n add_dirs: bool = True\n \"\"\"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u5939\u8def\u5f84\u529f\u80fd\"\"\"\n\n file_filters: str = \"\"\n \"\"\"\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u7528\u4e8e\u6587\u4ef6\u5bf9\u8bdd\u6846\"\"\"\n\n start_dir: str = \"\"\n \"\"\"\u8d77\u59cb\u8def\u5f84\uff0c\u7528\u4e8e\u6587\u4ef6\u5bf9\u8bdd\u6846\"\"\"\n\n normalize_path: bool = True\n \"\"\"\u662f\u5426\u5c06\u8def\u5f84\u89c4\u8303\u5316\"\"\"\n\n absolutize_path: bool = True\n \"\"\"\u662f\u5426\u5c06\u8def\u5f84\u8f6c\u6362\u4e3a\u7edd\u5bf9\u8def\u5f84\"\"\"\n\n add_file_button_text: str = \"Add Files\"\n \"\"\"\u6dfb\u52a0\u6587\u4ef6\u6309\u94ae\u6587\u672c\"\"\"\n\n add_dir_button_text: str = \"Add Dir\"\n \"\"\"\u6dfb\u52a0\u76ee\u5f55\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n remove_button_text: str = \"Remove\"\n \"\"\"\u5220\u9664\u6309\u94ae\u6587\u672c\"\"\"\n\n clear_button_text: str = \"Clear\"\n \"\"\"\u6e05\u7a7a\u5168\u90e8\u6309\u94ae\u6587\u672c\"\"\"\n\n file_dialog_title: str = \"Select File\"\n \"\"\"\u6dfb\u52a0\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n dir_dialog_title: str = \"Select Directory\"\n \"\"\"\u6dfb\u52a0\u6587\u4ef6\u5939\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_dialog_title: str = \"Confirm\"\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n warning_dialog_title: str = \"Warning\"\n \"\"\"\u8b66\u544a\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_remove: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u79fb\u9664\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n confirm_clear: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u6e05\u7a7a\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n remove_confirm_message: str = \"Are you sure to remove the selected item?\"\n \"\"\"\u79fb\u9664\u786e\u8ba4\u5bf9\u8bdd\u6846\u6d88\u606f\"\"\"\n\n clear_confirm_message: str = \"Are you sure to remove all items?\"\n \"\"\"\u6e05\u7a7a\u786e\u8ba4\u5bf9\u8bdd\u6846\u6d88\u606f\"\"\"\n\n no_selection_message: str = \"No items are selected!\"\n \"\"\"\u672a\u9009\u62e9\u4efb\u4f55\u9879\u7684\u63d0\u793a\"\"\"\n\n drag_enabled: bool = True\n \"\"\"\u662f\u5426\u5141\u8bb8\u62d6\u62fd\"\"\"\n\n wrapping: bool = False\n \"\"\"\u662f\u5426\u5141\u8bb8\u6362\u884c\"\"\"\n\n text_elide_mode: Optional[TextElideMode] = None\n \"\"\"\u6587\u672c\u7701\u7565\u6a21\u5f0f\"\"\"\n\n alternating_row_colors: bool = True\n \"\"\"\u662f\u5426\u4f7f\u7528\u4ea4\u66ff\u884c\u989c\u8272\"\"\"\n\n width: Optional[int] = None\n \"\"\"\u8868\u683c\u7684\u6700\u5c0f\u5bbd\u5ea6\"\"\"\n\n height: Optional[int] = 210\n \"\"\"\u8868\u683c\u7684\u6700\u5c0f\u9ad8\u5ea6\"\"\"\n\n drag_n_drop: bool = True\n \"\"\"\u662f\u5426\u5141\u8bb8\u62d6\u62fd\u6587\u4ef6\u6216\u76ee\u5f55\u5230\u8868\u683c\"\"\"\n\n drag_n_drop_filter: Optional[Callable[[str, str], bool]] = default_dnd_filter\n \"\"\"\u6587\u4ef6\u62d6\u653e\u529f\u80fd\u7684\u8fc7\u6ee4\u51fd\u6570\u3002\u8be5\u51fd\u6570\u5e94\u63a5\u6536\u4e24\u4e2a\u53c2\u6570\uff1a\u6587\u4ef6\u8fc7\u6ee4\u5668\uff08\u5373\u672c\u7c7b\u7684`filters`\u5c5e\u6027\uff09\u548c\u62d6\u653e\u7684\u6587\u4ef6\u8def\u5f84\u3002\n \u82e5\u8fd4\u56deTrue\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u53ef\u4ee5\u88ab\u62d6\u653e\uff1b\u5426\u5219\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u4e0d\u80fd\u88ab\u62d6\u653e\u3002\u8be5\u5c5e\u6027\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u4e3aNone\uff0c\u8868\u793a\u4e0d\u5bf9\u62d6\u653e\u6587\u4ef6\u8fdb\u884c\u8fc7\u6ee4\u3002\n \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528`default_dnd_filter`\u51fd\u6570\u4f5c\u4e3a\u8fc7\u6ee4\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u4f1a\u5c06\u5f85\u62d6\u653e\u7684\u6587\u4ef6\u7684\u6587\u4ef6\u540d\u4e0e\u6587\u4ef6\u8fc7\u6ee4\u5668\u8fdb\u884c\u5339\u914d\uff0c\u82e5\u547d\u4e2d\u4efb\u610f\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u5219\u8fd4\u56deTrue\uff0c\n \u5426\u5219\u8fd4\u56deFalse\u3002\u6bd4\u5982\uff0c\u82e5\u6587\u4ef6\u8fc7\u6ee4\u5668\u4e3a'Text files (*.txt);;Python files (*.py)', \u5219\u6587\u4ef6'hello.txt'\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Text files (*.txt)';\n \u6587\u4ef6'hello.py'\u4e5f\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Python files (*.py)'\uff1b\u6587\u4ef6'hello.png'\u5219\u4e0d\u80fd\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u6ca1\u6709\u547d\u4e2d\u4efb\u4f55\u6587\u4ef6\u8fc7\u6ee4\u5668\u3002\"\"\"\n\n path_edit_dialog_config: Optional[PathEditDialogConfig] = None\n \"\"\"\u7f16\u8f91\u8def\u5f84\u5bf9\u8bdd\u6846\u7684\u914d\u7f6e\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"PathListEdit\"]:\n return PathListEdit\n
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.absolutize_path","title":"absolutize_path: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8def\u5f84\u8f6c\u6362\u4e3a\u7edd\u5bf9\u8def\u5f84
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.add_dir_button_text","title":"add_dir_button_text: str = 'Add Dir'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u76ee\u5f55\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.add_dirs","title":"add_dirs: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u5939\u8def\u5f84\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.add_file_button_text","title":"add_file_button_text: str = 'Add Files'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6587\u4ef6\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.add_files","title":"add_files: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.alternating_row_colors","title":"alternating_row_colors: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7f\u7528\u4ea4\u66ff\u884c\u989c\u8272
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.clear_button_text","title":"clear_button_text: str = 'Clear'
class-attribute
instance-attribute
","text":"\u6e05\u7a7a\u5168\u90e8\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.clear_confirm_message","title":"clear_confirm_message: str = 'Are you sure to remove all items?'
class-attribute
instance-attribute
","text":"\u6e05\u7a7a\u786e\u8ba4\u5bf9\u8bdd\u6846\u6d88\u606f
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.confirm_clear","title":"confirm_clear: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u7a7a\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.confirm_dialog_title","title":"confirm_dialog_title: str = 'Confirm'
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.confirm_remove","title":"confirm_remove: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u79fb\u9664\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.default_value","title":"default_value: Optional[List[str]] = dataclasses.field(default_factory=list)
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.dir_dialog_title","title":"dir_dialog_title: str = 'Select Directory'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6587\u4ef6\u5939\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.drag_enabled","title":"drag_enabled: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5141\u8bb8\u62d6\u62fd
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.drag_n_drop","title":"drag_n_drop: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5141\u8bb8\u62d6\u62fd\u6587\u4ef6\u6216\u76ee\u5f55\u5230\u8868\u683c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.drag_n_drop_filter","title":"drag_n_drop_filter: Optional[Callable[[str, str], bool]] = default_dnd_filter
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u62d6\u653e\u529f\u80fd\u7684\u8fc7\u6ee4\u51fd\u6570\u3002\u8be5\u51fd\u6570\u5e94\u63a5\u6536\u4e24\u4e2a\u53c2\u6570\uff1a\u6587\u4ef6\u8fc7\u6ee4\u5668\uff08\u5373\u672c\u7c7b\u7684filters
\u5c5e\u6027\uff09\u548c\u62d6\u653e\u7684\u6587\u4ef6\u8def\u5f84\u3002 \u82e5\u8fd4\u56deTrue\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u53ef\u4ee5\u88ab\u62d6\u653e\uff1b\u5426\u5219\uff0c\u5219\u8868\u793a\u8be5\u6587\u4ef6\u4e0d\u80fd\u88ab\u62d6\u653e\u3002\u8be5\u5c5e\u6027\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u4e3aNone\uff0c\u8868\u793a\u4e0d\u5bf9\u62d6\u653e\u6587\u4ef6\u8fdb\u884c\u8fc7\u6ee4\u3002 \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528default_dnd_filter
\u51fd\u6570\u4f5c\u4e3a\u8fc7\u6ee4\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u4f1a\u5c06\u5f85\u62d6\u653e\u7684\u6587\u4ef6\u7684\u6587\u4ef6\u540d\u4e0e\u6587\u4ef6\u8fc7\u6ee4\u5668\u8fdb\u884c\u5339\u914d\uff0c\u82e5\u547d\u4e2d\u4efb\u610f\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u5219\u8fd4\u56deTrue\uff0c \u5426\u5219\u8fd4\u56deFalse\u3002\u6bd4\u5982\uff0c\u82e5\u6587\u4ef6\u8fc7\u6ee4\u5668\u4e3a'Text files (.txt);;Python files (.py)', \u5219\u6587\u4ef6'hello.txt'\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Text files (.txt)'; \u6587\u4ef6'hello.py'\u4e5f\u53ef\u4ee5\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u547d\u4e2d\u4e86'Python files (.py)'\uff1b\u6587\u4ef6'hello.png'\u5219\u4e0d\u80fd\u88ab\u62d6\u653e\uff0c\u56e0\u4e3a\u5176\u6ca1\u6709\u547d\u4e2d\u4efb\u4f55\u6587\u4ef6\u8fc7\u6ee4\u5668\u3002
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.empty_string_strategy","title":"empty_string_strategy: Literal['keep_all', 'keep_one', 'remove_all'] = 'remove_all'
class-attribute
instance-attribute
","text":"\u5bf9\u5f85\u5217\u8868\u4e2d\u7a7a\u5b57\u7b26\u4e32\u7684\u7b56\u7565\uff0ckeep_all\u8868\u793a\u4fdd\u7559\u6240\u6709\u7a7a\u5b57\u7b26\u4e32\uff0ckeep_one\u8868\u793a\u53ea\u4fdd\u7559\u7b2c\u4e00\u4e2a\u7a7a\u5b57\u7b26\u4e32\uff0cremove_all\u8868\u793a\u5220\u9664\u6240\u6709\u7a7a\u5b57\u7b26\u4e32
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.file_dialog_title","title":"file_dialog_title: str = 'Select File'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.file_filters","title":"file_filters: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u7528\u4e8e\u6587\u4ef6\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.height","title":"height: Optional[int] = 210
class-attribute
instance-attribute
","text":"\u8868\u683c\u7684\u6700\u5c0f\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.no_selection_message","title":"no_selection_message: str = 'No items are selected!'
class-attribute
instance-attribute
","text":"\u672a\u9009\u62e9\u4efb\u4f55\u9879\u7684\u63d0\u793a
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.normalize_path","title":"normalize_path: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8def\u5f84\u89c4\u8303\u5316
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.path_edit_dialog_config","title":"path_edit_dialog_config: Optional[PathEditDialogConfig] = None
class-attribute
instance-attribute
","text":"\u7f16\u8f91\u8def\u5f84\u5bf9\u8bdd\u6846\u7684\u914d\u7f6e
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.remove_button_text","title":"remove_button_text: str = 'Remove'
class-attribute
instance-attribute
","text":"\u5220\u9664\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.remove_confirm_message","title":"remove_confirm_message: str = 'Are you sure to remove the selected item?'
class-attribute
instance-attribute
","text":"\u79fb\u9664\u786e\u8ba4\u5bf9\u8bdd\u6846\u6d88\u606f
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.start_dir","title":"start_dir: str = ''
class-attribute
instance-attribute
","text":"\u8d77\u59cb\u8def\u5f84\uff0c\u7528\u4e8e\u6587\u4ef6\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.text_elide_mode","title":"text_elide_mode: Optional[TextElideMode] = None
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.warning_dialog_title","title":"warning_dialog_title: str = 'Warning'
class-attribute
instance-attribute
","text":"\u8b66\u544a\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"\u8868\u683c\u7684\u6700\u5c0f\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEditConfig.wrapping","title":"wrapping: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5141\u8bb8\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.FileListEditConfig","title":"FileListEditConfig
dataclass
","text":" Bases: PathListEditConfig
\u6587\u4ef6\u5217\u8868\u63a7\u4ef6\u7684\u914d\u7f6e
Source code in pyguiadapter\\widgets\\extend\\pathlist.py
@dataclasses.dataclass(frozen=True)\nclass FileListEditConfig(PathListEditConfig):\n \"\"\"\u6587\u4ef6\u5217\u8868\u63a7\u4ef6\u7684\u914d\u7f6e\"\"\"\n\n add_files = True\n add_dirs = False\n\n def target_widget_class(self) -> Type[\"FileListEdit\"]:\n return FileListEdit\n
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.DirectoryListEditConfig","title":"DirectoryListEditConfig
dataclass
","text":" Bases: PathListEditConfig
\u6587\u4ef6\u5217\u8868\u63a7\u4ef6\u7684\u914d\u7f6e
Source code in pyguiadapter\\widgets\\extend\\pathlist.py
@dataclasses.dataclass(frozen=True)\nclass DirectoryListEditConfig(PathListEditConfig):\n \"\"\"\u6587\u4ef6\u5217\u8868\u63a7\u4ef6\u7684\u914d\u7f6e\"\"\"\n\n add_files = False\n add_dirs = True\n file_filters = \"\"\n\n def target_widget_class(self) -> Type[\"DirectoryListEdit\"]:\n return DirectoryListEdit\n
"},{"location":"apis/pyguiadapter.widgets.pathlist/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEdit","title":"PathListEdit
","text":" Bases: CommonParameterWidget
\u8def\u5f84\u5217\u8868\u63a7\u4ef6\uff0c\u53ef\u4ee5\u7528\u4e8e\u5b58\u653e\u591a\u4e2a\u8def\u5f84\uff0c\u652f\u6301\u6587\u4ef6\u548c\u76ee\u5f55\u3002
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEdit.ElideLeft","title":"ElideLeft = TextElideMode.ElideLeft
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u7701\u7565\u5de6\u8fb9
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEdit.ElideMiddle","title":"ElideMiddle = TextElideMode.ElideMiddle
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u7701\u7565\u4e2d\u95f4
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEdit.ElideNone","title":"ElideNone = TextElideMode.ElideNone
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u4e0d\u7701\u7565
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.PathListEdit.ElideRight","title":"ElideRight = TextElideMode.ElideRight
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u7701\u7565\u53f3\u8fb9
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.FileListEdit","title":"FileListEdit
","text":" Bases: PathListEdit
\u6587\u4ef6\u5217\u8868\u63a7\u4ef6\uff0c\u7ee7\u627f\u81eaPathListEdit
\uff0c\u7528\u4e8e\u5b58\u653e\u6587\u4ef6\u8def\u5f84\u3002
"},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.DirectoryListEdit","title":"DirectoryListEdit
","text":" Bases: PathListEdit
\u76ee\u5f55\u5217\u8868\u63a7\u4ef6\uff0c\u7ee7\u627f\u81eaPathListEdit
\uff0c\u7528\u4e8e\u5b58\u653e\u76ee\u5f55\u8def\u5f84\u3002
"},{"location":"apis/pyguiadapter.widgets.pathlist/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" path_dict_t
-> PathListEdit
file_list_t
-> FileListEdit
dir_list_t
-> DirectoryListEdit
"},{"location":"apis/pyguiadapter.widgets.pathlist/#_4","title":"\u7c7b\u578b\u4e0e\u5e38\u91cf","text":""},{"location":"apis/pyguiadapter.widgets.pathlist/#pyguiadapter.widgets.extend.pathlist.TextElideMode","title":"TextElideMode = Qt.TextElideMode
module-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.pathseditor/","title":"pyguiadapter.widgets.pathseditor","text":""},{"location":"apis/pyguiadapter.widgets.pathseditor/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig","title":"PathsEditorConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
Source code in pyguiadapter\\widgets\\extend\\pathseditor.py
@dataclasses.dataclass(frozen=True)\nclass PathsEditorConfig(CommonParameterWidgetConfig):\n default_value: List[str] = dataclasses.field(default_factory=list)\n\n editor_button_text: str = \"Edit({} paths in list)\"\n \"\"\"\u7f16\u8f91\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n editor_title: str = \"\"\n \"\"\"\u8def\u5f84\u5217\u8868\u7f16\u8f91\u5668\u7684\u6807\u9898\"\"\"\n\n editor_size: Tuple[int, int] = (750, 600)\n \"\"\"\u8def\u5f84\u5217\u8868\u7f16\u8f91\u5668\u7a97\u53e3\u7684\u5927\u5c0f\"\"\"\n\n file_list_title: str = \"Paths\"\n \"\"\"\u8def\u5f84\u5217\u8868\u533a\u57df\u7684\u6807\u9898\"\"\"\n\n add_file: bool = True\n \"\"\"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u529f\u80fd\"\"\"\n\n add_dir: bool = True\n \"\"\"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u5939\u529f\u80fd\"\"\"\n\n add_file_button_text: str = \"File...\"\n \"\"\"\u6dfb\u52a0\u6587\u4ef6\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n file_filters: str = \"\"\n \"\"\"\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u7528\u4e8e\u9009\u62e9\u6587\u4ef6\u5bf9\u8bdd\u6846\"\"\"\n\n add_dir_button_text: str = \"Folder...\"\n \"\"\"\u6dfb\u52a0\u6587\u4ef6\u5939\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n start_dir: str = \"\"\n \"\"\"\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u521d\u59cb\u76ee\u5f55\"\"\"\n\n path_as_posix: bool = True\n \"\"\"\u662f\u5426\u5c06\u9009\u62e9\u7684\u6587\u4ef6\u6216\u6587\u4ef6\u5939\u7684\u8def\u5f84\u4ee5 Posix \u683c\u5f0f\u4fdd\u5b58\"\"\"\n\n edit_button_text: str = \"Edit\"\n \"\"\"\u7f16\u8f91\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n remove_button_text: str = \"Remove\"\n \"\"\"\u79fb\u9664\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n clear_button_text: str = \"Clear\"\n \"\"\"\u6e05\u7a7a\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n up_button_text: str = \"Up\"\n \"\"\"\u4e0a\u79fb\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n down_button_text: str = \"Down\"\n \"\"\"\u4e0b\u79fb\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n file_dialog_title: str = \"Select File\"\n \"\"\"\u9009\u62e9\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6807\u9898\"\"\"\n\n dir_dialog_title: str = \"Select Directory\"\n \"\"\"\u9009\u62e9\u6587\u4ef6\u5939\u5bf9\u8bdd\u6846\u7684\u6807\u9898\"\"\"\n\n confirm_dialog_title: str = \"Confirm\"\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u7684\u6807\u9898\"\"\"\n\n warning_dialog_title: str = \"Warning\"\n \"\"\"\u8b66\u544a\u5bf9\u8bdd\u6846\u7684\u6807\u9898\"\"\"\n\n confirm_clear_message: Optional[str] = \"Remove all the paths from the list?\"\n \"\"\"\u6e05\u7a7a\u6587\u4ef6\u5217\u8868\u7684\u786e\u8ba4\u6d88\u606f\u6587\u672c\uff0c\u5982\u679c\u4e3a None \u5219\u4e0d\u663e\u793a\u786e\u8ba4\u6d88\u606f\uff0c\u76f4\u63a5\u6e05\u7a7a\u6587\u4ef6\u5217\u8868\"\"\"\n\n confirm_remove_message: Optional[str] = \"Remove the selected path(s) from the list?\"\n \"\"\"\u79fb\u9664\u5f53\u524d\u9009\u4e2d\u9879\u7684\u786e\u8ba4\u6d88\u606f\u6587\u672c\uff0c\u5982\u679c\u4e3a None \u5219\u4e0d\u663e\u793a\u786e\u8ba4\u6d88\u606f\uff0c\u76f4\u63a5\u79fb\u9664\u5f53\u524d\u9009\u4e2d\u9879\"\"\"\n\n no_items_selected_message: Optional[str] = \"No path selected!\"\n \"\"\"\u6ca1\u6709\u9009\u4e2d\u4efb\u4f55\u9879\u65f6\u7684\u63d0\u793a\u6d88\u606f\"\"\"\n\n no_items_added_message: Optional[str] = \"No path added!\"\n \"\"\"\u6ca1\u6709\u6dfb\u52a0\u4efb\u4f55\u9879\u65f6\u7684\u63d0\u793a\u6d88\u606f\"\"\"\n\n double_click_to_edit: bool = True\n \"\"\"\u662f\u5426\u5141\u8bb8\u53cc\u51fb\u5217\u8868\u9879\u8fdb\u884c\u7f16\u8f91\"\"\"\n\n path_item_editor_title: str = \"Edit Path\"\n \"\"\"\u8def\u5f84\u7f16\u8f91\u5bf9\u8bdd\u6846\u7684\u6807\u9898\"\"\"\n\n path_item_editor_center_container_title: str = \"Path\"\n \"\"\"\u8def\u5f84\u7f16\u8f91\u5bf9\u8bdd\u6846\u4e2d\u4e2d\u5fc3\u5bb9\u5668\u7684\u6807\u9898\"\"\"\n\n @classmethod\n def target_widget_config(cls) -> Type[\"PathsEditor\"]:\n return PathsEditor\n
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.add_dir","title":"add_dir: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u5939\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.add_dir_button_text","title":"add_dir_button_text: str = 'Folder...'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6587\u4ef6\u5939\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.add_file","title":"add_file: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.add_file_button_text","title":"add_file_button_text: str = 'File...'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6587\u4ef6\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.clear_button_text","title":"clear_button_text: str = 'Clear'
class-attribute
instance-attribute
","text":"\u6e05\u7a7a\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.confirm_clear_message","title":"confirm_clear_message: Optional[str] = 'Remove all the paths from the list?'
class-attribute
instance-attribute
","text":"\u6e05\u7a7a\u6587\u4ef6\u5217\u8868\u7684\u786e\u8ba4\u6d88\u606f\u6587\u672c\uff0c\u5982\u679c\u4e3a None \u5219\u4e0d\u663e\u793a\u786e\u8ba4\u6d88\u606f\uff0c\u76f4\u63a5\u6e05\u7a7a\u6587\u4ef6\u5217\u8868
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.confirm_dialog_title","title":"confirm_dialog_title: str = 'Confirm'
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u7684\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.confirm_remove_message","title":"confirm_remove_message: Optional[str] = 'Remove the selected path(s) from the list?'
class-attribute
instance-attribute
","text":"\u79fb\u9664\u5f53\u524d\u9009\u4e2d\u9879\u7684\u786e\u8ba4\u6d88\u606f\u6587\u672c\uff0c\u5982\u679c\u4e3a None \u5219\u4e0d\u663e\u793a\u786e\u8ba4\u6d88\u606f\uff0c\u76f4\u63a5\u79fb\u9664\u5f53\u524d\u9009\u4e2d\u9879
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.dir_dialog_title","title":"dir_dialog_title: str = 'Select Directory'
class-attribute
instance-attribute
","text":"\u9009\u62e9\u6587\u4ef6\u5939\u5bf9\u8bdd\u6846\u7684\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.double_click_to_edit","title":"double_click_to_edit: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5141\u8bb8\u53cc\u51fb\u5217\u8868\u9879\u8fdb\u884c\u7f16\u8f91
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.down_button_text","title":"down_button_text: str = 'Down'
class-attribute
instance-attribute
","text":"\u4e0b\u79fb\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.edit_button_text","title":"edit_button_text: str = 'Edit'
class-attribute
instance-attribute
","text":"\u7f16\u8f91\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.editor_button_text","title":"editor_button_text: str = 'Edit({} paths in list)'
class-attribute
instance-attribute
","text":"\u7f16\u8f91\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.editor_size","title":"editor_size: Tuple[int, int] = (750, 600)
class-attribute
instance-attribute
","text":"\u8def\u5f84\u5217\u8868\u7f16\u8f91\u5668\u7a97\u53e3\u7684\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.editor_title","title":"editor_title: str = ''
class-attribute
instance-attribute
","text":"\u8def\u5f84\u5217\u8868\u7f16\u8f91\u5668\u7684\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.file_dialog_title","title":"file_dialog_title: str = 'Select File'
class-attribute
instance-attribute
","text":"\u9009\u62e9\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.file_filters","title":"file_filters: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u7528\u4e8e\u9009\u62e9\u6587\u4ef6\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.file_list_title","title":"file_list_title: str = 'Paths'
class-attribute
instance-attribute
","text":"\u8def\u5f84\u5217\u8868\u533a\u57df\u7684\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.no_items_added_message","title":"no_items_added_message: Optional[str] = 'No path added!'
class-attribute
instance-attribute
","text":"\u6ca1\u6709\u6dfb\u52a0\u4efb\u4f55\u9879\u65f6\u7684\u63d0\u793a\u6d88\u606f
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.no_items_selected_message","title":"no_items_selected_message: Optional[str] = 'No path selected!'
class-attribute
instance-attribute
","text":"\u6ca1\u6709\u9009\u4e2d\u4efb\u4f55\u9879\u65f6\u7684\u63d0\u793a\u6d88\u606f
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.path_as_posix","title":"path_as_posix: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u9009\u62e9\u7684\u6587\u4ef6\u6216\u6587\u4ef6\u5939\u7684\u8def\u5f84\u4ee5 Posix \u683c\u5f0f\u4fdd\u5b58
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.path_item_editor_center_container_title","title":"path_item_editor_center_container_title: str = 'Path'
class-attribute
instance-attribute
","text":"\u8def\u5f84\u7f16\u8f91\u5bf9\u8bdd\u6846\u4e2d\u4e2d\u5fc3\u5bb9\u5668\u7684\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.path_item_editor_title","title":"path_item_editor_title: str = 'Edit Path'
class-attribute
instance-attribute
","text":"\u8def\u5f84\u7f16\u8f91\u5bf9\u8bdd\u6846\u7684\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.remove_button_text","title":"remove_button_text: str = 'Remove'
class-attribute
instance-attribute
","text":"\u79fb\u9664\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.start_dir","title":"start_dir: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u521d\u59cb\u76ee\u5f55
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.up_button_text","title":"up_button_text: str = 'Up'
class-attribute
instance-attribute
","text":"\u4e0a\u79fb\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditorConfig.warning_dialog_title","title":"warning_dialog_title: str = 'Warning'
class-attribute
instance-attribute
","text":"\u8b66\u544a\u5bf9\u8bdd\u6846\u7684\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.pathseditor/#pyguiadapter.widgets.PathsEditor","title":"PathsEditor
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.pathseditor/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" paths_t
-> PathsEditor
"},{"location":"apis/pyguiadapter.widgets.plaindict/","title":"pyguiadapter.widgets.plaindict","text":""},{"location":"apis/pyguiadapter.widgets.plaindict/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig","title":"PlainDictEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
PlainDictEdit\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\extend\\plaindict.py
@dataclasses.dataclass(frozen=True)\nclass PlainDictEditConfig(CommonParameterWidgetConfig):\n \"\"\"PlainDictEdit\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[Dict[str, Any]] = dataclasses.field(default_factory=dict)\n \"\"\"\u9ed8\u8ba4\u503c\"\"\"\n\n edit_button_text: str = \"Edit\"\n \"\"\"\u7f16\u8f91\u6309\u94ae\u6587\u672c\"\"\"\n\n add_button_text: str = \"Add\"\n \"\"\"\u6dfb\u52a0\u6309\u94ae\u6587\u672c\"\"\"\n\n remove_button_text: str = \"Remove\"\n \"\"\"\u79fb\u9664\u6309\u94ae\u6587\u672c\"\"\"\n\n clear_button_text: str = \"Clear\"\n \"\"\"\u6e05\u7a7a\u6309\u94ae\u6587\u672c\"\"\"\n\n key_header: str = \"Key\"\n \"\"\"\u952e\u503c\u5bf9\u4e2d\u952e\u7684\u8868\u5934\u6587\u672c\"\"\"\n\n value_header: str = \"Value\"\n \"\"\"\u952e\u503c\u5bf9\u4e2d\u503c\u7684\u8868\u5934\u6587\u672c\"\"\"\n\n show_grid: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u7f51\u683c\u7ebf\"\"\"\n\n grid_style: Optional[GridStyle] = GridStyle.SolidLine\n \"\"\"\u7f51\u683c\u7ebf\u6837\u5f0f\"\"\"\n\n alternating_row_colors: bool = True\n \"\"\"\u662f\u5426\u4ea4\u66ff\u663e\u793a\u884c\u989c\u8272\"\"\"\n\n text_elide_mode: Optional[TextElideMode] = TextElideMode.ElideRight\n \"\"\"\u6587\u672c\u7701\u7565\u6a21\u5f0f\"\"\"\n\n corner_button_enabled: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u8fb9\u89d2\u6309\u94ae\"\"\"\n\n vertical_header_visible: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u5782\u76f4\u8868\u5934\"\"\"\n\n horizontal_header_visible: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u6c34\u5e73\u8868\u5934\"\"\"\n\n min_height: int = 260\n\n confirm_remove: bool = True\n \"\"\"\u662f\u5426\u5728\u79fb\u9664\u6570\u636e\u65f6\u5f39\u51fa\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n warning_dialog_title: str = \"Warning\"\n \"\"\"\u8b66\u544a\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_dialog_title: str = \"Confirm\"\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n no_items_message: str = \"No item has been added!\"\n \"\"\"\u6ca1\u6709\u6dfb\u52a0\u9879\u65f6\u7684\u63d0\u793a\u4fe1\u606f\"\"\"\n\n no_selection_message: str = \"No item selected!\"\n \"\"\"\u6ca1\u6709\u9009\u62e9\u9879\u65f6\u7684\u63d0\u793a\u4fe1\u606f\"\"\"\n\n confirm_remove_message: str = \"Are you sure to remove the selected item?\"\n \"\"\"\u79fb\u9664\u9879\u65f6\u7684\u786e\u8ba4\u5bf9\u8bdd\u6846\u4fe1\u606f\"\"\"\n\n confirm_clear_message: str = \"Are you sure to remove all items?\"\n \"\"\"\u6e05\u7a7a\u9879\u65f6\u7684\u786e\u8ba4\u5bf9\u8bdd\u6846\u4fe1\u606f\"\"\"\n\n edit_item_title: str = \"Edit - {}\"\n \"\"\"\u7f16\u8f91\u9879\u5bf9\u8bdd\u6846\u6807\u9898\uff0c{}\u5c06\u88ab\u66ff\u6362\u4e3a\u5f53\u524d\u9879\u7684\u952e\"\"\"\n\n add_item_title: str = \"Add Item\"\n \"\"\"\u6dfb\u52a0\u9879\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n editor_size: Tuple[int, int] = (500, 400)\n \"\"\"\u7f16\u8f91/\u6dfb\u52a0\u9879\u5bf9\u8bdd\u6846\u5927\u5c0f\"\"\"\n\n width: Optional[int] = None\n \"\"\"\u8868\u683c\u6700\u5c0f\u5bbd\u5ea6\"\"\"\n\n height: Optional[int] = 200\n \"\"\"\u8868\u683c\u6700\u5c0f\u9ad8\u5ea6\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"PlainDictEdit\"]:\n return PlainDictEdit\n
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.add_button_text","title":"add_button_text: str = 'Add'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.add_item_title","title":"add_item_title: str = 'Add Item'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u9879\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.alternating_row_colors","title":"alternating_row_colors: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u4ea4\u66ff\u663e\u793a\u884c\u989c\u8272
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.clear_button_text","title":"clear_button_text: str = 'Clear'
class-attribute
instance-attribute
","text":"\u6e05\u7a7a\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.confirm_clear_message","title":"confirm_clear_message: str = 'Are you sure to remove all items?'
class-attribute
instance-attribute
","text":"\u6e05\u7a7a\u9879\u65f6\u7684\u786e\u8ba4\u5bf9\u8bdd\u6846\u4fe1\u606f
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.confirm_dialog_title","title":"confirm_dialog_title: str = 'Confirm'
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.confirm_remove","title":"confirm_remove: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5728\u79fb\u9664\u6570\u636e\u65f6\u5f39\u51fa\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.confirm_remove_message","title":"confirm_remove_message: str = 'Are you sure to remove the selected item?'
class-attribute
instance-attribute
","text":"\u79fb\u9664\u9879\u65f6\u7684\u786e\u8ba4\u5bf9\u8bdd\u6846\u4fe1\u606f
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.corner_button_enabled","title":"corner_button_enabled: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u8fb9\u89d2\u6309\u94ae
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.default_value","title":"default_value: Optional[Dict[str, Any]] = dataclasses.field(default_factory=dict)
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.edit_button_text","title":"edit_button_text: str = 'Edit'
class-attribute
instance-attribute
","text":"\u7f16\u8f91\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.edit_item_title","title":"edit_item_title: str = 'Edit - {}'
class-attribute
instance-attribute
","text":"\u7f16\u8f91\u9879\u5bf9\u8bdd\u6846\u6807\u9898\uff0c{}\u5c06\u88ab\u66ff\u6362\u4e3a\u5f53\u524d\u9879\u7684\u952e
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.editor_size","title":"editor_size: Tuple[int, int] = (500, 400)
class-attribute
instance-attribute
","text":"\u7f16\u8f91/\u6dfb\u52a0\u9879\u5bf9\u8bdd\u6846\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.grid_style","title":"grid_style: Optional[GridStyle] = GridStyle.SolidLine
class-attribute
instance-attribute
","text":"\u7f51\u683c\u7ebf\u6837\u5f0f
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.height","title":"height: Optional[int] = 200
class-attribute
instance-attribute
","text":"\u8868\u683c\u6700\u5c0f\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.horizontal_header_visible","title":"horizontal_header_visible: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6c34\u5e73\u8868\u5934
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.key_header","title":"key_header: str = 'Key'
class-attribute
instance-attribute
","text":"\u952e\u503c\u5bf9\u4e2d\u952e\u7684\u8868\u5934\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.no_items_message","title":"no_items_message: str = 'No item has been added!'
class-attribute
instance-attribute
","text":"\u6ca1\u6709\u6dfb\u52a0\u9879\u65f6\u7684\u63d0\u793a\u4fe1\u606f
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.no_selection_message","title":"no_selection_message: str = 'No item selected!'
class-attribute
instance-attribute
","text":"\u6ca1\u6709\u9009\u62e9\u9879\u65f6\u7684\u63d0\u793a\u4fe1\u606f
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.remove_button_text","title":"remove_button_text: str = 'Remove'
class-attribute
instance-attribute
","text":"\u79fb\u9664\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.show_grid","title":"show_grid: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u7f51\u683c\u7ebf
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.text_elide_mode","title":"text_elide_mode: Optional[TextElideMode] = TextElideMode.ElideRight
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.value_header","title":"value_header: str = 'Value'
class-attribute
instance-attribute
","text":"\u952e\u503c\u5bf9\u4e2d\u503c\u7684\u8868\u5934\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.vertical_header_visible","title":"vertical_header_visible: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u5782\u76f4\u8868\u5934
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.warning_dialog_title","title":"warning_dialog_title: str = 'Warning'
class-attribute
instance-attribute
","text":"\u8b66\u544a\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"\u8868\u683c\u6700\u5c0f\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.plaindict/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit","title":"PlainDictEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit.DashDotLine","title":"DashDotLine = GridStyle.DashDotLine
class-attribute
instance-attribute
","text":"\u7f51\u683c\u7ebf\u6837\u5f0f\uff1a\u70b9\u5212\u7ebf
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit.DashLine","title":"DashLine = GridStyle.DashLine
class-attribute
instance-attribute
","text":"\u7f51\u683c\u7ebf\u6837\u5f0f\uff1a\u865a\u7ebf
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit.DotLine","title":"DotLine = GridStyle.DotLine
class-attribute
instance-attribute
","text":"\u7f51\u683c\u7ebf\u6837\u5f0f\uff1a\u70b9\u7ebf
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit.ElideLeft","title":"ElideLeft = TextElideMode.ElideLeft
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u7701\u7565\u5de6\u8fb9
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit.ElideMiddle","title":"ElideMiddle = TextElideMode.ElideMiddle
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u7701\u7565\u4e2d\u95f4
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit.ElideNone","title":"ElideNone = TextElideMode.ElideNone
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u4e0d\u7701\u7565
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit.ElideRight","title":"ElideRight = TextElideMode.ElideRight
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u7701\u7565\u53f3\u8fb9
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit.NoGridLine","title":"NoGridLine = GridStyle.NoPen
class-attribute
instance-attribute
","text":"\u7f51\u683c\u7ebf\u6837\u5f0f\uff1a\u65e0\u7ebf
"},{"location":"apis/pyguiadapter.widgets.plaindict/#pyguiadapter.widgets.PlainDictEdit.SolidLine","title":"SolidLine = GridStyle.SolidLine
class-attribute
instance-attribute
","text":"\u7f51\u683c\u7ebf\u6837\u5f0f\uff1a\u5b9e\u7ebf
"},{"location":"apis/pyguiadapter.widgets.plaindict/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" plain_dict_t
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/","title":"pyguiadapter.widgets.pyliteraledit","text":""},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.PyLiteralEditConfig","title":"PyLiteralEditConfig
dataclass
","text":" Bases: BaseCodeEditConfig
PyLiteralEdit\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\pyliteraledit.py
@dataclasses.dataclass(frozen=True)\nclass PyLiteralEditConfig(BaseCodeEditConfig):\n \"\"\"PyLiteralEdit\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: PyLiteralType = \"\"\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n height: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6\"\"\"\n\n width: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6\"\"\"\n\n standalone_editor: bool = True\n \"\"\"\u662f\u5426\u4f7f\u7528\u72ec\u7acb\uff08standalone\uff09\u7f16\u8f91\u5668\u7a97\u53e3\"\"\"\n\n standalone_editor_button_text: str = \"Edit Python Literal\"\n \"\"\"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6253\u5f00\u6309\u94ae\u7684\u6587\u672c\"\"\"\n\n standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(\n default_factory=StandaloneCodeEditorConfig\n )\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\"\"\"\n\n initial_text: str = \"\"\n\n # DON'T CHANGE THE VALUES BELOW\n highlighter: Type[QPythonHighlighter] = QPythonHighlighter\n formatter: PythonFormatter = PythonFormatter()\n\n @classmethod\n def target_widget_class(cls) -> Type[\"PyLiteralEdit\"]:\n return PyLiteralEdit\n
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.PyLiteralEditConfig.default_value","title":"default_value: PyLiteralType = ''
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.PyLiteralEditConfig.height","title":"height: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.PyLiteralEditConfig.standalone_editor","title":"standalone_editor: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7f\u7528\u72ec\u7acb\uff08standalone\uff09\u7f16\u8f91\u5668\u7a97\u53e3
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.PyLiteralEditConfig.standalone_editor_button_text","title":"standalone_editor_button_text: str = 'Edit Python Literal'
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6253\u5f00\u6309\u94ae\u7684\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.PyLiteralEditConfig.standalone_editor_config","title":"standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(default_factory=StandaloneCodeEditorConfig)
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u914d\u7f6e
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.PyLiteralEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig","title":"StandaloneCodeEditorConfig
dataclass
","text":" Bases: object
standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\base.py
@dataclasses.dataclass\nclass StandaloneCodeEditorConfig(object):\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b\"\"\"\n\n title: str = STANDALONE_EDITOR_TITLE\n \"\"\"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898\"\"\"\n\n text_font_family: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\"\"\"\n\n text_font_size: Optional[int] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f\"\"\"\n\n line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n line_wrap_width: int = LINE_WRAP_WIDTH\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6\"\"\"\n\n word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n file_filters: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668\"\"\"\n\n start_dir: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55\"\"\"\n\n use_default_menus: bool = True\n \"\"\"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f\"\"\"\n\n excluded_menus: Tuple[str] = ()\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\"\"\"\n\n excluded_menu_actions: Tuple[Tuple[str, str]] = (\n (MENU_FILE, ACTION_SAVE),\n (MENU_FILE, ACTION_SAVE_AS),\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879\"\"\"\n\n use_default_toolbar: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f\"\"\"\n\n excluded_toolbar_actions: Tuple[str] = (\n ACTION_SAVE,\n ACTION_SAVE_AS,\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879\"\"\"\n\n confirm_dialog: bool = True\n \"\"\"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n confirm_dialog_title: str = CONFIRM_DIALOG_TITLE\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_dialog_message: str = CONFIRM_MSG\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9\"\"\"\n
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog","title":"confirm_dialog: bool = True
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_message","title":"confirm_dialog_message: str = CONFIRM_MSG
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_title","title":"confirm_dialog_title: str = CONFIRM_DIALOG_TITLE
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menu_actions","title":"excluded_menu_actions: Tuple[Tuple[str, str]] = ((MENU_FILE, ACTION_SAVE), (MENU_FILE, ACTION_SAVE_AS))
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menus","title":"excluded_menus: Tuple[str] = ()
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_toolbar_actions","title":"excluded_toolbar_actions: Tuple[str] = (ACTION_SAVE, ACTION_SAVE_AS)
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.file_filters","title":"file_filters: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_mode","title":"line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_width","title":"line_wrap_width: int = LINE_WRAP_WIDTH
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.start_dir","title":"start_dir: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_family","title":"text_font_family: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_size","title":"text_font_size: Optional[int] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.title","title":"title: str = STANDALONE_EDITOR_TITLE
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_menus","title":"use_default_menus: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_toolbar","title":"use_default_toolbar: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.word_wrap_mode","title":"word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#pyguiadapter.widgets.PyLiteralEdit","title":"PyLiteralEdit
","text":" Bases: BaseCodeEdit
"},{"location":"apis/pyguiadapter.widgets.pyliteraledit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" object
typing.Any
Union[str, int, float, bool, bytes, list, tuple, dict, set, None]
"},{"location":"apis/pyguiadapter.widgets.quantitybox/","title":"pyguiadapter.widgets.quantitybox","text":""},{"location":"apis/pyguiadapter.widgets.quantitybox/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.IntQuantityBoxConfig","title":"IntQuantityBoxConfig
dataclass
","text":" Bases: QuantityBoxConfig
IntQuantityBox\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\quantitybox.py
@dataclasses.dataclass(frozen=True)\nclass IntQuantityBoxConfig(QuantityBoxConfig):\n \"\"\"IntQuantityBox\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n # (quantity, unit)\n default_value: Optional[IntQuantityType] = (0, None)\n \"\"\"\u9ed8\u8ba4\u503c\u3002\u683c\u5f0f\u4e3a `(quantity, unit)`\u3002quantity\u4ee3\u8868\u6570\u91cf\u3002unit\u4ee3\u8868\u5355\u4f4d\uff0c\u53ef\u4ee5\u4e3a None \u6216 str\uff0c\u5982\u679c\u4e3a None\uff0c\u5219\u8868\u793a\u4f7f\u7528\u9ed8\u8ba4\u5355\u4f4d\uff0c\u5373units\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u3002\"\"\"\n\n quantity_type = int\n\n units: Sequence[str] = ()\n \"\"\"\u53ef\u9009\u7684\u5355\u4f4d\u5217\u8868\u3002\"\"\"\n\n max_value: Optional[int] = 2147483647\n \"\"\"quantity\u7684\u6700\u5927\u503c\u3002\"\"\"\n\n min_value: Optional[int] = -2147483648\n \"\"\"quantity\u7684\u6700\u5c0f\u503c\u3002\"\"\"\n\n decimals: Optional[int] = None\n\n step: Optional[int] = 1\n \"\"\"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f\u3002\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"IntQuantityBox\"]:\n return IntQuantityBox\n
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.IntQuantityBoxConfig.default_value","title":"default_value: Optional[IntQuantityType] = (0, None)
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c\u3002\u683c\u5f0f\u4e3a (quantity, unit)
\u3002quantity\u4ee3\u8868\u6570\u91cf\u3002unit\u4ee3\u8868\u5355\u4f4d\uff0c\u53ef\u4ee5\u4e3a None \u6216 str\uff0c\u5982\u679c\u4e3a None\uff0c\u5219\u8868\u793a\u4f7f\u7528\u9ed8\u8ba4\u5355\u4f4d\uff0c\u5373units\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.IntQuantityBoxConfig.max_value","title":"max_value: Optional[int] = 2147483647
class-attribute
instance-attribute
","text":"quantity\u7684\u6700\u5927\u503c\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.IntQuantityBoxConfig.min_value","title":"min_value: Optional[int] = -2147483648
class-attribute
instance-attribute
","text":"quantity\u7684\u6700\u5c0f\u503c\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.IntQuantityBoxConfig.step","title":"step: Optional[int] = 1
class-attribute
instance-attribute
","text":"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.IntQuantityBoxConfig.units","title":"units: Sequence[str] = ()
class-attribute
instance-attribute
","text":"\u53ef\u9009\u7684\u5355\u4f4d\u5217\u8868\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.FloatQuantityBoxConfig","title":"FloatQuantityBoxConfig
dataclass
","text":" Bases: QuantityBoxConfig
FloatQuantityBox\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\quantitybox.py
@dataclasses.dataclass(frozen=True)\nclass FloatQuantityBoxConfig(QuantityBoxConfig):\n \"\"\"FloatQuantityBox\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n # (quantity, unit)\n default_value: Optional[FloatQuantityType] = (0.0, None)\n \"\"\"\u9ed8\u8ba4\u503c\u3002\u683c\u5f0f\u4e3a `(quantity, unit)`\u3002quantity\u4ee3\u8868\u6570\u91cf\u3002unit\u4ee3\u8868\u5355\u4f4d\uff0c\u53ef\u4ee5\u4e3a None \u6216 str\uff0c\u5982\u679c\u4e3a None\uff0c\u5219\u8868\u793a\u4f7f\u7528\u9ed8\u8ba4\u5355\u4f4d\uff0c\u5373units\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u3002\"\"\"\n\n quantity_type = float\n\n units: Sequence[str] = ()\n \"\"\"\u53ef\u9009\u7684\u5355\u4f4d\u5217\u8868\u3002\"\"\"\n\n max_value: Optional[float] = 2147483647.0\n \"\"\"quantity\u7684\u6700\u5927\u503c\u3002\"\"\"\n\n min_value: Optional[float] = -2147483648.0\n \"\"\"quantity\u7684\u6700\u5c0f\u503c\u3002\"\"\"\n\n decimals: Optional[int] = 2\n \"\"\"quantity\u7684\u5c0f\u6570\u4f4d\u6570\u3002\"\"\"\n\n step: Optional[float] = 0.01\n \"\"\"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f\u3002\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"FloatQuantityBox\"]:\n return FloatQuantityBox\n
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.FloatQuantityBoxConfig.decimals","title":"decimals: Optional[int] = 2
class-attribute
instance-attribute
","text":"quantity\u7684\u5c0f\u6570\u4f4d\u6570\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.FloatQuantityBoxConfig.default_value","title":"default_value: Optional[FloatQuantityType] = (0.0, None)
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c\u3002\u683c\u5f0f\u4e3a (quantity, unit)
\u3002quantity\u4ee3\u8868\u6570\u91cf\u3002unit\u4ee3\u8868\u5355\u4f4d\uff0c\u53ef\u4ee5\u4e3a None \u6216 str\uff0c\u5982\u679c\u4e3a None\uff0c\u5219\u8868\u793a\u4f7f\u7528\u9ed8\u8ba4\u5355\u4f4d\uff0c\u5373units\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.FloatQuantityBoxConfig.max_value","title":"max_value: Optional[float] = 2147483647.0
class-attribute
instance-attribute
","text":"quantity\u7684\u6700\u5927\u503c\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.FloatQuantityBoxConfig.min_value","title":"min_value: Optional[float] = -2147483648.0
class-attribute
instance-attribute
","text":"quantity\u7684\u6700\u5c0f\u503c\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.FloatQuantityBoxConfig.step","title":"step: Optional[float] = 0.01
class-attribute
instance-attribute
","text":"\u5355\u6b21\u8c03\u6574\u7684\u6b65\u957f\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.FloatQuantityBoxConfig.units","title":"units: Sequence[str] = ()
class-attribute
instance-attribute
","text":"\u53ef\u9009\u7684\u5355\u4f4d\u5217\u8868\u3002
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.IntQuantityBox","title":"IntQuantityBox
","text":" Bases: QuantityBox
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#pyguiadapter.widgets.FloatQuantityBox","title":"FloatQuantityBox
","text":" Bases: QuantityBox
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#_3","title":"\u7c7b\u578b\u522b\u540d","text":" int_quantity_t
-> Tuple[int, str | None]
float_quantity_t
-> Tuple[float, str | None]
"},{"location":"apis/pyguiadapter.widgets.quantitybox/#_4","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" int_quantity_t
-> IntQuantityBox
float_quantity_t
-> FloatQuantityBox
"},{"location":"apis/pyguiadapter.widgets.setedit/","title":"pyguiadapter.widgets.setedit","text":""},{"location":"apis/pyguiadapter.widgets.setedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.SetEditConfig","title":"SetEditConfig
dataclass
","text":" Bases: PyLiteralEditConfig
SetEdit\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\setedit.py
@dataclasses.dataclass(frozen=True)\nclass SetEditConfig(PyLiteralEditConfig):\n \"\"\"SetEdit\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[set] = dataclasses.field(default_factory=set)\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n height: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6\"\"\"\n\n width: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6\"\"\"\n\n standalone_editor: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668\"\"\"\n\n standalone_editor_button_text: str = \"Edit Set\"\n \"\"\"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c\"\"\"\n\n standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(\n default_factory=StandaloneCodeEditorConfig\n )\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\"\"\"\n\n initial_text: str = \"{}\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"SetEdit\"]:\n return SetEdit\n
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.SetEditConfig.default_value","title":"default_value: Optional[set] = dataclasses.field(default_factory=set)
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.SetEditConfig.height","title":"height: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.SetEditConfig.standalone_editor","title":"standalone_editor: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.SetEditConfig.standalone_editor_button_text","title":"standalone_editor_button_text: str = 'Edit Set'
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.SetEditConfig.standalone_editor_config","title":"standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(default_factory=StandaloneCodeEditorConfig)
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u914d\u7f6e
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.SetEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig","title":"StandaloneCodeEditorConfig
dataclass
","text":" Bases: object
standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\base.py
@dataclasses.dataclass\nclass StandaloneCodeEditorConfig(object):\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b\"\"\"\n\n title: str = STANDALONE_EDITOR_TITLE\n \"\"\"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898\"\"\"\n\n text_font_family: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\"\"\"\n\n text_font_size: Optional[int] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f\"\"\"\n\n line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n line_wrap_width: int = LINE_WRAP_WIDTH\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6\"\"\"\n\n word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n file_filters: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668\"\"\"\n\n start_dir: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55\"\"\"\n\n use_default_menus: bool = True\n \"\"\"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f\"\"\"\n\n excluded_menus: Tuple[str] = ()\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\"\"\"\n\n excluded_menu_actions: Tuple[Tuple[str, str]] = (\n (MENU_FILE, ACTION_SAVE),\n (MENU_FILE, ACTION_SAVE_AS),\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879\"\"\"\n\n use_default_toolbar: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f\"\"\"\n\n excluded_toolbar_actions: Tuple[str] = (\n ACTION_SAVE,\n ACTION_SAVE_AS,\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879\"\"\"\n\n confirm_dialog: bool = True\n \"\"\"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n confirm_dialog_title: str = CONFIRM_DIALOG_TITLE\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_dialog_message: str = CONFIRM_MSG\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9\"\"\"\n
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog","title":"confirm_dialog: bool = True
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_message","title":"confirm_dialog_message: str = CONFIRM_MSG
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_title","title":"confirm_dialog_title: str = CONFIRM_DIALOG_TITLE
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menu_actions","title":"excluded_menu_actions: Tuple[Tuple[str, str]] = ((MENU_FILE, ACTION_SAVE), (MENU_FILE, ACTION_SAVE_AS))
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menus","title":"excluded_menus: Tuple[str] = ()
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_toolbar_actions","title":"excluded_toolbar_actions: Tuple[str] = (ACTION_SAVE, ACTION_SAVE_AS)
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.file_filters","title":"file_filters: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_mode","title":"line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_width","title":"line_wrap_width: int = LINE_WRAP_WIDTH
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.start_dir","title":"start_dir: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_family","title":"text_font_family: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_size","title":"text_font_size: Optional[int] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.title","title":"title: str = STANDALONE_EDITOR_TITLE
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_menus","title":"use_default_menus: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_toolbar","title":"use_default_toolbar: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f
"},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.word_wrap_mode","title":"word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.setedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.setedit/#pyguiadapter.widgets.SetEdit","title":"SetEdit
","text":" Bases: PyLiteralEdit
"},{"location":"apis/pyguiadapter.widgets.setedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" set
typing.Set
typing.MutableSet
"},{"location":"apis/pyguiadapter.widgets.slider/","title":"pyguiadapter.widgets.slider","text":""},{"location":"apis/pyguiadapter.widgets.slider/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig","title":"SliderConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
Slider\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\extend\\slider.py
@dataclasses.dataclass(frozen=True)\nclass SliderConfig(CommonParameterWidgetConfig):\n \"\"\"Slider\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[int] = 0\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n min_value: int = 0\n \"\"\"\u6700\u5c0f\u503c\"\"\"\n\n max_value: int = 100\n \"\"\"\u6700\u5927\u503c\"\"\"\n\n single_step: int = 1\n \"\"\"\u5355\u6b21\u6ed1\u52a8\u7684\u6b65\u957f\"\"\"\n\n page_step: Optional[int] = None\n \"\"\"PageUp/PageDown\u6309\u952e\u6309\u4e0b\u65f6\u8c03\u6574\u7684\u6b65\u957f\"\"\"\n\n tick_interval: Optional[int] = None\n \"\"\"\u523b\u5ea6\u95f4\u9694\"\"\"\n\n tick_position: TickPosition = TickPosition.TicksBothSides\n \"\"\"\u523b\u5ea6\u4f4d\u7f6e\"\"\"\n\n tracking: bool = True\n \"\"\"\u662f\u5426\u8ddf\u8e2a\u9f20\u6807\"\"\"\n\n inverted_controls: bool = False\n \"\"\"\u662f\u5426\u542f\u7528\u53cd\u8f6c\u63a7\u5236\"\"\"\n\n inverted_appearance: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u53cd\u8f6c\u5916\u89c2\"\"\"\n\n show_value_label: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u503c\u6807\u7b7e\"\"\"\n\n prefix: str = \"\"\n \"\"\"\u503c\u524d\u7f00\"\"\"\n\n suffix: str = \"\"\n \"\"\"\u503c\u540e\u7f00\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"Slider\"]:\n return Slider\n
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.default_value","title":"default_value: Optional[int] = 0
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.inverted_appearance","title":"inverted_appearance: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u53cd\u8f6c\u5916\u89c2
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.inverted_controls","title":"inverted_controls: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u53cd\u8f6c\u63a7\u5236
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.max_value","title":"max_value: int = 100
class-attribute
instance-attribute
","text":"\u6700\u5927\u503c
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.min_value","title":"min_value: int = 0
class-attribute
instance-attribute
","text":"\u6700\u5c0f\u503c
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.page_step","title":"page_step: Optional[int] = None
class-attribute
instance-attribute
","text":"PageUp/PageDown\u6309\u952e\u6309\u4e0b\u65f6\u8c03\u6574\u7684\u6b65\u957f
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.prefix","title":"prefix: str = ''
class-attribute
instance-attribute
","text":"\u503c\u524d\u7f00
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.show_value_label","title":"show_value_label: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u503c\u6807\u7b7e
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.single_step","title":"single_step: int = 1
class-attribute
instance-attribute
","text":"\u5355\u6b21\u6ed1\u52a8\u7684\u6b65\u957f
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.suffix","title":"suffix: str = ''
class-attribute
instance-attribute
","text":"\u503c\u540e\u7f00
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.tick_interval","title":"tick_interval: Optional[int] = None
class-attribute
instance-attribute
","text":"\u523b\u5ea6\u95f4\u9694
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.tick_position","title":"tick_position: TickPosition = TickPosition.TicksBothSides
class-attribute
instance-attribute
","text":"\u523b\u5ea6\u4f4d\u7f6e
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.SliderConfig.tracking","title":"tracking: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u8ddf\u8e2a\u9f20\u6807
"},{"location":"apis/pyguiadapter.widgets.slider/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.Slider","title":"Slider
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.Slider.NoTicks","title":"NoTicks = TickPosition.NoTicks
class-attribute
instance-attribute
","text":"\u523b\u5ea6\u4f4d\u7f6e\uff1a\u4e0d\u663e\u793a\u523b\u5ea6
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.Slider.TickBothSides","title":"TickBothSides = TickPosition.TicksBothSides
class-attribute
instance-attribute
","text":"\u523b\u5ea6\u4f4d\u7f6e\uff1a\u4e24\u4fa7\u663e\u793a\u523b\u5ea6
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.Slider.TicksAbove","title":"TicksAbove = TickPosition.TicksAbove
class-attribute
instance-attribute
","text":"\u523b\u5ea6\u4f4d\u7f6e\uff1a\u4e0a\u65b9\u663e\u793a\u523b\u5ea6
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.Slider.TicksBelow","title":"TicksBelow = TickPosition.TicksBelow
class-attribute
instance-attribute
","text":"\u523b\u5ea6\u4f4d\u7f6e\uff1a\u4e0b\u65b9\u663e\u793a\u523b\u5ea6
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.Slider.TicksLeft","title":"TicksLeft = TickPosition.TicksLeft
class-attribute
instance-attribute
","text":"\u523b\u5ea6\u4f4d\u7f6e\uff1a\u5de6\u4fa7\u663e\u793a\u523b\u5ea6
"},{"location":"apis/pyguiadapter.widgets.slider/#pyguiadapter.widgets.Slider.TicksRight","title":"TicksRight = TickPosition.TicksRight
class-attribute
instance-attribute
","text":"\u523b\u5ea6\u4f4d\u7f6e\uff1a\u53f3\u4fa7\u663e\u793a\u523b\u5ea6
"},{"location":"apis/pyguiadapter.widgets.slider/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" int_slider_t
"},{"location":"apis/pyguiadapter.widgets.stringlist/","title":"pyguiadapter.widgets.stringlist","text":""},{"location":"apis/pyguiadapter.widgets.stringlist/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig","title":"StringListEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
StringListEdit\u7684\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\widgets\\extend\\stringlist.py
@dataclasses.dataclass(frozen=True)\nclass StringListEditConfig(CommonParameterWidgetConfig):\n \"\"\"StringListEdit\u7684\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n default_value: Optional[List[str]] = dataclasses.field(default_factory=list)\n \"\"\"\u9ed8\u8ba4\u503c\"\"\"\n\n empty_string_strategy: Literal[\"keep_all\", \"keep_one\", \"remove_all\"] = \"remove_all\"\n \"\"\"\u5bf9\u5f85\u5217\u8868\u4e2d\u7a7a\u5b57\u7b26\u4e32\u7684\u7b56\u7565\uff0ckeep_all\u8868\u793a\u4fdd\u7559\u6240\u6709\u7a7a\u5b57\u7b26\u4e32\uff0ckeep_one\u8868\u793a\u53ea\u4fdd\u7559\u7b2c\u4e00\u4e2a\u7a7a\u5b57\u7b26\u4e32\uff0cremove_all\u8868\u793a\u5220\u9664\u6240\u6709\u7a7a\u5b57\u7b26\u4e32\"\"\"\n\n add_file: bool = True\n \"\"\"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u529f\u80fd\"\"\"\n\n add_dir: bool = True\n \"\"\"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u5939\u8def\u5f84\u529f\u80fd\"\"\"\n\n file_filters: str = \"\"\n \"\"\"\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u7528\u4e8e\u6587\u4ef6\u5bf9\u8bdd\u6846\"\"\"\n\n start_dir: str = \"\"\n \"\"\"\u8d77\u59cb\u8def\u5f84\uff0c\u7528\u4e8e\u6587\u4ef6\u5bf9\u8bdd\u6846\"\"\"\n\n normalize_path: bool = True\n \"\"\"\u662f\u5426\u5c06\u8def\u5f84\u89c4\u8303\u5316\"\"\"\n\n add_button_text: str = \"Add\"\n \"\"\"\u6dfb\u52a0\u6309\u94ae\u6587\u672c\"\"\"\n\n remove_button_text: str = \"Remove\"\n \"\"\"\u79fb\u9664\u6309\u94ae\u6587\u672c\"\"\"\n\n clear_button_text: str = \"Clear\"\n \"\"\"\u6e05\u7a7a\u6309\u94ae\u6587\u672c\"\"\"\n\n add_string_hint: str = \"Add Text\"\n \"\"\"\u6dfb\u52a0\u5b57\u7b26\u4e32\u7684\u63d0\u793a\"\"\"\n\n add_file_hint: str = \"Add File\"\n \"\"\"\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u7684\u63d0\u793a\"\"\"\n\n add_dir_hint: str = \"Add Directory\"\n \"\"\"\u6dfb\u52a0\u6587\u4ef6\u5939\u8def\u5f84\u7684\u63d0\u793a\"\"\"\n\n file_dialog_title: str = \"Select File\"\n \"\"\"\u6dfb\u52a0\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n dir_dialog_title: str = \"Select Directory\"\n \"\"\"\u6dfb\u52a0\u6587\u4ef6\u5939\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_dialog_title: str = \"Confirm\"\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n warning_dialog_title: str = \"Warning\"\n \"\"\"\u8b66\u544a\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_remove: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u79fb\u9664\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n confirm_clear: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u6e05\u7a7a\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n remove_confirm_message: str = \"Are you sure to remove the selected item?\"\n \"\"\"\u79fb\u9664\u786e\u8ba4\u5bf9\u8bdd\u6846\u6d88\u606f\"\"\"\n\n clear_confirm_message: str = \"Are you sure to remove all items?\"\n \"\"\"\u6e05\u7a7a\u786e\u8ba4\u5bf9\u8bdd\u6846\u6d88\u606f\"\"\"\n\n no_selection_message: str = \"No items are selected!\"\n \"\"\"\u672a\u9009\u62e9\u4efb\u4f55\u9879\u7684\u63d0\u793a\"\"\"\n\n drag_enabled: bool = True\n \"\"\"\u662f\u5426\u5141\u8bb8\u62d6\u62fd\"\"\"\n\n wrapping: bool = False\n \"\"\"\u662f\u5426\u5141\u8bb8\u6362\u884c\"\"\"\n\n text_elide_mode: Optional[TextElideMode] = TextElideMode.ElideNone\n \"\"\"\u6587\u672c\u7701\u7565\u6a21\u5f0f\"\"\"\n\n alternating_row_colors: bool = True\n \"\"\"\u662f\u5426\u4f7f\u7528\u4ea4\u66ff\u884c\u989c\u8272\"\"\"\n\n width: Optional[int] = None\n \"\"\"\u8868\u683c\u7684\u6700\u5c0f\u5bbd\u5ea6\"\"\"\n\n height: Optional[int] = 230\n \"\"\"\u8868\u683c\u7684\u6700\u5c0f\u9ad8\u5ea6\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"StringListEdit\"]:\n return StringListEdit\n
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.add_button_text","title":"add_button_text: str = 'Add'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.add_dir","title":"add_dir: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u5939\u8def\u5f84\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.add_dir_hint","title":"add_dir_hint: str = 'Add Directory'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6587\u4ef6\u5939\u8def\u5f84\u7684\u63d0\u793a
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.add_file","title":"add_file: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f00\u542f\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u529f\u80fd
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.add_file_hint","title":"add_file_hint: str = 'Add File'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6587\u4ef6\u8def\u5f84\u7684\u63d0\u793a
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.add_string_hint","title":"add_string_hint: str = 'Add Text'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u5b57\u7b26\u4e32\u7684\u63d0\u793a
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.alternating_row_colors","title":"alternating_row_colors: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7f\u7528\u4ea4\u66ff\u884c\u989c\u8272
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.clear_button_text","title":"clear_button_text: str = 'Clear'
class-attribute
instance-attribute
","text":"\u6e05\u7a7a\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.clear_confirm_message","title":"clear_confirm_message: str = 'Are you sure to remove all items?'
class-attribute
instance-attribute
","text":"\u6e05\u7a7a\u786e\u8ba4\u5bf9\u8bdd\u6846\u6d88\u606f
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.confirm_clear","title":"confirm_clear: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u7a7a\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.confirm_dialog_title","title":"confirm_dialog_title: str = 'Confirm'
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.confirm_remove","title":"confirm_remove: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u79fb\u9664\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.default_value","title":"default_value: Optional[List[str]] = dataclasses.field(default_factory=list)
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.dir_dialog_title","title":"dir_dialog_title: str = 'Select Directory'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6587\u4ef6\u5939\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.drag_enabled","title":"drag_enabled: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5141\u8bb8\u62d6\u62fd
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.empty_string_strategy","title":"empty_string_strategy: Literal['keep_all', 'keep_one', 'remove_all'] = 'remove_all'
class-attribute
instance-attribute
","text":"\u5bf9\u5f85\u5217\u8868\u4e2d\u7a7a\u5b57\u7b26\u4e32\u7684\u7b56\u7565\uff0ckeep_all\u8868\u793a\u4fdd\u7559\u6240\u6709\u7a7a\u5b57\u7b26\u4e32\uff0ckeep_one\u8868\u793a\u53ea\u4fdd\u7559\u7b2c\u4e00\u4e2a\u7a7a\u5b57\u7b26\u4e32\uff0cremove_all\u8868\u793a\u5220\u9664\u6240\u6709\u7a7a\u5b57\u7b26\u4e32
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.file_dialog_title","title":"file_dialog_title: str = 'Select File'
class-attribute
instance-attribute
","text":"\u6dfb\u52a0\u6587\u4ef6\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.file_filters","title":"file_filters: str = ''
class-attribute
instance-attribute
","text":"\u6587\u4ef6\u8fc7\u6ee4\u5668\uff0c\u7528\u4e8e\u6587\u4ef6\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.height","title":"height: Optional[int] = 230
class-attribute
instance-attribute
","text":"\u8868\u683c\u7684\u6700\u5c0f\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.no_selection_message","title":"no_selection_message: str = 'No items are selected!'
class-attribute
instance-attribute
","text":"\u672a\u9009\u62e9\u4efb\u4f55\u9879\u7684\u63d0\u793a
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.normalize_path","title":"normalize_path: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u8def\u5f84\u89c4\u8303\u5316
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.remove_button_text","title":"remove_button_text: str = 'Remove'
class-attribute
instance-attribute
","text":"\u79fb\u9664\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.remove_confirm_message","title":"remove_confirm_message: str = 'Are you sure to remove the selected item?'
class-attribute
instance-attribute
","text":"\u79fb\u9664\u786e\u8ba4\u5bf9\u8bdd\u6846\u6d88\u606f
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.start_dir","title":"start_dir: str = ''
class-attribute
instance-attribute
","text":"\u8d77\u59cb\u8def\u5f84\uff0c\u7528\u4e8e\u6587\u4ef6\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.text_elide_mode","title":"text_elide_mode: Optional[TextElideMode] = TextElideMode.ElideNone
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.warning_dialog_title","title":"warning_dialog_title: str = 'Warning'
class-attribute
instance-attribute
","text":"\u8b66\u544a\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"\u8868\u683c\u7684\u6700\u5c0f\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEditConfig.wrapping","title":"wrapping: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5141\u8bb8\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.stringlist/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEdit","title":"StringListEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEdit.ElideLeft","title":"ElideLeft = TextElideMode.ElideLeft
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u7701\u7565\u5de6\u8fb9
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEdit.ElideMiddle","title":"ElideMiddle = TextElideMode.ElideMiddle
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u7701\u7565\u4e2d\u95f4
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEdit.ElideNone","title":"ElideNone = TextElideMode.ElideNone
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u4e0d\u7701\u7565
"},{"location":"apis/pyguiadapter.widgets.stringlist/#pyguiadapter.widgets.StringListEdit.ElideRight","title":"ElideRight = TextElideMode.ElideRight
class-attribute
instance-attribute
","text":"\u6587\u672c\u7701\u7565\u6a21\u5f0f\uff1a\u7701\u7565\u53f3\u8fb9
"},{"location":"apis/pyguiadapter.widgets.stringlist/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" string_list_t
"},{"location":"apis/pyguiadapter.widgets.textedit/","title":"pyguiadapter.widgets.textedit","text":""},{"location":"apis/pyguiadapter.widgets.textedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig","title":"TextEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
TextEdit\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\extend\\textedit.py
@dataclasses.dataclass(frozen=True)\nclass TextEditConfig(CommonParameterWidgetConfig):\n \"\"\"TextEdit\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[str] = \"\"\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n placeholder: str = \"\"\n \"\"\"\u63a7\u4ef6\u7684\u5360\u4f4d\u7b26\"\"\"\n\n accept_rich_text: bool = False\n \"\"\"\u662f\u5426\u63a5\u53d7\u5bcc\u6587\u672c\"\"\"\n\n auto_formatting: Optional[AutoFormatting] = None\n \"\"\"\u662f\u5426\u81ea\u52a8\u683c\u5f0f\u5316\"\"\"\n\n line_wrap_mode: LineWrapMode = LineWrapMode.WidgetWidth\n \"\"\"\u81ea\u52a8\u6362\u884c\u6a21\u5f0f\"\"\"\n\n line_wrap_width: int = 88\n \"\"\"\u81ea\u52a8\u6362\u884c\u5bbd\u5ea6\"\"\"\n\n word_wrap_mode: Optional[WrapMode] = None\n \"\"\"\u5355\u8bcd\u6362\u884c\u6a21\u5f0f\"\"\"\n\n height: Optional[int] = 200\n \"\"\"\u63a7\u4ef6\u9ad8\u5ea6\"\"\"\n\n width: Optional[int] = None\n \"\"\"\u63a7\u4ef6\u5bbd\u5ea6\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"TextEdit\"]:\n return TextEdit\n
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig.accept_rich_text","title":"accept_rich_text: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u63a5\u53d7\u5bcc\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig.auto_formatting","title":"auto_formatting: Optional[AutoFormatting] = None
class-attribute
instance-attribute
","text":"\u662f\u5426\u81ea\u52a8\u683c\u5f0f\u5316
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig.default_value","title":"default_value: Optional[str] = ''
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig.height","title":"height: Optional[int] = 200
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig.line_wrap_mode","title":"line_wrap_mode: LineWrapMode = LineWrapMode.WidgetWidth
class-attribute
instance-attribute
","text":"\u81ea\u52a8\u6362\u884c\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig.line_wrap_width","title":"line_wrap_width: int = 88
class-attribute
instance-attribute
","text":"\u81ea\u52a8\u6362\u884c\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig.placeholder","title":"placeholder: str = ''
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u5360\u4f4d\u7b26
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEditConfig.word_wrap_mode","title":"word_wrap_mode: Optional[WrapMode] = None
class-attribute
instance-attribute
","text":"\u5355\u8bcd\u6362\u884c\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.textedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit","title":"TextEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit.FixedColumnWidth","title":"FixedColumnWidth = LineWrapMode.FixedColumnWidth
class-attribute
instance-attribute
","text":"\u6362\u884c\u6a21\u5f0f\uff1a\u56fa\u5b9a\u5217\u5bbd\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit.FixedPixelWidth","title":"FixedPixelWidth = LineWrapMode.FixedPixelWidth
class-attribute
instance-attribute
","text":"\u6362\u884c\u6a21\u5f0f\uff1a\u56fa\u5b9a\u50cf\u7d20\u5bbd\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit.ManualWordWrap","title":"ManualWordWrap = WrapMode.ManualWrap
class-attribute
instance-attribute
","text":"\u5355\u8bcd\u6362\u884c\u6a21\u5f0f\uff1a\u624b\u52a8\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit.NoLineWrap","title":"NoLineWrap = LineWrapMode.NoWrap
class-attribute
instance-attribute
","text":"\u6362\u884c\u6a21\u5f0f\uff1a\u4e0d\u81ea\u52a8\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit.NoWordWrap","title":"NoWordWrap = WrapMode.NoWrap
class-attribute
instance-attribute
","text":"\u5355\u8bcd\u6362\u884c\u6a21\u5f0f\uff1a\u4e0d\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit.WidgetWidth","title":"WidgetWidth = LineWrapMode.WidgetWidth
class-attribute
instance-attribute
","text":"\u6362\u884c\u6a21\u5f0f\uff1a\u6839\u636e\u63a7\u4ef6\u5bbd\u5ea6\u81ea\u52a8\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit.WordWrap","title":"WordWrap = WrapMode.WordWrap
class-attribute
instance-attribute
","text":"\u5355\u8bcd\u6362\u884c\u6a21\u5f0f\uff1a\u6839\u636e\u5355\u8bcd\u81ea\u52a8\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit.WordWrapAnywhere","title":"WordWrapAnywhere = WrapMode.WrapAnywhere
class-attribute
instance-attribute
","text":"\u5355\u8bcd\u6362\u884c\u6a21\u5f0f\uff1a\u4efb\u610f\u4f4d\u7f6e\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.textedit/#pyguiadapter.widgets.TextEdit.WordWrapAtWordBoundaryOrAnywhere","title":"WordWrapAtWordBoundaryOrAnywhere = WrapMode.WrapAtWordBoundaryOrAnywhere
class-attribute
instance-attribute
","text":"\u5355\u8bcd\u6362\u884c\u6a21\u5f0f\uff1a\u5355\u8bcd\u8fb9\u754c\u6216\u4efb\u610f\u4f4d\u7f6e\u6362\u884c
"},{"location":"apis/pyguiadapter.widgets.textedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" text_t
"},{"location":"apis/pyguiadapter.widgets.timeedit/","title":"pyguiadapter.widgets.timeedit","text":""},{"location":"apis/pyguiadapter.widgets.timeedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEditConfig","title":"TimeEditConfig
dataclass
","text":" Bases: CommonParameterWidgetConfig
TimeEdit\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\timeedit.py
@dataclasses.dataclass(frozen=True)\nclass TimeEditConfig(CommonParameterWidgetConfig):\n \"\"\"TimeEdit\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Union[time, QTime, None] = datetime.now().time()\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n min_time: Union[time, QTime, None] = None\n \"\"\"\u63a7\u4ef6\u7684\u6700\u5c0f\u65f6\u95f4\u503c\"\"\"\n\n max_time: Union[time, QTime, None] = None\n \"\"\"\u63a7\u4ef6\u7684\u6700\u5927\u65f6\u95f4\u503c\"\"\"\n\n display_format: Optional[str] = None\n \"\"\"\u65e5\u671f\u7684\u663e\u793a\u683c\u5f0f\uff0c\u53ef\u4ee5\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863\uff1a\n [displayFormat](https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/QDateTimeEdit.html#PySide2.QtWidgets.PySide2.QtWidgets.QDateTimeEdit.displayFormat)\n \"\"\"\n\n time_spec: Optional[TimeSpec] = None\n \"\"\"\u65f6\u95f4\u65e5\u671f\u6807\u51c6\uff0c\u53ef\u4ee5\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863:\n [TimeSpec](https://doc.qt.io/qtforpython-5/PySide2/QtCore/Qt.html#PySide2.QtCore.PySide2.QtCore.Qt.TimeSpec)\n \"\"\"\n\n alignment: Alignment = Qt.AlignLeft | Qt.AlignVCenter\n \"\"\"\u5bf9\u9f50\u65b9\u5f0f\uff0c\u53ef\u9009\u503c\u6709\uff1aAlignLeft\u3001AlignRight\u3001AlignCenter\u3001AlignJustify\u7b49\u3002\"\"\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"TimeEdit\"]:\n return TimeEdit\n
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEditConfig.alignment","title":"alignment: Alignment = Qt.AlignLeft | Qt.AlignVCenter
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff0c\u53ef\u9009\u503c\u6709\uff1aAlignLeft\u3001AlignRight\u3001AlignCenter\u3001AlignJustify\u7b49\u3002
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEditConfig.default_value","title":"default_value: Union[time, QTime, None] = datetime.now().time()
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEditConfig.display_format","title":"display_format: Optional[str] = None
class-attribute
instance-attribute
","text":"\u65e5\u671f\u7684\u663e\u793a\u683c\u5f0f\uff0c\u53ef\u4ee5\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863\uff1a displayFormat
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEditConfig.max_time","title":"max_time: Union[time, QTime, None] = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u6700\u5927\u65f6\u95f4\u503c
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEditConfig.min_time","title":"min_time: Union[time, QTime, None] = None
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u6700\u5c0f\u65f6\u95f4\u503c
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEditConfig.time_spec","title":"time_spec: Optional[TimeSpec] = None
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u6807\u51c6\uff0c\u53ef\u4ee5\u53c2\u8003Qt\u5b98\u65b9\u6587\u6863: TimeSpec
"},{"location":"apis/pyguiadapter.widgets.timeedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEdit","title":"TimeEdit
","text":" Bases: CommonParameterWidget
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEdit.AlignCenter","title":"AlignCenter = Qt.AlignCenter
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u5c45\u4e2d\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEdit.AlignJustify","title":"AlignJustify = Qt.AlignJustify
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u4e24\u7aef\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEdit.AlignLeft","title":"AlignLeft = Qt.AlignLeft
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u5de6\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEdit.AlignRight","title":"AlignRight = Qt.AlignRight
class-attribute
instance-attribute
","text":"\u5bf9\u9f50\u65b9\u5f0f\uff1a\u53f3\u5bf9\u9f50
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEdit.LocalTime","title":"LocalTime = Qt.LocalTime
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1a\u672c\u5730\u65f6\u95f4
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEdit.OffsetFromUTC","title":"OffsetFromUTC = Qt.OffsetFromUTC
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1aOffsetFromUTC
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEdit.TimeZone","title":"TimeZone = Qt.TimeZone
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1aTimeZone
"},{"location":"apis/pyguiadapter.widgets.timeedit/#pyguiadapter.widgets.TimeEdit.UTC","title":"UTC = Qt.UTC
class-attribute
instance-attribute
","text":"\u65f6\u95f4\u65e5\u671f\u7684\u6807\u51c6\uff1aUTC
"},{"location":"apis/pyguiadapter.widgets.timeedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" datetime.time
"},{"location":"apis/pyguiadapter.widgets.tupleedit/","title":"pyguiadapter.widgets.tupleedit","text":""},{"location":"apis/pyguiadapter.widgets.tupleedit/#_1","title":"\u63a7\u4ef6\u914d\u7f6e\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.TupleEditConfig","title":"TupleEditConfig
dataclass
","text":" Bases: PyLiteralEditConfig
TupleEdit\u7684\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\tupleedit.py
@dataclasses.dataclass(frozen=True)\nclass TupleEditConfig(PyLiteralEditConfig):\n \"\"\"TupleEdit\u7684\u914d\u7f6e\u7c7b\"\"\"\n\n default_value: Optional[tuple] = ()\n \"\"\"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c\"\"\"\n\n height: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6\"\"\"\n\n width: Optional[int] = None\n \"\"\"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6\"\"\"\n\n standalone_editor: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668\"\"\"\n\n standalone_editor_button_text: str = \"Edit Tuple\"\n \"\"\"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c\"\"\"\n\n standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(\n default_factory=StandaloneCodeEditorConfig\n )\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\"\"\"\n\n initial_text: str = \"()\"\n\n @classmethod\n def target_widget_class(cls) -> Type[\"TupleEdit\"]:\n return TupleEdit\n
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.TupleEditConfig.default_value","title":"default_value: Optional[tuple] = ()
class-attribute
instance-attribute
","text":"\u63a7\u4ef6\u7684\u9ed8\u8ba4\u503c
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.TupleEditConfig.height","title":"height: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u9ad8\u5ea6
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.TupleEditConfig.standalone_editor","title":"standalone_editor: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u72ec\u7acb\uff08standalone\uff09\u4ee3\u7801\u7f16\u8f91\u5668
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.TupleEditConfig.standalone_editor_button_text","title":"standalone_editor_button_text: str = 'Edit Tuple'
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u542f\u52a8\u6309\u94ae\u6587\u672c
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.TupleEditConfig.standalone_editor_config","title":"standalone_editor_config: StandaloneCodeEditorConfig = dataclasses.field(default_factory=StandaloneCodeEditorConfig)
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u914d\u7f6e
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.TupleEditConfig.width","title":"width: Optional[int] = None
class-attribute
instance-attribute
","text":"inplace\u7f16\u8f91\u5668\u7684\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig","title":"StandaloneCodeEditorConfig
dataclass
","text":" Bases: object
standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b
Source code in pyguiadapter\\widgets\\basic\\base.py
@dataclasses.dataclass\nclass StandaloneCodeEditorConfig(object):\n \"\"\"standalone\u7f16\u8f91\u5668\u914d\u7f6e\u7c7b\"\"\"\n\n title: str = STANDALONE_EDITOR_TITLE\n \"\"\"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898\"\"\"\n\n text_font_family: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\"\"\"\n\n text_font_size: Optional[int] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f\"\"\"\n\n line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n line_wrap_width: int = LINE_WRAP_WIDTH\n \"\"\"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6\"\"\"\n\n word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap\n \"\"\"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f\"\"\"\n\n file_filters: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668\"\"\"\n\n start_dir: Optional[str] = None\n \"\"\"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55\"\"\"\n\n use_default_menus: bool = True\n \"\"\"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f\"\"\"\n\n excluded_menus: Tuple[str] = ()\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\"\"\"\n\n excluded_menu_actions: Tuple[Tuple[str, str]] = (\n (MENU_FILE, ACTION_SAVE),\n (MENU_FILE, ACTION_SAVE_AS),\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879\"\"\"\n\n use_default_toolbar: bool = True\n \"\"\"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f\"\"\"\n\n excluded_toolbar_actions: Tuple[str] = (\n ACTION_SAVE,\n ACTION_SAVE_AS,\n )\n \"\"\"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879\"\"\"\n\n confirm_dialog: bool = True\n \"\"\"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846\"\"\"\n\n confirm_dialog_title: str = CONFIRM_DIALOG_TITLE\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898\"\"\"\n\n confirm_dialog_message: str = CONFIRM_MSG\n \"\"\"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9\"\"\"\n
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog","title":"confirm_dialog: bool = True
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u9000\u51fa\u65f6\u662f\u5426\u663e\u793a\u786e\u8ba4\u5bf9\u8bdd\u6846
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_message","title":"confirm_dialog_message: str = CONFIRM_MSG
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u663e\u793a\u7684\u5185\u5bb9
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.confirm_dialog_title","title":"confirm_dialog_title: str = CONFIRM_DIALOG_TITLE
class-attribute
instance-attribute
","text":"\u786e\u8ba4\u5bf9\u8bdd\u6846\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menu_actions","title":"excluded_menu_actions: Tuple[Tuple[str, str]] = ((MENU_FILE, ACTION_SAVE), (MENU_FILE, ACTION_SAVE_AS))
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355\u9879
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_menus","title":"excluded_menus: Tuple[str] = ()
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u83dc\u5355
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.excluded_toolbar_actions","title":"excluded_toolbar_actions: Tuple[str] = (ACTION_SAVE, ACTION_SAVE_AS)
class-attribute
instance-attribute
","text":"\u7981\u7528\u7684\u9ed8\u8ba4\u5de5\u5177\u680f\u9879
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.file_filters","title":"file_filters: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u6587\u4ef6\u8fc7\u6ee4\u5668
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_mode","title":"line_wrap_mode: LineWrapMode = LineWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.line_wrap_width","title":"line_wrap_width: int = LINE_WRAP_WIDTH
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u884c\u6298\u53e0\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.start_dir","title":"start_dir: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u6587\u4ef6\u5bf9\u8bdd\u6846\u7684\u8d77\u59cb\u76ee\u5f55
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_family","title":"text_font_family: Optional[str] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.text_font_size","title":"text_font_size: Optional[int] = None
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.title","title":"title: str = STANDALONE_EDITOR_TITLE
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u7a97\u53e3\u6807\u9898
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_menus","title":"use_default_menus: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7f\u7528\u9ed8\u8ba4\u83dc\u5355\u680f
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.use_default_toolbar","title":"use_default_toolbar: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u9ed8\u8ba4\u5de5\u5177\u680f
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.StandaloneCodeEditorConfig.word_wrap_mode","title":"word_wrap_mode: WordWrapMode = WordWrapMode.NoWrap
class-attribute
instance-attribute
","text":"standalone\u7f16\u8f91\u5668\u5b57\u8bcd\u6298\u53e0\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#_2","title":"\u63a7\u4ef6\u7c7b","text":""},{"location":"apis/pyguiadapter.widgets.tupleedit/#pyguiadapter.widgets.TupleEdit","title":"TupleEdit
","text":" Bases: PyLiteralEdit
"},{"location":"apis/pyguiadapter.widgets.tupleedit/#_3","title":"\u5bf9\u5e94\u53c2\u6570\u6570\u636e\u7c7b\u578b","text":" tuple
typing.Tuple
"},{"location":"apis/pyguiadapter.window/","title":"pyguiadapter.window","text":""},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig","title":"BaseWindowConfig
dataclass
","text":" Bases: object
Source code in pyguiadapter\\window.py
@dataclasses.dataclass(frozen=True)\nclass BaseWindowConfig(object):\n title: str = \"\"\n \"\"\"\u7a97\u53e3\u6807\u9898\"\"\"\n\n icon: IconType = None\n \"\"\"\u7a97\u53e3\u56fe\u6807\"\"\"\n\n size: Union[Tuple[int, int], QSize] = (800, 600)\n \"\"\"\u7a97\u53e3\u5927\u5c0f\"\"\"\n\n position: Optional[Tuple[int, int]] = None\n \"\"\"\u7a97\u53e3\u4f4d\u7f6e\"\"\"\n\n always_on_top: bool = False\n \"\"\"\u7a97\u53e3\u662f\u5426\u6c38\u8fdc\u7f6e\u9876\"\"\"\n\n font_family: Union[str, Sequence[str], None] = None\n \"\"\"\u7a97\u53e3\u4f7f\u7528\u7684\u5b57\u4f53\"\"\"\n\n font_size: Optional[int] = None\n \"\"\"\u7a97\u53e3\u5b57\u4f53\u7684\u5927\u5c0f\uff08px\uff09\"\"\"\n\n close_button: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u5173\u95ed\u6309\u94ae\"\"\"\n\n minimize_button: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u6700\u5c0f\u5316\u6309\u94ae\"\"\"\n\n maximize_button: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u6700\u5927\u5316\u6309\u94ae\"\"\"\n\n stylesheet: Optional[str] = None\n \"\"\"\u7a97\u53e3\u7684\u6837\u5f0f\u8868\uff08QSS\u683c\u5f0f\uff09\"\"\"\n
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.always_on_top","title":"always_on_top: bool = False
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u662f\u5426\u6c38\u8fdc\u7f6e\u9876
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.close_button","title":"close_button: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u5173\u95ed\u6309\u94ae
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.font_family","title":"font_family: Union[str, Sequence[str], None] = None
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u4f7f\u7528\u7684\u5b57\u4f53
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.font_size","title":"font_size: Optional[int] = None
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u5b57\u4f53\u7684\u5927\u5c0f\uff08px\uff09
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.icon","title":"icon: IconType = None
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u56fe\u6807
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.maximize_button","title":"maximize_button: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6700\u5927\u5316\u6309\u94ae
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.minimize_button","title":"minimize_button: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6700\u5c0f\u5316\u6309\u94ae
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.position","title":"position: Optional[Tuple[int, int]] = None
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u4f4d\u7f6e
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.size","title":"size: Union[Tuple[int, int], QSize] = (800, 600)
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u5927\u5c0f
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.stylesheet","title":"stylesheet: Optional[str] = None
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u7684\u6837\u5f0f\u8868\uff08QSS\u683c\u5f0f\uff09
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowConfig.title","title":"title: str = ''
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u6807\u9898
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowEventListener","title":"BaseWindowEventListener
","text":" Bases: object
\u8be5\u7c7b\u4e3a\u7a97\u53e3\u4e8b\u4ef6\u76d1\u542c\u5668\u57fa\u7c7b\uff0c\u7528\u4e8e\u76d1\u542cBaseWindow
\u7c7b\u7684\u7a97\u53e3\u4e8b\u4ef6\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u5b50\u7c7b\u4e2doverride\u7279\u5b9a\u7684\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u4ee5\u5b9e\u73b0\u5bf9\u7279\u5b9a\u4e8b\u4ef6\u7684\u76d1\u542c
Source code in pyguiadapter\\window.py
class BaseWindowEventListener(object):\n \"\"\"\u8be5\u7c7b\u4e3a\u7a97\u53e3\u4e8b\u4ef6\u76d1\u542c\u5668\u57fa\u7c7b\uff0c\u7528\u4e8e\u76d1\u542c`BaseWindow`\u7c7b\u7684\u7a97\u53e3\u4e8b\u4ef6\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u5b50\u7c7b\u4e2doverride\u7279\u5b9a\u7684\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u4ee5\u5b9e\u73b0\u5bf9\u7279\u5b9a\u4e8b\u4ef6\u7684\u76d1\u542c\"\"\"\n\n def on_create(self, window: \"BaseWindow\") -> None:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u521b\u5efa\u540e\u8c03\u7528\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u65e0\u8fd4\u56de\u503c\n \"\"\"\n pass\n\n # noinspection PyUnusedLocal\n def on_close(self, window: \"BaseWindow\") -> bool:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u5173\u95ed\u65f6\u8c03\u7528\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u8fd4\u56de\u4e00\u4e2a`bool`\u503c\uff0c\u7528\u4e8e\u6307\u793a\u662f\u5426\u8981\u5173\u95ed\u7a97\u53e3\u3002\u8fd4\u56de`True`\u8868\u793a\u786e\u5b9e\u8981\u5173\u95ed\u7a97\u53e3\uff0c\u8fd4\u56de`False`\u5c06\u963b\u6b62\u7a97\u53e3\u88ab\u5173\u95ed\u3002\u9ed8\u8ba4\u8fd4\u56de`True`\u3002\n \"\"\"\n return True\n\n def on_destroy(self, window: \"BaseWindow\") -> None:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u9500\u6bc1\u540e\u8c03\u7528\uff08\u6ce8\u610f\uff1a\u5728\u8be5\u51fd\u6570\u56de\u8c03\u540e\uff0c\u8fd8\u5c06\u56de\u8c03\u4e00\u6b21`on_hide()`\uff09\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u65e0\u8fd4\u56de\u503c\n \"\"\"\n pass\n\n def on_hide(self, window: \"BaseWindow\") -> None:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u88ab\u9690\u85cf\u540e\u8c03\u7528\uff08\u6ce8\u610f\uff1a\u5728`on_destroy()`\u88ab\u56de\u8c03\u540e\uff0c\u6b64\u51fd\u6570\u5c06\u88ab\u56de\u8c03\uff09\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u65e0\u8fd4\u56de\u503c\n \"\"\"\n pass\n\n def on_show(self, window: \"BaseWindow\") -> None:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u663e\u793a\u540e\u8c03\u7528\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u65e0\u8fd4\u56de\u503c\n \"\"\"\n pass\n
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowEventListener.on_close","title":"on_close(window: BaseWindow) -> bool
","text":"\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u5173\u95ed\u65f6\u8c03\u7528\u3002
Parameters:
Name Type Description Default window
BaseWindow
\u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3
required Returns:
Type Description bool
\u8fd4\u56de\u4e00\u4e2abool
\u503c\uff0c\u7528\u4e8e\u6307\u793a\u662f\u5426\u8981\u5173\u95ed\u7a97\u53e3\u3002\u8fd4\u56deTrue
\u8868\u793a\u786e\u5b9e\u8981\u5173\u95ed\u7a97\u53e3\uff0c\u8fd4\u56deFalse
\u5c06\u963b\u6b62\u7a97\u53e3\u88ab\u5173\u95ed\u3002\u9ed8\u8ba4\u8fd4\u56deTrue
\u3002
Source code in pyguiadapter\\window.py
def on_close(self, window: \"BaseWindow\") -> bool:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u5173\u95ed\u65f6\u8c03\u7528\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u8fd4\u56de\u4e00\u4e2a`bool`\u503c\uff0c\u7528\u4e8e\u6307\u793a\u662f\u5426\u8981\u5173\u95ed\u7a97\u53e3\u3002\u8fd4\u56de`True`\u8868\u793a\u786e\u5b9e\u8981\u5173\u95ed\u7a97\u53e3\uff0c\u8fd4\u56de`False`\u5c06\u963b\u6b62\u7a97\u53e3\u88ab\u5173\u95ed\u3002\u9ed8\u8ba4\u8fd4\u56de`True`\u3002\n \"\"\"\n return True\n
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowEventListener.on_create","title":"on_create(window: BaseWindow) -> None
","text":"\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u521b\u5efa\u540e\u8c03\u7528\u3002
Parameters:
Name Type Description Default window
BaseWindow
\u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Source code in pyguiadapter\\window.py
def on_create(self, window: \"BaseWindow\") -> None:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u521b\u5efa\u540e\u8c03\u7528\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u65e0\u8fd4\u56de\u503c\n \"\"\"\n pass\n
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowEventListener.on_destroy","title":"on_destroy(window: BaseWindow) -> None
","text":"\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u9500\u6bc1\u540e\u8c03\u7528\uff08\u6ce8\u610f\uff1a\u5728\u8be5\u51fd\u6570\u56de\u8c03\u540e\uff0c\u8fd8\u5c06\u56de\u8c03\u4e00\u6b21on_hide()
\uff09\u3002
Parameters:
Name Type Description Default window
BaseWindow
\u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Source code in pyguiadapter\\window.py
def on_destroy(self, window: \"BaseWindow\") -> None:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u9500\u6bc1\u540e\u8c03\u7528\uff08\u6ce8\u610f\uff1a\u5728\u8be5\u51fd\u6570\u56de\u8c03\u540e\uff0c\u8fd8\u5c06\u56de\u8c03\u4e00\u6b21`on_hide()`\uff09\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u65e0\u8fd4\u56de\u503c\n \"\"\"\n pass\n
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowEventListener.on_hide","title":"on_hide(window: BaseWindow) -> None
","text":"\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u88ab\u9690\u85cf\u540e\u8c03\u7528\uff08\u6ce8\u610f\uff1a\u5728on_destroy()
\u88ab\u56de\u8c03\u540e\uff0c\u6b64\u51fd\u6570\u5c06\u88ab\u56de\u8c03\uff09\u3002
Parameters:
Name Type Description Default window
BaseWindow
\u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Source code in pyguiadapter\\window.py
def on_hide(self, window: \"BaseWindow\") -> None:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u88ab\u9690\u85cf\u540e\u8c03\u7528\uff08\u6ce8\u610f\uff1a\u5728`on_destroy()`\u88ab\u56de\u8c03\u540e\uff0c\u6b64\u51fd\u6570\u5c06\u88ab\u56de\u8c03\uff09\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u65e0\u8fd4\u56de\u503c\n \"\"\"\n pass\n
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindowEventListener.on_show","title":"on_show(window: BaseWindow) -> None
","text":"\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u663e\u793a\u540e\u8c03\u7528\u3002
Parameters:
Name Type Description Default window
BaseWindow
\u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Source code in pyguiadapter\\window.py
def on_show(self, window: \"BaseWindow\") -> None:\n \"\"\"\n \u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\uff0c\u5728\u7a97\u53e3\u663e\u793a\u540e\u8c03\u7528\u3002\n\n Args:\n window: \u53d1\u751f\u4e8b\u4ef6\u7684\u7a97\u53e3\n\n Returns:\n \u65e0\u8fd4\u56de\u503c\n \"\"\"\n pass\n
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.SimpleWindowEventListener","title":"SimpleWindowEventListener
","text":" Bases: BaseWindowEventListener
\u8be5\u7c7b\u4e3aBaseWindowEventListener
\u5b50\u7c7b\uff0c\u7528\u4e8e\u5feb\u901f\u521b\u5efaBaseWindowEventListener
\u5b9e\u4f8b\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u76f4\u63a5\u5728\u6784\u9020\u51fd\u6570\u4e2d\u4f20\u5165\u8981\u76d1\u542c\u7684\u4e8b\u4ef6\u7684\u56de\u8c03\u51fd\u6570\uff0c \u800c\u4e0d\u5fc5\u624b\u52a8\u521b\u5efaBaseWindowEventListener
\u7684\u5b50\u7c7b\u3002
Source code in pyguiadapter\\window.py
class SimpleWindowEventListener(BaseWindowEventListener):\n \"\"\"\u8be5\u7c7b\u4e3a`BaseWindowEventListener`\u5b50\u7c7b\uff0c\u7528\u4e8e\u5feb\u901f\u521b\u5efa`BaseWindowEventListener`\u5b9e\u4f8b\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u76f4\u63a5\u5728\u6784\u9020\u51fd\u6570\u4e2d\u4f20\u5165\u8981\u76d1\u542c\u7684\u4e8b\u4ef6\u7684\u56de\u8c03\u51fd\u6570\uff0c\n \u800c\u4e0d\u5fc5\u624b\u52a8\u521b\u5efa`BaseWindowEventListener`\u7684\u5b50\u7c7b\u3002\n \"\"\"\n\n def __init__(\n self,\n on_create: Callable[[\"BaseWindow\"], None] = None,\n on_show: Callable[[\"BaseWindow\"], None] = None,\n on_hide: Callable[[\"BaseWindow\"], None] = None,\n on_close: Callable[[\"BaseWindow\"], bool] = None,\n on_destroy: Callable[[\"BaseWindow\"], None] = None,\n ):\n \"\"\"\n \u6784\u9020\u51fd\u6570\u3002\u7528\u4e8e\u521b\u5efa`SimpleWindowEventListener`\u7c7b\u5b9e\u4f8b\u3002\n\n Args:\n on_create: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u521b\u5efa\u540e\u8c03\u7528\u3002\n on_show: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u663e\u793a\u540e\u56de\u8c03\u3002\n on_hide: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u88ab\u9690\u85cf\u65f6\u56de\u8c03\u3002\n on_close: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u88ab\u5173\u95ed\u65f6\u56de\u8c03\u3002\n on_destroy: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u88ab\u9500\u6bc1\u540e\u56de\u8c03\u3002\n \"\"\"\n self._on_create_callback = on_create\n self._on_show_callback = on_show\n self._on_hide_callback = on_hide\n self._on_close_callback = on_close\n self._on_destroy_callback = on_destroy\n\n def on_create(self, window: \"BaseWindow\") -> None:\n if self._on_create_callback:\n return self._on_create_callback(window)\n return super().on_create(window)\n\n def on_close(self, window: \"BaseWindow\") -> bool:\n if self._on_close_callback:\n return self._on_close_callback(window)\n return super().on_close(window)\n\n def on_destroy(self, window: \"BaseWindow\") -> None:\n if self._on_destroy_callback:\n return self._on_destroy_callback(window)\n return super().on_destroy(window)\n\n def on_hide(self, window: \"BaseWindow\") -> None:\n if self._on_hide_callback:\n return self._on_hide_callback(window)\n return super().on_hide(window)\n\n def on_show(self, window: \"BaseWindow\") -> None:\n if self._on_show_callback:\n return self._on_show_callback(window)\n return super().on_show(window)\n
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.SimpleWindowEventListener.__init__","title":"__init__(on_create: Callable[[BaseWindow], None] = None, on_show: Callable[[BaseWindow], None] = None, on_hide: Callable[[BaseWindow], None] = None, on_close: Callable[[BaseWindow], bool] = None, on_destroy: Callable[[BaseWindow], None] = None)
","text":"\u6784\u9020\u51fd\u6570\u3002\u7528\u4e8e\u521b\u5efaSimpleWindowEventListener
\u7c7b\u5b9e\u4f8b\u3002
Parameters:
Name Type Description Default on_create
Callable[[BaseWindow], None]
\u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u521b\u5efa\u540e\u8c03\u7528\u3002
None
on_show
Callable[[BaseWindow], None]
\u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u663e\u793a\u540e\u56de\u8c03\u3002
None
on_hide
Callable[[BaseWindow], None]
\u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u88ab\u9690\u85cf\u65f6\u56de\u8c03\u3002
None
on_close
Callable[[BaseWindow], bool]
\u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u88ab\u5173\u95ed\u65f6\u56de\u8c03\u3002
None
on_destroy
Callable[[BaseWindow], None]
\u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u88ab\u9500\u6bc1\u540e\u56de\u8c03\u3002
None
Source code in pyguiadapter\\window.py
def __init__(\n self,\n on_create: Callable[[\"BaseWindow\"], None] = None,\n on_show: Callable[[\"BaseWindow\"], None] = None,\n on_hide: Callable[[\"BaseWindow\"], None] = None,\n on_close: Callable[[\"BaseWindow\"], bool] = None,\n on_destroy: Callable[[\"BaseWindow\"], None] = None,\n):\n \"\"\"\n \u6784\u9020\u51fd\u6570\u3002\u7528\u4e8e\u521b\u5efa`SimpleWindowEventListener`\u7c7b\u5b9e\u4f8b\u3002\n\n Args:\n on_create: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u521b\u5efa\u540e\u8c03\u7528\u3002\n on_show: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u663e\u793a\u540e\u56de\u8c03\u3002\n on_hide: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u88ab\u9690\u85cf\u65f6\u56de\u8c03\u3002\n on_close: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u88ab\u5173\u95ed\u65f6\u56de\u8c03\u3002\n on_destroy: \u56de\u8c03\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u5728\u7a97\u53e3\u88ab\u9500\u6bc1\u540e\u56de\u8c03\u3002\n \"\"\"\n self._on_create_callback = on_create\n self._on_show_callback = on_show\n self._on_hide_callback = on_hide\n self._on_close_callback = on_close\n self._on_destroy_callback = on_destroy\n
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow","title":"BaseWindow
","text":" Bases: QMainWindow
PyGUIAdapter
\u4e2d\u6240\u6709\u9876\u7ea7\u7a97\u53e3\u7684\u57fa\u7c7b\uff0c\u5b9a\u4e49\u4e86\u7a97\u53e3\u57fa\u672c\u7684\u5916\u89c2\u548c\u903b\u8f91\uff0c\u5e76\u4e14\u5b9e\u73b0\u4e86\u4e00\u4e9b\u516c\u5171\u7684\u65b9\u6cd5\u3002 \u8fd9\u4e9b\u65b9\u6cd5\u53ef\u4ee5\u5728\u7a97\u53e3\u4e8b\u4ef6\u56de\u8c03\u51fd\u6570\u4e2d\u6216\u8005Action
\u7684\u56de\u8c03\u51fd\u6570\u4e2d\u8c03\u7528\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.clear_toasts","title":"clear_toasts() -> None
","text":"\u6e05\u9664\u4e4b\u524d\u53d1\u51fa\u7684toast\u6d88\u606f\u3002
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.get_action_state","title":"get_action_state(action: Action) -> Optional[bool]
","text":"\u68c0\u67e5\u76ee\u6807Action
\u7684\u5f53\u524d\u72b6\u6001
Parameters:
Name Type Description Default action
Action
\u76ee\u6807Action
required Returns:
Type Description Optional[bool]
\u8fd4\u56de\u76ee\u6807Action
\u7684\u5f53\u524d\u72b6\u6001\u3002\u82e5\u672a\u627e\u5230\u76ee\u6807Action
\uff0c\u5219\u8fd4\u56deNone
\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.get_clipboard_text","title":"get_clipboard_text() -> str
staticmethod
","text":"\u83b7\u53d6\u526a\u8d34\u677f\u5185\u5bb9\u3002
Returns:
Type Description str
\u8fd4\u56de\u5f53\u524d\u526a\u8d34\u677f\u6587\u672c\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.get_font_families","title":"get_font_families() -> Sequence[str]
","text":"\u83b7\u53d6\u5f53\u524d\u7a97\u53e3\u5b57\u4f53\u7cfb\u5217\u540d\u79f0\u3002
Returns:
Type Description Sequence[str]
\u8fd4\u56de\u5f53\u524d\u7a97\u53e3\u5b57\u4f53\u7cfb\u5217\u540d\u79f0\uff08\u4ee5\u5217\u8868\u5f62\u5f0f\uff09\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.get_font_family","title":"get_font_family() -> str
","text":"\u83b7\u53d6\u5f53\u524d\u7a97\u53e3\u5b57\u4f53\u7cfb\u5217\u540d\u79f0\u3002
Returns:
Type Description str
\u8fd4\u56de\u5f53\u524d\u7a97\u53e3\u5b57\u4f53\u7cfb\u5217\u540d\u79f0\uff08\u4ee5\u5b57\u7b26\u4e32\u5f62\u5f0f\uff09\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.get_font_size","title":"get_font_size() -> int
","text":"\u83b7\u53d6\u7a97\u53e3\u5b57\u4f53\u5927\u5c0f\uff08px\uff09\u3002
Returns:
Type Description int
\u8fd4\u56de\u5f53\u524d\u7a97\u53e3\u5b57\u4f53\u5927\u5c0f\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.get_position","title":"get_position() -> Tuple[int, int]
","text":"\u83b7\u53d6\u7a97\u53e3\u4f4d\u7f6e\u3002
Returns:
Type Description Tuple[int, int]
\u8fd4\u56de\u7a97\u53e3\u5f53\u524d\u5728\u5c4f\u5e55\u4e0a\u7684\u4f4d\u7f6e\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.get_size","title":"get_size() -> Tuple[int, int]
","text":"\u83b7\u53d6\u7a97\u53e3\u5f53\u524d\u5c3a\u5bf8\u3002
Returns:
Type Description Tuple[int, int]
\u8fd4\u56de\u7a97\u53e3\u5f53\u524d\u5c3a\u5bf8\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.get_stylesheet","title":"get_stylesheet() -> str
","text":"\u83b7\u53d6\u7a97\u53e3\u5f53\u524d\u6837\u5f0f\u8868\u3002
Returns:
Type Description str
\u8fd4\u56de\u7a97\u53e3\u5f53\u524d\u6837\u5f0f\u8868\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.get_title","title":"get_title() -> str
","text":"\u83b7\u53d6\u7a97\u53e3\u6807\u9898\u3002
Returns:
Type Description str
\u8fd4\u56de\u5f53\u524d\u7a97\u53e3\u6807\u9898
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.has_action","title":"has_action(action: Action) -> bool
","text":"\u68c0\u6d4b\u6307\u5b9aAction
\u662f\u5426\u88ab\u6dfb\u52a0\u5230\u5f53\u524d\u7a97\u53e3\u4e2d\u3002
Parameters:
Name Type Description Default action
Action
\u5f85\u68c0\u6d4b\u7684Action
required Returns:
Type Description bool
\u8fd4\u56deTrue
\u4ee3\u8868\u6307\u5b9aAction
\u5df2\u88ab\u6dfb\u52a0\u5230\u5f53\u524d\u7a97\u53e3\u4e2d\uff0c\u5426\u5219\u8fd4\u56deFalse
\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.is_action_checkable","title":"is_action_checkable(action: Action) -> Optional[bool]
","text":"\u68c0\u6d4b\u6307\u5b9aAction
\u662f\u5426\u4e3a\u201c\u53ef\u9009\u4e2d\u201d\u7684\u3002
Parameters:
Name Type Description Default action
Action
\u5f85\u68c0\u6d4b\u7684Action
required Returns:
Type Description Optional[bool]
\u8fd4\u56deTrue
\u4ee3\u8868\u6307\u5b9aAction
\u4e3a\u201c\u53ef\u9009\u4e2d\u201d\u7684\uff0c\u5426\u5219\u8fd4\u56deFalse
\u3002\u82e5\u672a\u627e\u5230\u6307\u5b9aAction
\uff0c\u5219\u8fd4\u56deNone
\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.is_action_checked","title":"is_action_checked(action: Action) -> Optional[bool]
","text":"\u68c0\u6d4b\u6307\u5b9aAction
\u662f\u5426\u5904\u4e8e\u201c\u9009\u4e2d\u201d\u72b6\u6001\u3002
Parameters:
Name Type Description Default action
Action
\u5f85\u68c0\u6d4b\u7684Action
required Returns:
Type Description Optional[bool]
\u8fd4\u56deTrue
\u4ee3\u8868\u6307\u5b9aAction
\u5f53\u524d\u4e3a\u201c\u9009\u4e2d\u201d\u72b6\u6001\u7684\uff0c\u5426\u5219\u8fd4\u56deFalse
\u3002\u82e5\u672a\u627e\u5230\u6307\u5b9aAction
\uff0c\u5219\u8fd4\u56deNone
\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.is_action_enabled","title":"is_action_enabled(action: Action) -> Optional[bool]
","text":"\u68c0\u67e5\u76ee\u6807Action
\u5f53\u524d\u7684\u542f\u7528\u72b6\u6001\u3002
Parameters:
Name Type Description Default action
Action
\u76ee\u6807Action
required Returns:
Type Description Optional[bool]
\u8fd4\u56de\u76ee\u6807Action
\u5f53\u524d\u7684\u542f\u7528\u72b6\u6001\u3002\u82e5\u672a\u627e\u5230\u76ee\u6807Action
\uff0c\u5219\u8fd4\u56deNone
\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.is_always_on_top","title":"is_always_on_top() -> bool
","text":"\u5224\u65ad\u7a97\u53e3\u662f\u5426\u603b\u662f\u7f6e\u9876\u3002
Returns:
Type Description bool
\u8fd4\u56deTrue
\u4ee3\u8868\u7a97\u53e3\u5f53\u524d\u5904\u4e8e\u603b\u662f\u7f6e\u9876\u72b6\u6001\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_action_enabled","title":"set_action_enabled(action: Action, enabled: bool) -> Optional[bool]
","text":"\u8bbe\u7f6e\u76ee\u6807Action
\u7684\u542f\u7528\u72b6\u6001\u3002
Parameters:
Name Type Description Default action
Action
\u76ee\u6807Action
required enabled
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description Optional[bool]
\u8fd4\u56de\u8bbe\u7f6e\u4e4b\u524d\u7684\u542f\u7528\u72b6\u6001\u3002\u82e5\u672a\u627e\u5230\u76ee\u6807Action
\uff0c\u5219\u8fd4\u56deNone
\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_action_state","title":"set_action_state(action: Action, checked: bool) -> Optional[bool]
","text":"\u8bbe\u7f6eAction
\u5f53\u524d\u72b6\u6001\u3002
Parameters:
Name Type Description Default action
Action
\u76ee\u6807Action
required checked
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description Optional[bool]
\u8fd4\u56de\u8bbe\u7f6e\u4e4b\u524d\u7684\u72b6\u6001\u3002\u82e5\u672a\u627e\u5230\u76ee\u6807Action
\uff0c\u5219\u8fd4\u56deNone
\u3002
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_always_on_top","title":"set_always_on_top(enabled: bool) -> None
","text":"\u8bbe\u7f6e\u7a97\u53e3\u662f\u5426\u603b\u662f\u7f6e\u9876\u3002
Parameters:
Name Type Description Default enabled
bool
\u662f\u5426\u603b\u662f\u7f6e\u9876
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_clipboard_text","title":"set_clipboard_text(text: str) -> None
staticmethod
","text":"\u8bbe\u7f6e\u526a\u8d34\u677f\u5185\u5bb9\u3002
Parameters:
Name Type Description Default text
str
\u8981\u8bbe\u7f6e\u5230\u526a\u8d34\u677f\u4e2d\u7684\u6587\u672c
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_font","title":"set_font(font_family: Union[str, Sequence[str]], font_size: int) -> None
","text":"\u8bbe\u7f6e\u7a97\u53e3\u5b57\u4f53\u3002
Parameters:
Name Type Description Default font_family
Union[str, Sequence[str]]
\u5b57\u4f53\u540d\u79f0
required font_size
int
\u5b57\u4f53\u5927\u5c0f\uff08px\uff09
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_icon","title":"set_icon(icon: IconType) -> None
","text":"\u8bbe\u7f6e\u7a97\u53e3\u56fe\u6807\u3002
Parameters:
Name Type Description Default icon
IconType
\u5f85\u8bbe\u7f6e\u7684\u56fe\u6807
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_position","title":"set_position(position: Optional[Tuple[int, int]]) -> None
","text":"\u8bbe\u7f6e\u7a97\u53e3\u5728\u5c4f\u5e55\u4e0a\u7684\u4f4d\u7f6e\u3002
Parameters:
Name Type Description Default position
Optional[Tuple[int, int]]
\u76ee\u6807\u4f4d\u7f6e\u3002
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_size","title":"set_size(size: Union[Tuple[int, int], QSize]) -> None
","text":"\u8bbe\u7f6e\u7a97\u53e3\u5c3a\u5bf8\u3002
Parameters:
Name Type Description Default size
Union[Tuple[int, int], QSize]
\u76ee\u6807\u5c3a\u5bf8\u3002
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_stylesheet","title":"set_stylesheet(stylesheet: Optional[str]) -> None
","text":"\u4e3a\u7a97\u53e3\u8bbe\u7f6e\u6837\u5f0f\u8868\uff08QSS\uff09\u683c\u5f0f\u3002
Parameters:
Name Type Description Default stylesheet
Optional[str]
\u6837\u5f0f\u8868
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.set_title","title":"set_title(title: str) -> None
","text":"\u8bbe\u7f6e\u7a97\u53e3\u6807\u9898\u3002
Parameters:
Name Type Description Default title
str
\u5f85\u8bbe\u7f6e\u7684\u6807\u9898
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.show_toast","title":"show_toast(message: str, duration: int = 2000, config: Optional[ToastConfig] = None, clear: bool = False) -> None
","text":"\u663e\u793a\u4e00\u6761toast\u6d88\u606f\u3002
Parameters:
Name Type Description Default message
str
\u5f85\u663e\u793a\u7684\u6d88\u606f
required duration
int
\u6d88\u606f\u663e\u793a\u7684\u65f6\u957f\uff0c\u5355\u4f4d\u6beb\u79d2
2000
config
Optional[ToastConfig]
toast\u7684\u914d\u7f6e
None
clear
bool
\u5728\u663e\u793a\u5f53\u524d\u6d88\u606f\u524d\uff0c\u662f\u5426\u6e05\u9664\u4e4b\u524d\u53d1\u51fa\u7684\u6d88\u606f
False
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.window/#pyguiadapter.window.BaseWindow.toggle_action_state","title":"toggle_action_state(action: Action) -> Optional[bool]
","text":"\u5207\u6362\u76ee\u6807Action
\u7684\u5f53\u524d\u72b6\u6001\u3002
Parameters:
Name Type Description Default action
Action
\u76ee\u6807Action
required Returns:
Type Description Optional[bool]
\u8fd4\u56de\u5207\u6362\u4e4b\u524d\u7684\u72b6\u6001\u3002\u82e5\u672a\u627e\u5230\u76ee\u6807Action
\uff0c\u5219\u8fd4\u56deNone
\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/","title":"pyguiadapter.windows.fnexec","text":""},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig","title":"FnExecuteWindowConfig
dataclass
","text":" Bases: BaseWindowConfig
Source code in pyguiadapter\\windows\\fnexec\\_base.py
@dataclasses.dataclass(frozen=True)\nclass FnExecuteWindowConfig(BaseWindowConfig):\n title: Optional[str] = None\n \"\"\"\u7a97\u53e3\u6807\u9898\u3002\"\"\"\n\n size: Union[Tuple[int, int], QSize] = (800, 600)\n \"\"\"\u7a97\u53e3\u5927\u5c0f\u3002\"\"\"\n\n execute_button_text: str = \"Execute\"\n \"\"\"\u6267\u884c\u6309\u94ae\u6587\u672c\u3002\"\"\"\n\n cancel_button_text: str = \"Cancel\"\n \"\"\"\u53d6\u6d88\u6309\u94ae\u6587\u672c\u3002\"\"\"\n\n clear_button_text: str = \"Clear\"\n \"\"\"\u6e05\u9664\u6309\u94ae\u6587\u672c\u3002\"\"\"\n\n clear_button_visible: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae\u3002\"\"\"\n\n clear_checkbox_text: str = \"clear output\"\n \"\"\"\u6e05\u9664\u9009\u9879\u6846\u6587\u672c\u3002\"\"\"\n\n clear_checkbox_visible: bool = True\n \"\"\"\u662f\u5426\u663e\u793a\u6e05\u9664\u9009\u9879\u6846\u3002\"\"\"\n\n clear_checkbox_checked: bool = True\n \"\"\"\u662f\u5426\u5c06\u6e05\u9664\u9009\u9879\u6846\u8bbe\u7f6e\u4e3a\u9009\u4e2d\u72b6\u6001\u3002\"\"\"\n\n statusbar_visible: bool = False\n \"\"\"\u662f\u5426\u663e\u793a\u7a97\u53e3\u72b6\u6001\u680f\"\"\"\n\n initial_docks_state: Literal[\"auto\", \"tabified\"] = \"auto\"\n \"\"\"\u505c\u9760\u7a97\u53e3\u7684\u521d\u59cb\u72b6\u6001\u3002\u53ef\u9009`auto`\u6216`tabified`\u3002\u5f53\u6307\u5b9a\u4e3a`tabified`\u65f6\uff0c\u505c\u9760\u7a97\u53e3\u5c06\u7ec4\u5408\u6210\u4e00\u4e2a`Tab`\u7ec4\u4ef6\uff0c\u6bcf\u4e2a\u505c\u9760\u7a97\u53e3\u90fd\u5c06\u4ee5`Tab\u9875`\u7684\u5f62\u5f0f\u51fa\u73b0\u3002\"\"\"\n\n output_dock_visible: bool = True\n \"\"\"\u662f\u5426\u663e\u793a`Output\u505c\u9760\u7a97\u53e3`\u3002\"\"\"\n\n output_dock_title: str = \"Output\"\n \"\"\"`Output\u505c\u9760\u7a97\u53e3`\u7684\u6807\u9898\u3002\"\"\"\n\n output_dock_floating: bool = False\n \"\"\"\u662f\u5426\u4f7f`Output\u505c\u9760\u7a97\u53e3`\u5904\u4e8e\u60ac\u6d6e\u72b6\u6001\u3002\"\"\"\n\n output_dock_initial_area: DockWidgetArea = BottomDockWidgetArea\n \"\"\"`Output\u505c\u9760\u7a97\u53e3`\u7684\u521d\u59cb\u505c\u9760\u533a\u57df\u3002\"\"\"\n\n output_dock_initial_size: Tuple[\n Union[int, float, None], Union[int, float, None]\n ] = (None, 0.25)\n \"\"\"`Output\u505c\u9760\u7a97\u53e3`\u7684\u521d\u59cb\u5927\u5c0f\uff0c\u683c\u5f0f\u4e3a`(width, height)`\uff0c\u53ef\u4ee5\u53ea\u8bbe\u7f6e\u5176\u4e2d\u4e00\u4e2a\u7ef4\u5ea6\uff0c\u53e6\u4e00\u4e2a\u4e0d\u9700\u8981\u8bbe\u7f6e\u7684\u7ef4\u5ea6\u7f6e\u4e3a`None`\u5373\u53ef\u3002\n width\u548cheight\u53ef\u4ee5\u4e3a`int`\u6216`float`, \u4e3a`int`\u65f6\u4ee3\u8868width\u6216height\u7684\u7edd\u5bf9\u503c\uff0c\u4e3a`float`\u65f6\u4ee3\u8868\u76f8\u5bf9\u4e8e\u7a97\u53e3\u5927\u5c0f\u7684\u767e\u5206\u6bd4\u3002\n \"\"\"\n\n document_dock_visible: bool = True\n \"\"\"\u662f\u5426\u663e\u793a`Document\u505c\u9760\u7a97\u53e3`\u3002\"\"\"\n\n document_dock_title: str = \"Document\"\n \"\"\"`Document\u505c\u9760\u7a97\u53e3`\u7684\u6807\u9898\u3002\"\"\"\n\n document_dock_floating: bool = False\n \"\"\"\u662f\u5426\u4f7f`Document\u505c\u9760\u7a97\u53e3`\u5904\u4e8e\u60ac\u6d6e\u72b6\u6001\u3002\"\"\"\n\n document_dock_initial_area: DockWidgetArea = RightDockWidgetArea\n \"\"\"`Document\u505c\u9760\u7a97\u53e3`\u7684\u521d\u59cb\u505c\u9760\u533a\u57df\u3002\"\"\"\n\n document_dock_initial_size: Tuple[\n Union[int, float, None], Union[int, float, None]\n ] = (0.56, None)\n \"\"\"`Document\u505c\u9760\u7a97\u53e3`\u7684\u521d\u59cb\u5927\u5c0f\uff0c\u683c\u5f0f\u4e3a`(width, height)`\uff0c\u53ef\u4ee5\u53ea\u8bbe\u7f6e\u5176\u4e2d\u4e00\u4e2a\u7ef4\u5ea6\uff0c\u53e6\u4e00\u4e2a\u4e0d\u9700\u8981\u8bbe\u7f6e\u7684\u7ef4\u5ea6\u7f6e\u4e3a`None`\u5373\u53ef\u3002\n width\u548cheight\u53ef\u4ee5\u4e3a`int`\u6216`float`, \u4e3a`int`\u65f6\u4ee3\u8868width\u6216height\u7684\u7edd\u5bf9\u503c\uff0c\u4e3a`float`\u65f6\u4ee3\u8868\u76f8\u5bf9\u4e8e\u7a97\u53e3\u5927\u5c0f\u7684\u767e\u5206\u6bd4\u3002\n \"\"\"\n\n output_browser_config: Optional[OutputBrowserConfig] = dataclasses.field(\n default_factory=OutputBrowserConfig\n )\n \"\"\"`\u8f93\u51fa\u6d4f\u89c8\u5668`\u7684\u914d\u7f6e\u3002\"\"\"\n\n document_browser_config: Optional[DocumentBrowserConfig] = dataclasses.field(\n default_factory=DocumentBrowserConfig\n )\n \"\"\"`\u6587\u6863\u6d4f\u89c8\u5668`\u7684\u914d\u7f6e\u3002\"\"\"\n\n default_parameter_group_name: str = \"Main Parameters\"\n \"\"\"\u9ed8\u8ba4\u51fd\u6570\u53c2\u6570\u5206\u7ec4\u7684\u540d\u79f0\u3002\"\"\"\n\n default_parameter_group_icon: IconType = None\n \"\"\"\u9ed8\u8ba4\u51fd\u6570\u53c2\u6570\u5206\u7ec4\u7684\u56fe\u6807\u3002\"\"\"\n\n parameter_group_icons: Dict[str, IconType] = dataclasses.field(default_factory=dict)\n \"\"\"\u9664\u9ed8\u8ba4\u51fd\u6570\u53c2\u6570\u5206\u7ec4\u5916\u5176\u4ed6\u51fd\u6570\u53c2\u6570\u5206\u7ec4\u7684\u56fe\u6807\"\"\"\n\n disable_widgets_on_execute: bool = False\n \"\"\"\u662f\u5426\u5728\u51fd\u6570\u6267\u884c\u671f\u95f4\u4f7f\u53c2\u6570\u63a7\u4ef6\u5904\u4e8e\u4e0d\u53ef\u8f93\u5165\u72b6\u6001\u3002\"\"\"\n\n print_function_result: bool = True\n \"\"\"\u662f\u5426\u5728`\u8f93\u51fa\u6d4f\u89c8\u5668`\u4e2d\u6253\u5370\u51fd\u6570\u8c03\u7528\u7ed3\u679c\u3002\"\"\"\n\n show_function_result: bool = False\n \"\"\"\u662f\u5426\u5f39\u7a97\u663e\u793a\u51fd\u6570\u8c03\u7528\u7ed3\u679c\u3002\"\"\"\n\n print_function_error: bool = True\n \"\"\"\u662f\u5426\u5728`\u8f93\u51fa\u6d4f\u89c8\u5668`\u4e2d\u6253\u5370\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u53d1\u751f\u7684\u5f02\u5e38\u548c\u9519\u8bef\u3002\"\"\"\n\n show_function_error: bool = True\n \"\"\"\u662f\u5426\u5f39\u7a97\u663e\u793a\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u53d1\u751f\u7684\u5f02\u5e38\u548c\u9519\u8bef\u3002\"\"\"\n\n function_error_traceback: bool = True\n \"\"\"\u5728\u6253\u5370\u6216\u5f39\u7a97\u663e\u793a\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u53d1\u751f\u7684\u5f02\u5e38\u65f6\uff0c\u662f\u5426\u663e\u793a\u5f02\u5e38\u7684\u56de\u6eaf\u4fe1\u606f\u3002\"\"\"\n\n error_dialog_title: str = \"Error\"\n \"\"\"\u9519\u8bef\u4fe1\u606f\u5f39\u7a97\u7684\u6807\u9898\u3002\"\"\"\n\n result_dialog_title: str = \"Result\"\n \"\"\"\u51fd\u6570\u8c03\u7528\u7ed3\u679c\u5f39\u7a97\u7684\u6807\u9898\u3002\"\"\"\n\n parameter_error_message: str = \"{}: {}\"\n \"\"\"`ParameterError`\u7c7b\u578b\u5f02\u5e38\u7684\u6d88\u606f\u6a21\u677f\uff0c\u6a21\u677f\u7b2c\u4e00\u4e2a\u53d8\u91cf\uff08`{}`\uff09\u4e3a`\u53c2\u6570\u540d\u79f0`\uff0c\u7b2c\u4e8c\u4e2a\u53d8\u91cf(`{}`)\u4e3a`\u5f02\u5e38\u7684\u6d88\u606f\uff08message\uff09`\u3002\"\"\"\n\n function_result_message: str = \"function result: {}\\n\"\n \"\"\"\u51fd\u6570\u8c03\u7528\u7ed3\u679c\u7684\u6d88\u606f\u6a21\u677f\uff0c\u6a21\u677f\u53d8\u91cf\uff08`{}`\uff09\u4e3a\u51fd\u6570\u7684\u8fd4\u56de\u503c\u3002\"\"\"\n\n function_error_message: str = \"{}: {}\\n\"\n \"\"\"\u51fd\u6570\u5f02\u5e38\u6216\u9519\u8bef\u7684\u6d88\u606f\u6a21\u677f\uff0c\u6a21\u677f\u7b2c\u4e00\u4e2a\u53d8\u91cf\uff08`{}`\uff09\u4e3a`\u5f02\u5e38\u7684\u7c7b\u578b`\uff0c\u7b2c\u4e8c\u4e2a\u53d8\u91cf(`{}`)\u4e3a`\u5f02\u5e38\u7684\u6d88\u606f\uff08message\uff09`\u3002\"\"\"\n\n function_executing_message: str = \"A function is executing now!\"\n \"\"\"\u63d0\u793a\u6d88\u606f\uff0c\u7528\u4ee5\u63d0\u793a\u201c\u51fd\u6570\u6b63\u5728\u6267\u884c\u201d\u3002\"\"\"\n\n uncancelable_function_message: str = \"The function is not cancelable!\"\n \"\"\"\u63d0\u793a\u6d88\u606f\uff0c\u7528\u4ee5\u63d0\u793a\u201c\u5f53\u524d\u51fd\u6570\u4e3a\u4e0d\u53ef\u53d6\u6d88\u7684\u51fd\u6570\u201d\u3002\"\"\"\n\n function_not_executing_message: str = \"No function is executing now!\"\n \"\"\"\u63d0\u793a\u6d88\u606f\uff0c\u7528\u4ee5\u63d0\u793a\u201c\u5f53\u524d\u51fd\u6570\u672a\u5904\u4e8e\u6267\u884c\u72b6\u6001\u201d\u3002\"\"\"\n
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.cancel_button_text","title":"cancel_button_text: str = 'Cancel'
class-attribute
instance-attribute
","text":"\u53d6\u6d88\u6309\u94ae\u6587\u672c\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.clear_button_text","title":"clear_button_text: str = 'Clear'
class-attribute
instance-attribute
","text":"\u6e05\u9664\u6309\u94ae\u6587\u672c\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.clear_button_visible","title":"clear_button_visible: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u9664\u6309\u94ae\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.clear_checkbox_checked","title":"clear_checkbox_checked: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5c06\u6e05\u9664\u9009\u9879\u6846\u8bbe\u7f6e\u4e3a\u9009\u4e2d\u72b6\u6001\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.clear_checkbox_text","title":"clear_checkbox_text: str = 'clear output'
class-attribute
instance-attribute
","text":"\u6e05\u9664\u9009\u9879\u6846\u6587\u672c\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.clear_checkbox_visible","title":"clear_checkbox_visible: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u6e05\u9664\u9009\u9879\u6846\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.default_parameter_group_icon","title":"default_parameter_group_icon: IconType = None
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u51fd\u6570\u53c2\u6570\u5206\u7ec4\u7684\u56fe\u6807\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.default_parameter_group_name","title":"default_parameter_group_name: str = 'Main Parameters'
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u51fd\u6570\u53c2\u6570\u5206\u7ec4\u7684\u540d\u79f0\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.disable_widgets_on_execute","title":"disable_widgets_on_execute: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5728\u51fd\u6570\u6267\u884c\u671f\u95f4\u4f7f\u53c2\u6570\u63a7\u4ef6\u5904\u4e8e\u4e0d\u53ef\u8f93\u5165\u72b6\u6001\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.document_browser_config","title":"document_browser_config: Optional[DocumentBrowserConfig] = dataclasses.field(default_factory=DocumentBrowserConfig)
class-attribute
instance-attribute
","text":"\u6587\u6863\u6d4f\u89c8\u5668
\u7684\u914d\u7f6e\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.document_dock_floating","title":"document_dock_floating: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7fDocument\u505c\u9760\u7a97\u53e3
\u5904\u4e8e\u60ac\u6d6e\u72b6\u6001\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.document_dock_initial_area","title":"document_dock_initial_area: DockWidgetArea = RightDockWidgetArea
class-attribute
instance-attribute
","text":"Document\u505c\u9760\u7a97\u53e3
\u7684\u521d\u59cb\u505c\u9760\u533a\u57df\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.document_dock_initial_size","title":"document_dock_initial_size: Tuple[Union[int, float, None], Union[int, float, None]] = (0.56, None)
class-attribute
instance-attribute
","text":"Document\u505c\u9760\u7a97\u53e3
\u7684\u521d\u59cb\u5927\u5c0f\uff0c\u683c\u5f0f\u4e3a(width, height)
\uff0c\u53ef\u4ee5\u53ea\u8bbe\u7f6e\u5176\u4e2d\u4e00\u4e2a\u7ef4\u5ea6\uff0c\u53e6\u4e00\u4e2a\u4e0d\u9700\u8981\u8bbe\u7f6e\u7684\u7ef4\u5ea6\u7f6e\u4e3aNone
\u5373\u53ef\u3002 width\u548cheight\u53ef\u4ee5\u4e3aint
\u6216float
, \u4e3aint
\u65f6\u4ee3\u8868width\u6216height\u7684\u7edd\u5bf9\u503c\uff0c\u4e3afloat
\u65f6\u4ee3\u8868\u76f8\u5bf9\u4e8e\u7a97\u53e3\u5927\u5c0f\u7684\u767e\u5206\u6bd4\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.document_dock_title","title":"document_dock_title: str = 'Document'
class-attribute
instance-attribute
","text":"Document\u505c\u9760\u7a97\u53e3
\u7684\u6807\u9898\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.document_dock_visible","title":"document_dock_visible: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793aDocument\u505c\u9760\u7a97\u53e3
\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.error_dialog_title","title":"error_dialog_title: str = 'Error'
class-attribute
instance-attribute
","text":"\u9519\u8bef\u4fe1\u606f\u5f39\u7a97\u7684\u6807\u9898\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.execute_button_text","title":"execute_button_text: str = 'Execute'
class-attribute
instance-attribute
","text":"\u6267\u884c\u6309\u94ae\u6587\u672c\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.function_error_message","title":"function_error_message: str = '{}: {}\\n'
class-attribute
instance-attribute
","text":"\u51fd\u6570\u5f02\u5e38\u6216\u9519\u8bef\u7684\u6d88\u606f\u6a21\u677f\uff0c\u6a21\u677f\u7b2c\u4e00\u4e2a\u53d8\u91cf\uff08{}
\uff09\u4e3a\u5f02\u5e38\u7684\u7c7b\u578b
\uff0c\u7b2c\u4e8c\u4e2a\u53d8\u91cf({}
)\u4e3a\u5f02\u5e38\u7684\u6d88\u606f\uff08message\uff09
\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.function_error_traceback","title":"function_error_traceback: bool = True
class-attribute
instance-attribute
","text":"\u5728\u6253\u5370\u6216\u5f39\u7a97\u663e\u793a\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u53d1\u751f\u7684\u5f02\u5e38\u65f6\uff0c\u662f\u5426\u663e\u793a\u5f02\u5e38\u7684\u56de\u6eaf\u4fe1\u606f\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.function_executing_message","title":"function_executing_message: str = 'A function is executing now!'
class-attribute
instance-attribute
","text":"\u63d0\u793a\u6d88\u606f\uff0c\u7528\u4ee5\u63d0\u793a\u201c\u51fd\u6570\u6b63\u5728\u6267\u884c\u201d\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.function_not_executing_message","title":"function_not_executing_message: str = 'No function is executing now!'
class-attribute
instance-attribute
","text":"\u63d0\u793a\u6d88\u606f\uff0c\u7528\u4ee5\u63d0\u793a\u201c\u5f53\u524d\u51fd\u6570\u672a\u5904\u4e8e\u6267\u884c\u72b6\u6001\u201d\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.function_result_message","title":"function_result_message: str = 'function result: {}\\n'
class-attribute
instance-attribute
","text":"\u51fd\u6570\u8c03\u7528\u7ed3\u679c\u7684\u6d88\u606f\u6a21\u677f\uff0c\u6a21\u677f\u53d8\u91cf\uff08{}
\uff09\u4e3a\u51fd\u6570\u7684\u8fd4\u56de\u503c\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.initial_docks_state","title":"initial_docks_state: Literal['auto', 'tabified'] = 'auto'
class-attribute
instance-attribute
","text":"\u505c\u9760\u7a97\u53e3\u7684\u521d\u59cb\u72b6\u6001\u3002\u53ef\u9009auto
\u6216tabified
\u3002\u5f53\u6307\u5b9a\u4e3atabified
\u65f6\uff0c\u505c\u9760\u7a97\u53e3\u5c06\u7ec4\u5408\u6210\u4e00\u4e2aTab
\u7ec4\u4ef6\uff0c\u6bcf\u4e2a\u505c\u9760\u7a97\u53e3\u90fd\u5c06\u4ee5Tab\u9875
\u7684\u5f62\u5f0f\u51fa\u73b0\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.output_browser_config","title":"output_browser_config: Optional[OutputBrowserConfig] = dataclasses.field(default_factory=OutputBrowserConfig)
class-attribute
instance-attribute
","text":"\u8f93\u51fa\u6d4f\u89c8\u5668
\u7684\u914d\u7f6e\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.output_dock_floating","title":"output_dock_floating: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u4f7fOutput\u505c\u9760\u7a97\u53e3
\u5904\u4e8e\u60ac\u6d6e\u72b6\u6001\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.output_dock_initial_area","title":"output_dock_initial_area: DockWidgetArea = BottomDockWidgetArea
class-attribute
instance-attribute
","text":"Output\u505c\u9760\u7a97\u53e3
\u7684\u521d\u59cb\u505c\u9760\u533a\u57df\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.output_dock_initial_size","title":"output_dock_initial_size: Tuple[Union[int, float, None], Union[int, float, None]] = (None, 0.25)
class-attribute
instance-attribute
","text":"Output\u505c\u9760\u7a97\u53e3
\u7684\u521d\u59cb\u5927\u5c0f\uff0c\u683c\u5f0f\u4e3a(width, height)
\uff0c\u53ef\u4ee5\u53ea\u8bbe\u7f6e\u5176\u4e2d\u4e00\u4e2a\u7ef4\u5ea6\uff0c\u53e6\u4e00\u4e2a\u4e0d\u9700\u8981\u8bbe\u7f6e\u7684\u7ef4\u5ea6\u7f6e\u4e3aNone
\u5373\u53ef\u3002 width\u548cheight\u53ef\u4ee5\u4e3aint
\u6216float
, \u4e3aint
\u65f6\u4ee3\u8868width\u6216height\u7684\u7edd\u5bf9\u503c\uff0c\u4e3afloat
\u65f6\u4ee3\u8868\u76f8\u5bf9\u4e8e\u7a97\u53e3\u5927\u5c0f\u7684\u767e\u5206\u6bd4\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.output_dock_title","title":"output_dock_title: str = 'Output'
class-attribute
instance-attribute
","text":"Output\u505c\u9760\u7a97\u53e3
\u7684\u6807\u9898\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.output_dock_visible","title":"output_dock_visible: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793aOutput\u505c\u9760\u7a97\u53e3
\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.parameter_error_message","title":"parameter_error_message: str = '{}: {}'
class-attribute
instance-attribute
","text":"ParameterError
\u7c7b\u578b\u5f02\u5e38\u7684\u6d88\u606f\u6a21\u677f\uff0c\u6a21\u677f\u7b2c\u4e00\u4e2a\u53d8\u91cf\uff08{}
\uff09\u4e3a\u53c2\u6570\u540d\u79f0
\uff0c\u7b2c\u4e8c\u4e2a\u53d8\u91cf({}
)\u4e3a\u5f02\u5e38\u7684\u6d88\u606f\uff08message\uff09
\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.parameter_group_icons","title":"parameter_group_icons: Dict[str, IconType] = dataclasses.field(default_factory=dict)
class-attribute
instance-attribute
","text":"\u9664\u9ed8\u8ba4\u51fd\u6570\u53c2\u6570\u5206\u7ec4\u5916\u5176\u4ed6\u51fd\u6570\u53c2\u6570\u5206\u7ec4\u7684\u56fe\u6807
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.print_function_error","title":"print_function_error: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5728\u8f93\u51fa\u6d4f\u89c8\u5668
\u4e2d\u6253\u5370\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u53d1\u751f\u7684\u5f02\u5e38\u548c\u9519\u8bef\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.print_function_result","title":"print_function_result: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5728\u8f93\u51fa\u6d4f\u89c8\u5668
\u4e2d\u6253\u5370\u51fd\u6570\u8c03\u7528\u7ed3\u679c\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.result_dialog_title","title":"result_dialog_title: str = 'Result'
class-attribute
instance-attribute
","text":"\u51fd\u6570\u8c03\u7528\u7ed3\u679c\u5f39\u7a97\u7684\u6807\u9898\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.show_function_error","title":"show_function_error: bool = True
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f39\u7a97\u663e\u793a\u51fd\u6570\u6267\u884c\u8fc7\u7a0b\u4e2d\u53d1\u751f\u7684\u5f02\u5e38\u548c\u9519\u8bef\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.show_function_result","title":"show_function_result: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u5f39\u7a97\u663e\u793a\u51fd\u6570\u8c03\u7528\u7ed3\u679c\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.size","title":"size: Union[Tuple[int, int], QSize] = (800, 600)
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u5927\u5c0f\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.statusbar_visible","title":"statusbar_visible: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u663e\u793a\u7a97\u53e3\u72b6\u6001\u680f
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.title","title":"title: Optional[str] = None
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u6807\u9898\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowConfig.uncancelable_function_message","title":"uncancelable_function_message: str = 'The function is not cancelable!'
class-attribute
instance-attribute
","text":"\u63d0\u793a\u6d88\u606f\uff0c\u7528\u4ee5\u63d0\u793a\u201c\u5f53\u524d\u51fd\u6570\u4e3a\u4e0d\u53ef\u53d6\u6d88\u7684\u51fd\u6570\u201d\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.OutputBrowserConfig","title":"OutputBrowserConfig
dataclass
","text":" Bases: TextBrowserConfig
\u8f93\u51fa\u6d4f\u89c8\u5668\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\windows\\fnexec\\_output_area\\browser.py
@dataclasses.dataclass\nclass OutputBrowserConfig(TextBrowserConfig):\n \"\"\"\u8f93\u51fa\u6d4f\u89c8\u5668\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n text_color: str = COLOR_TERMINAL_TEXT_CLASSIC\n font_family: str = FONT_FAMILY\n background_color: str = COLOR_TERMINAL_BACKGROUND_CLASSIC\n
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowEventListener","title":"FnExecuteWindowEventListener
","text":" Bases: BaseWindowEventListener
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowEventListener.on_execute_error","title":"on_execute_error(window: BaseFnExecuteWindow, error: Exception) -> bool
","text":"\u5728\u51fd\u6570\u6267\u884c\u5931\u8d25\uff08\u51fd\u6570\u629b\u51fa\u5f02\u5e38\uff09\u65f6\u56de\u8c03\u3002
Parameters:
Name Type Description Default window
BaseFnExecuteWindow
\u5f53\u524d\u7a97\u53e3\u5b9e\u4f8b
required error
Exception
\u51fd\u6570\u629b\u51fa\u7684\u5f02\u5e38
required Returns:
Type Description bool
\u5982\u679c\u8fd4\u56deTrue
\uff0c\u5219\u5141\u8bb8PyGUIAdapter
\u6267\u884c\u9ed8\u8ba4\u7684\u540e\u7eed\u64cd\u4f5c\uff0c\u6bd4\u5982\u6253\u5370\u51fd\u6570\u5f02\u5e38\u6216\u5f39\u7a97\u663e\u793a\u51fd\u6570\u5f02\u5e38\u7b49\uff0c\u5426\u5219\u963b\u6b62\u6267\u884c\u9ed8\u8ba4\u64cd\u4f5c\u3002\u9ed8\u8ba4\u8fd4\u56deTrue
\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowEventListener.on_execute_finish","title":"on_execute_finish(window: BaseFnExecuteWindow) -> None
","text":"\u5728\u51fd\u6570\u6267\u884c\u7ed3\u675f\u65f6\u56de\u8c03\uff0c\u65e0\u8bba\u51fd\u6570\u6267\u884c\u662f\u5426\u6210\u529f\uff0c\u8be5\u56de\u8c03\u51fd\u6570\u90fd\u4f1a\u88ab\u8c03\u7528\u3002
Parameters:
Name Type Description Default window
BaseFnExecuteWindow
\u5f53\u524d\u7a97\u53e3\u5b9e\u4f8b
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowEventListener.on_execute_result","title":"on_execute_result(window: BaseFnExecuteWindow, result: Any) -> bool
","text":"\u5728\u51fd\u6570\u6267\u884c\u6210\u529f\uff08\u51fd\u6570\u8fd4\u56de\uff09\u65f6\u56de\u8c03\u3002
Parameters:
Name Type Description Default window
BaseFnExecuteWindow
\u5f53\u524d\u7a97\u53e3\u5b9e\u4f8b
required result
Any
\u51fd\u6570\u7684\u8fd4\u56de\u503c
required Returns:
Type Description bool
\u5982\u679c\u8fd4\u56deTrue
\uff0c\u5219\u5141\u8bb8PyGUIAdapter
\u6267\u884c\u9ed8\u8ba4\u7684\u540e\u7eed\u64cd\u4f5c\uff0c\u6bd4\u5982\u6253\u5370\u51fd\u6570\u7ed3\u679c\u6216\u5f39\u7a97\u663e\u793a\u51fd\u6570\u7ed3\u679c\u7b49\uff0c\u5426\u5219\u963b\u6b62\u6267\u884c\u9ed8\u8ba4\u64cd\u4f5c\u3002\u9ed8\u8ba4\u8fd4\u56deTrue
\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindowEventListener.on_execute_start","title":"on_execute_start(window: BaseFnExecuteWindow) -> None
","text":"\u5728\u51fd\u6570\u6267\u884c\u5f00\u59cb\u65f6\u56de\u8c03\u3002
Parameters:
Name Type Description Default window
BaseFnExecuteWindow
\u5f53\u524d\u7a97\u53e3\u5b9e\u4f8b
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.SimpleFnExecuteWindowEventListener","title":"SimpleFnExecuteWindowEventListener
","text":" Bases: FnExecuteWindowEventListener
\u4e00\u4e2a\u7b80\u5355\u7684FnExecuteWindowEventListener
\u5b9e\u73b0\uff0c\u65b9\u4fbf\u4e0d\u559c\u6b22\u5b50\u7c7b\u5316\u65b9\u5f0f\u7684\u5f00\u53d1\u8005\u4f7f\u7528\u3002
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.SimpleFnExecuteWindowEventListener.__init__","title":"__init__(on_create: Callable[[BaseFnExecuteWindow], None] = None, on_show: Callable[[BaseFnExecuteWindow], None] = None, on_hide: Callable[[BaseFnExecuteWindow], None] = None, on_close: Callable[[BaseFnExecuteWindow], bool] = None, on_destroy: Callable[[BaseFnExecuteWindow], None] = None, on_execute_start: Callable[[BaseFnExecuteWindow], None] = None, on_execute_result: Callable[[BaseFnExecuteWindow, Any], bool] = None, on_execute_error: Callable[[BaseFnExecuteWindow, Exception], bool] = None, on_execute_finish: Callable[[BaseFnExecuteWindow], None] = None)
","text":"\u6784\u9020\u51fd\u6570\u3002
Parameters:
Name Type Description Default on_create
Callable[[BaseFnExecuteWindow], None]
on_create
\u56de\u8c03\u51fd\u6570
None
on_show
Callable[[BaseFnExecuteWindow], None]
on_show
\u56de\u8c03\u51fd\u6570
None
on_hide
Callable[[BaseFnExecuteWindow], None]
on_hide
\u56de\u8c03\u51fd\u6570
None
on_close
Callable[[BaseFnExecuteWindow], bool]
on_close
\u56de\u8c03\u51fd\u6570
None
on_destroy
Callable[[BaseFnExecuteWindow], None]
on_destroy
\u56de\u8c03\u51fd\u6570
None
on_execute_start
Callable[[BaseFnExecuteWindow], None]
on_execute_start
\u56de\u8c03\u51fd\u6570
None
on_execute_result
Callable[[BaseFnExecuteWindow, Any], bool]
on_execute_result
\u56de\u8c03\u51fd\u6570
None
on_execute_error
Callable[[BaseFnExecuteWindow, Exception], bool]
on_execute_error
\u56de\u8c03\u51fd\u6570
None
on_execute_finish
Callable[[BaseFnExecuteWindow], None]
on_execute_finish
\u56de\u8c03\u51fd\u6570
None
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow","title":"FnExecuteWindow
","text":" Bases: BaseFnExecuteWindow
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.activate_parameter_group","title":"activate_parameter_group(group_name: str) -> None
","text":"\u6fc0\u6d3b\u5c55\u5f00\u6307\u5b9a\u53c2\u6570\u5206\u7ec4\u3002
Parameters:
Name Type Description Default group_name
str
\u53c2\u6570\u5206\u7ec4\u540d\u79f0
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.add_parameter","title":"add_parameter(parameter_name: str, config: Tuple[Type[BaseParameterWidget], BaseParameterWidgetConfig]) -> None
","text":"\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u51fd\u6570\u53c2\u6570
Parameters:
Name Type Description Default parameter_name
str
\u8981\u589e\u52a0\u7684\u51fd\u6570\u53c2\u6570\u540d\u79f0
required config
Tuple[Type[BaseParameterWidget], BaseParameterWidgetConfig]
\u51fd\u6570\u53c2\u6570\u914d\u7f6e\uff0c\u683c\u5f0f\u4e3a: (\u53c2\u6570\u63a7\u4ef6\u7c7b, \u53c2\u6570\u63a7\u4ef6\u914d\u7f6e\u7c7b\u5b9e\u4f8b)
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Raises:
Type Description ParameterError
\u5f53\u53c2\u6570\u4e3a\u7a7a\u3001\u53c2\u6570\u540d\u79f0\u91cd\u590d\u65f6\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.add_parameters","title":"add_parameters(configs: Dict[str, Tuple[Type[BaseParameterWidget], BaseParameterWidgetConfig]]) -> None
","text":"\u589e\u52a0\u4e00\u7ec4\u65b0\u7684\u51fd\u6570\u53c2\u6570
Parameters:
Name Type Description Default configs
Dict[str, Tuple[Type[BaseParameterWidget], BaseParameterWidgetConfig]]
\u8981\u589e\u52a0\u7684\u51fd\u6570\u53c2\u6570\u540d\u79f0\u53ca\u5176\u914d\u7f6e
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Raises:
Type Description ParameterError
\u5f53\u53c2\u6570\u4e3a\u7a7a\u3001\u53c2\u6570\u540d\u79f0\u91cd\u590d\u65f6\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.append_output","title":"append_output(text: str, html: bool = False, scroll_to_bottom: bool = True) -> None
","text":"\u628a\u6587\u672c\u8ffd\u52a0\u5230\u8f93\u51fa\u6d4f\u89c8\u5668\u4e2d
Parameters:
Name Type Description Default text
str
\u5e26\u8f93\u51fa\u7684\u6587\u672c
required html
bool
\u662f\u5426\u4e3ahtml\u683c\u5f0f
False
scroll_to_bottom
bool
\u5b8c\u6210\u540e\u662f\u5426\u5c06\u8f93\u51fa\u6d4f\u89c8\u5668\u6eda\u52a8\u5230\u5e95\u90e8
True
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.clear_output","title":"clear_output() -> None
","text":"\u6e05\u9664\u8f93\u51fa\u6d4f\u89c8\u5668\u5185\u5bb9
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.clear_parameters","title":"clear_parameters() -> None
","text":"\u6e05\u9664\u6240\u6709\u53c2\u6570
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.clear_statusbar_message","title":"clear_statusbar_message() -> None
","text":"\u6e05\u9664\u72b6\u6001\u680f\u6d88\u606f
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.disable_parameter_widgets","title":"disable_parameter_widgets(disabled: bool) -> None
","text":"\u8bbe\u7f6e\u53c2\u6570\u63a7\u4ef6\u7981\u7528/\u542f\u7528\u72b6\u6001
Parameters:
Name Type Description Default disabled
bool
\u662f\u5426\u7981\u7528
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_document_dock_area","title":"get_document_dock_area() -> DockWidgetArea
","text":"\u83b7\u53d6Document Dock\u505c\u9760\u533a\u57df
Returns:
Type Description DockWidgetArea
\u8fd4\u56de\u5f53\u524d\u505c\u9760\u533a\u57df
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_document_dock_size","title":"get_document_dock_size() -> Tuple[int, int]
","text":"\u83b7\u53d6Document Dock\u5c3a\u5bf8
Returns:
Type Description Tuple[int, int]
\u8fd4\u56de\u5f53\u524d\u5c3a\u5bf8
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_document_dock_title","title":"get_document_dock_title() -> str
","text":"\u83b7\u53d6Document Dock\u6807\u9898
Returns:
Type Description str
\u8fd4\u56de\u5f53\u524d\u6807\u9898
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_output_dock_area","title":"get_output_dock_area() -> DockWidgetArea
","text":"\u83b7\u53d6Output Dock\u505c\u9760\u533a\u57df
Returns:
Type Description DockWidgetArea
\u8fd4\u56de\u5f53\u524d\u505c\u9760\u533a\u57df
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_output_dock_size","title":"get_output_dock_size() -> Tuple[int, int]
","text":"\u83b7\u53d6Output Dock\u5c3a\u5bf8
Returns:
Type Description Tuple[int, int]
\u8fd4\u56de\u5f53\u524d\u5c3a\u5bf8
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_output_dock_title","title":"get_output_dock_title() -> str
","text":"\u83b7\u53d6Output Dock\u6807\u9898
Returns:
Type Description str
\u8fd4\u56de\u5f53\u524d\u6807\u9898
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_parameter_names","title":"get_parameter_names() -> List[str]
","text":"\u83b7\u53d6\u6240\u6709\u53c2\u6570\u540d\u79f0
Returns:
Type Description List[str]
\u8fd4\u56de\u5f53\u524d\u6240\u6709\u53c2\u6570\u540d\u79f0
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_parameter_names_of","title":"get_parameter_names_of(group_name: str) -> List[str]
","text":"\u83b7\u53d6\u6307\u5b9a\u5206\u7ec4\u4e0b\u7684\u6240\u6709\u53c2\u6570\u540d\u79f0
Parameters:
Name Type Description Default group_name
str
\u5206\u7ec4\u540d\u79f0
required Returns:
Type Description List[str]
\u8fd4\u56de\u6307\u5b9a\u5206\u7ec4\u4e0b\u7684\u6240\u6709\u53c2\u6570\u540d\u79f0
Raises:
Type Description ParameterNotFoundError
\u5f53\u6307\u5b9a\u5206\u7ec4\u4e0d\u5b58\u5728\u65f6\uff0c\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_parameter_value","title":"get_parameter_value(parameter_name: str) -> Any
","text":"\u83b7\u53d6\u6307\u5b9a\u53c2\u6570\u5f53\u524d\u503c
Parameters:
Name Type Description Default parameter_name
str
\u53c2\u6570\u540d\u79f0
required Returns:
Type Description Any
\u8fd4\u56de\u5f53\u524d\u503c
Raises:
Type Description ParameterNotFoundError
\u6307\u5b9a\u53c2\u6570\u4e0d\u5b58\u5728\u65f6\uff0c\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
ParameterError
\u65e0\u6cd5\u4ece\u5bf9\u5e94\u63a7\u4ef6\u83b7\u53d6\u5f53\u524d\u503c\u65f6\uff0c\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_parameter_values","title":"get_parameter_values() -> Dict[str, Any]
","text":"\u83b7\u53d6\u6240\u6709\u53c2\u6570\u7684\u5f53\u524d\u503c
Returns:
Type Description Dict[str, Any]
\u4ee5\u5b57\u5178\u5f62\u5f0f\u8fd4\u56de\u5f53\u524d\u6240\u6709\u53c2\u6570\u7684\u503c
Raises:
Type Description ParameterError
\u65e0\u6cd5\u4ece\u5bf9\u5e94\u63a7\u4ef6\u83b7\u53d6\u67d0\u4e2a\u53c2\u6570\u7684\u5f53\u524d\u503c\u65f6\uff0c\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.get_parameter_values_of","title":"get_parameter_values_of(group_name: str) -> Dict[str, Any]
","text":"\u83b7\u53d6\u6307\u5b9a\u5206\u7ec4\u4e0b\u6240\u6709\u53c2\u6570\u5f53\u524d\u503c
Parameters:
Name Type Description Default group_name
str
\u6307\u5b9a\u5206\u7ec4\u7684\u540d\u79f0
required Returns:
Type Description Dict[str, Any]
\u8fd4\u56de\u6307\u5b9a\u5206\u7ec4\u4e0b\u6240\u6709\u53c2\u6570\u7684\u540d\u79f0\u548c\u503c
Raises:
Type Description ParameterNotFoundError
\u5f53\u6307\u5b9a\u5206\u7ec4\u4e0d\u5b58\u5728\u65f6\uff0c\u5f15\u53d1\u6b64\u5f02\u5e38
ParameterError
\u65e0\u6cd5\u4ece\u5bf9\u5e94\u63a7\u4ef6\u83b7\u53d6\u67d0\u4e2a\u53c2\u6570\u7684\u5f53\u524d\u503c\u65f6\uff0c\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.has_parameter","title":"has_parameter(parameter_name: str) -> bool
","text":"\u5224\u65ad\u662f\u5426\u5b58\u5728\u6307\u5b9a\u53c2\u6570\u540d\u79f0
Parameters:
Name Type Description Default parameter_name
str
\u5e26\u5224\u65ad\u7684\u53c2\u6570\u540d\u79f0
required Returns:
Type Description bool
\u5b58\u5728\u6307\u5b9a\u53c2\u6570\u65f6\u8fd4\u56deTrue
\uff0c\u5426\u5219\u8fd4\u56deFalse
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.hide_progressbar","title":"hide_progressbar() -> None
","text":"\u9690\u85cf\u8fdb\u5ea6\u6761
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.is_clear_checkbox_checked","title":"is_clear_checkbox_checked() -> bool
","text":"\u68c0\u67e5\u6e05\u9664\u9009\u9879\u6846\u662f\u5426\u9009\u4e2d
Returns:
Type Description bool
\u8fd4\u56de\u5f53\u524d\u72b6\u6001
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.is_document_dock_floating","title":"is_document_dock_floating() -> bool
","text":"\u68c0\u67e5Document Dock\u662f\u5426\u60ac\u6d6e
Returns:
Type Description bool
\u8fd4\u56de\u5f53\u524d\u60ac\u6d6e\u72b6\u6001
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.is_document_dock_visible","title":"is_document_dock_visible() -> bool
","text":"\u68c0\u67e5Document Dock\u662f\u5426\u663e\u793a
Returns:
Type Description bool
\u8fd4\u56de\u5f53\u524d\u663e\u793a\u72b6\u6001
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.is_function_cancelable","title":"is_function_cancelable() -> bool
","text":"\u68c0\u67e5\u51fd\u6570\u662f\u5426\u4e3a\u53ef\u53d6\u6d88\u51fd\u6570
Returns:
Type Description bool
\u8fd4\u56de\u51fd\u6570\u662f\u5426\u53ef\u53d6\u6d88
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.is_function_executing","title":"is_function_executing() -> bool
","text":"\u68c0\u67e5\u51fd\u6570\u662f\u5426\u6b63\u5728\u8fd0\u884c
Returns:
Type Description bool
\u8fd4\u56de\u51fd\u6570\u8fd0\u884c\u72b6\u6001
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.is_output_dock_floating","title":"is_output_dock_floating() -> bool
","text":"\u68c0\u67e5Output Dock\u662f\u5426\u60ac\u6d6e
Returns:
Type Description bool
\u8fd4\u56de\u5f53\u524d\u60ac\u6d6e\u72b6\u6001
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.is_output_dock_visible","title":"is_output_dock_visible() -> bool
","text":"\u68c0\u67e5Output Dock\u662f\u5426\u663e\u793a
Returns:
Type Description bool
\u8fd4\u56de\u5f53\u524d\u663e\u793a\u72b6\u6001
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.is_statusbar_visible","title":"is_statusbar_visible() -> bool
","text":"\u68c0\u67e5\u7a97\u53e3\u72b6\u6001\u680f\u662f\u5426\u53ef\u89c1
Returns:
Type Description bool
\u8fd4\u56de\u72b6\u6001\u680f\u5f53\u524d\u72b6\u6001
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.process_parameter_error","title":"process_parameter_error(e: ParameterError) -> None
","text":"\u4f7f\u7528\u5185\u7f6e\u903b\u8f91\u5904\u7406ParameterError\u7c7b\u578b\u7684\u5f02\u5e38
Parameters:
Name Type Description Default e
ParameterError
\u5f02\u5e38\u5bf9\u8c61
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.remove_parameter","title":"remove_parameter(parameter_name: str, ignore_unknown_parameter: bool = True) -> None
","text":"\u79fb\u9664\u6307\u5b9a\u53c2\u6570\u63a7\u4ef6
Parameters:
Name Type Description Default parameter_name
str
\u8981\u79fb\u9664\u7684\u6307\u5b9a\u53c2\u6570\u540d\u79f0
required ignore_unknown_parameter
bool
\u662f\u5426\u5ffd\u7565\u672a\u77e5\u53c2\u6570
True
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Raises:
Type Description ParameterNotFoundError
\u5f53\u53c2\u6570parameter_name
\u4e0d\u5b58\u5728\u4e14ignore_unknown_parameter
\u4e3aFalse
\u65f6\uff0c\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.resize_document_dock","title":"resize_document_dock(size: Tuple[Union[int, float, None], Union[int, float, None]]) -> None
","text":"\u8c03\u6574Document Dock\u5c3a\u5bf8
\u6ce8\u610f\uff1a\u505c\u9760\u7a97\u53e3\u7684\u5c3a\u5bf8\u53d7\u5230\u591a\u79cd\u56e0\u7d20\u7684\u5f71\u54cd\uff0c\u65e0\u6cd5\u4fdd\u8bc1\u5b9e\u9645\u7684\u5c3a\u5bf8\u4e0e\u5f00\u53d1\u8005\u8bbe\u7f6e\u7684\u5c3a\u5bf8\u4fdd\u6301\u4e00\u81f4\uff0c\u5c24\u5176\u65f6\u591a\u4e2a\u505c\u9760\u7a97\u53e3\u505c\u9760\u5728\u540c\u4e00\u533a\u57df\u65f6\u5177\u4f53\u800c\u8a00\uff1a
- \u5c3a\u5bf8\u7684\u8c03\u6574\u53d7\u6700\u5c0f\u548c\u6700\u5927\u5c3a\u5bf8\u7684\u7ea6\u675f\uff1b
- \u5c3a\u5bf8\u8c03\u6574\u4e0d\u4f1a\u5f71\u54cd\u4e3b\u7a97\u53e3\u7684\u5927\u5c0f\uff1b
- \u5728\u7a7a\u95f4\u6709\u9650\u7684\u60c5\u51b5\u4e0b\uff0c\u5c06\u6839\u636e\u5404\u4e2a\u505c\u9760\u7a97\u53e3\u7684\u76f8\u5bf9\u5927\u5c0f\u5360\u6bd4\u8fdb\u884c\u53ef\u4ee5\u5229\u7528\u7a7a\u95f4\u7684\u8c03\u6574
Parameters:
Name Type Description Default size
Tuple[Union[int, float, None], Union[int, float, None]]
\u76ee\u6807\u5c3a\u5bf8\u3002\u683c\u5f0f\u4e3a(width, height)
\uff0c\u53ef\u4ee5\u53ea\u8bbe\u7f6e\u5176\u4e2d\u4e00\u4e2a\u7ef4\u5ea6\uff0c\u53e6\u4e00\u4e2a\u4e0d\u9700\u8981\u8bbe\u7f6e\u7684\u7ef4\u5ea6\u7f6e\u4e3aNone
\u5373\u53ef\u3002width\u548cheight\u53ef\u4ee5\u4e3aint
\u6216float
, \u4e3aint
\u65f6\u4ee3\u8868width\u6216height\u7684\u7edd\u5bf9\u503c\uff0c\u4e3afloat
\u65f6\u4ee3\u8868\u76f8\u5bf9\u4e8e\u7a97\u53e3\u5927\u5c0f\u7684\u767e\u5206\u6bd4\u3002
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.resize_output_dock","title":"resize_output_dock(size: Tuple[Union[int, float, None], Union[int, float, None]]) -> None
","text":"\u8c03\u6574Output Dock\u5c3a\u5bf8
\u6ce8\u610f\uff1a\u505c\u9760\u7a97\u53e3\u7684\u5c3a\u5bf8\u53d7\u5230\u591a\u79cd\u56e0\u7d20\u7684\u5f71\u54cd\uff0c\u65e0\u6cd5\u4fdd\u8bc1\u5b9e\u9645\u7684\u5c3a\u5bf8\u4e0e\u5f00\u53d1\u8005\u8bbe\u7f6e\u7684\u5c3a\u5bf8\u4fdd\u6301\u4e00\u81f4\uff0c\u5c24\u5176\u65f6\u591a\u4e2a\u505c\u9760\u7a97\u53e3\u505c\u9760\u5728\u540c\u4e00\u533a\u57df\u65f6\u5177\u4f53\u800c\u8a00\uff1a
- \u5c3a\u5bf8\u7684\u8c03\u6574\u53d7\u6700\u5c0f\u548c\u6700\u5927\u5c3a\u5bf8\u7684\u7ea6\u675f\uff1b
- \u5c3a\u5bf8\u8c03\u6574\u4e0d\u4f1a\u5f71\u54cd\u4e3b\u7a97\u53e3\u7684\u5927\u5c0f\uff1b
- \u5728\u7a7a\u95f4\u6709\u9650\u7684\u60c5\u51b5\u4e0b\uff0c\u5c06\u6839\u636e\u5404\u4e2a\u505c\u9760\u7a97\u53e3\u7684\u76f8\u5bf9\u5927\u5c0f\u5360\u6bd4\u8fdb\u884c\u53ef\u4ee5\u5229\u7528\u7a7a\u95f4\u7684\u8c03\u6574
Parameters:
Name Type Description Default size
Tuple[Union[int, float, None], Union[int, float, None]]
\u76ee\u6807\u5c3a\u5bf8\u3002\u683c\u5f0f\u4e3a(width, height)
\uff0c\u53ef\u4ee5\u53ea\u8bbe\u7f6e\u5176\u4e2d\u4e00\u4e2a\u7ef4\u5ea6\uff0c\u53e6\u4e00\u4e2a\u4e0d\u9700\u8981\u8bbe\u7f6e\u7684\u7ef4\u5ea6\u7f6e\u4e3aNone
\u5373\u53ef\u3002width\u548cheight\u53ef\u4ee5\u4e3aint
\u6216float
, \u4e3aint
\u65f6\u4ee3\u8868width\u6216height\u7684\u7edd\u5bf9\u503c\uff0c\u4e3afloat
\u65f6\u4ee3\u8868\u76f8\u5bf9\u4e8e\u7a97\u53e3\u5927\u5c0f\u7684\u767e\u5206\u6bd4\u3002
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.scroll_to_parameter","title":"scroll_to_parameter(parameter_name: str, x: int = 50, y: int = 50, highlight_effect: bool = True)
","text":"\u6eda\u52a8\u5230\u6307\u5b9a\u53c2\u6570\u7684\u4f4d\u7f6e\u3002
Parameters:
Name Type Description Default parameter_name
str
\u53c2\u6570\u540d\u79f0
required x
int
\u6eda\u52a8\u7684X\u5750\u6807\u504f\u79fb\u503c
50
y
int
\u6eda\u52a8\u7684Y\u5750\u6807\u504f\u79fb\u503c
50
highlight_effect
bool
\u662f\u5426\u5bf9\u6307\u5b9a\u63a7\u4ef6\u663e\u793a\u9ad8\u4eae\u6548\u679c
True
Returns:
Type Description \u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_allowed_dock_areas","title":"set_allowed_dock_areas(areas: Optional[DockWidgetAreas]) -> None
","text":"\u8bbe\u7f6e\u505c\u9760\u7a97\u53e3\u5141\u8bb8\u505c\u9760\u7684\u533a\u57df
Parameters:
Name Type Description Default areas
Optional[DockWidgetAreas]
\u5141\u8bb8\u505c\u9760\u7684\u533a\u57df
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_cancel_button_text","title":"set_cancel_button_text(text: str) -> None
","text":"\u8bbe\u7f6e\u53d6\u6d88\u6309\u94ae\u6587\u672c
Parameters:
Name Type Description Default text
str
\u76ee\u6807\u6587\u672c
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_clear_button_text","title":"set_clear_button_text(text: str) -> None
","text":"\u8bbe\u7f6e\u6e05\u9664\u6309\u94ae\u6587\u672c
Parameters:
Name Type Description Default text
str
\u76ee\u6807\u6587\u672c
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_clear_button_visible","title":"set_clear_button_visible(visible: bool) -> None
","text":"\u8bbe\u7f6e\u6e05\u9664\u6309\u94ae\u662f\u5426\u53ef\u89c1
Parameters:
Name Type Description Default visible
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_clear_checkbox_checked","title":"set_clear_checkbox_checked(checked: bool) -> None
","text":"\u8bbe\u7f6e\u6e05\u9664\u9009\u9879\u6846\u662f\u5426\u9009\u4e2d
Parameters:
Name Type Description Default checked
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_clear_checkbox_text","title":"set_clear_checkbox_text(text: str) -> None
","text":"\u8bbe\u7f6e\u6e05\u9664\u9009\u9879\u6846\u6587\u672c
Parameters:
Name Type Description Default text
str
\u76ee\u6807\u6587\u672c
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_clear_checkbox_visible","title":"set_clear_checkbox_visible(visible: bool) -> None
","text":"\u8bbe\u7f6e\u6e05\u9664\u9009\u9879\u6846\u662f\u5426\u53ef\u89c1
Parameters:
Name Type Description Default visible
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_document","title":"set_document(document: str, document_format: Literal['markdown', 'html', 'plaintext']) -> None
","text":"\u8bbe\u7f6e\u51fd\u6570\u8bf4\u660e\u6587\u6863
Parameters:
Name Type Description Default document
str
\u6587\u6863\u5185\u5bb9
required document_format
Literal['markdown', 'html', 'plaintext']
\u6587\u6863\u683c\u5f0f
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_document_dock_area","title":"set_document_dock_area(area: DockWidgetArea) -> None
","text":"\u8bbe\u7f6eDocument Dock\u505c\u9760\u533a\u57df
Parameters:
Name Type Description Default area
DockWidgetArea
\u76ee\u6807\u505c\u9760\u533a\u57df
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_document_dock_floating","title":"set_document_dock_floating(floating: bool) -> None
","text":"\u8bbe\u7f6eDocument Dock\u662f\u5426\u60ac\u6d6e
Parameters:
Name Type Description Default floating
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_document_dock_property","title":"set_document_dock_property(*, title: Optional[str] = None, visible: Optional[bool] = None, floating: Optional[bool] = None, area: Optional[DockWidgetArea] = None) -> None
","text":"\u8bbe\u7f6eDocument Dock\u7684\u5c5e\u6027
Parameters:
Name Type Description Default title
Optional[str]
\u6807\u9898
None
visible
Optional[bool]
\u662f\u5426\u663e\u793a
None
floating
Optional[bool]
\u662f\u5426\u60ac\u6d6e
None
area
Optional[DockWidgetArea]
\u521d\u59cb\u505c\u9760\u533a\u57df
None
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_document_dock_title","title":"set_document_dock_title(title: str) -> None
","text":"\u8bbe\u7f6eDocument Dock\u6807\u9898
Parameters:
Name Type Description Default title
str
\u6807\u9898
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_document_dock_visible","title":"set_document_dock_visible(visible: bool) -> None
","text":"\u8bbe\u7f6eDocument Dock\u662f\u5426\u663e\u793a
Parameters:
Name Type Description Default visible
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_execute_button_text","title":"set_execute_button_text(text: str) -> None
","text":"\u8bbe\u7f6e\u6267\u884c\u6309\u94ae\u6587\u672c
Parameters:
Name Type Description Default text
str
\u76ee\u6807\u6587\u672c
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_output_dock_area","title":"set_output_dock_area(area: DockWidgetArea) -> None
","text":"\u8bbe\u7f6eOutput Dock\u505c\u9760\u533a\u57df
Parameters:
Name Type Description Default area
DockWidgetArea
\u76ee\u6807\u505c\u9760\u533a\u57df
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_output_dock_floating","title":"set_output_dock_floating(floating: bool) -> None
","text":"\u8bbe\u7f6eOutput Dock\u662f\u5426\u60ac\u6d6e
Parameters:
Name Type Description Default floating
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_output_dock_property","title":"set_output_dock_property(*, title: Optional[str] = None, visible: Optional[bool] = None, floating: Optional[bool] = None, area: Optional[DockWidgetArea] = None) -> None
","text":"\u8bbe\u7f6eOutput Dock\u7684\u5c5e\u6027
Parameters:
Name Type Description Default title
Optional[str]
\u6807\u9898
None
visible
Optional[bool]
\u662f\u5426\u663e\u793a
None
floating
Optional[bool]
\u662f\u5426\u60ac\u6d6e
None
area
Optional[DockWidgetArea]
\u521d\u59cb\u505c\u9760\u533a\u57df
None
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_output_dock_title","title":"set_output_dock_title(title: str) -> None
","text":"\u8bbe\u7f6eOutput Dock\u6807\u9898
Parameters:
Name Type Description Default title
str
\u6807\u9898
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_output_dock_visible","title":"set_output_dock_visible(visible: bool) -> None
","text":"\u8bbe\u7f6eOutput Dock\u662f\u5426\u663e\u793a
Parameters:
Name Type Description Default visible
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_parameter_value","title":"set_parameter_value(parameter_name: str, value: Any) -> None
","text":"\u8bbe\u7f6e\u53c2\u6570\u5f53\u524d\u503c
Parameters:
Name Type Description Default parameter_name
str
\u53c2\u6570\u540d\u79f0
required value
Any
\u8981\u8bbe\u7f6e\u7684\u503c
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Raises:
Type Description ParameterNotFoundError
\u82e5\u6307\u5b9a\u53c2\u6570\u4e0d\u5b58\u5728\uff0c\u5219\u5f15\u53d1\u6b64\u5f02\u5e38
ParameterError
\u82e5\u65e0\u6cd5\u5c06\u503c\u8bbe\u7f6e\u5230\u5bf9\u5e94\u7684\u63a7\u4ef6\uff0c\u90a3\u4e48\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_parameter_values","title":"set_parameter_values(values: Dict[str, Any]) -> None
","text":"\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u7684\u5f53\u524d\u503c
Parameters:
Name Type Description Default values
Dict[str, Any]
\u8981\u8bbe\u7f6e\u7684\u53c2\u6570\u540d\u79f0\u548c\u503c
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Raises:
Type Description ParameterError
\u82e5\u65e0\u6cd5\u5c06\u503c\u8bbe\u7f6e\u5230\u5bf9\u5e94\u7684\u63a7\u4ef6\uff0c\u90a3\u4e48\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.set_statusbar_visible","title":"set_statusbar_visible(visible: bool) -> None
","text":"\u8bbe\u7f6e\u7a97\u53e3\u72b6\u6001\u680f\u662f\u5426\u53ef\u89c1
Parameters:
Name Type Description Default visible
bool
\u76ee\u6807\u72b6\u6001
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.show_progressbar","title":"show_progressbar() -> None
","text":"\u663e\u793a\u8fdb\u5ea6\u6761
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.show_statusbar_message","title":"show_statusbar_message(message: str, timeout: int = 3000) -> None
","text":"\u8bbe\u7f6e\u72b6\u6001\u680f\u6d88\u606f
Parameters:
Name Type Description Default message
str
\u6d88\u606f\u6587\u672c
required timeout
int
\u663e\u793a\u7684\u65f6\u957f
3000
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.tabify_docks","title":"tabify_docks() -> None
","text":"\u4f7f\u6240\u6709Dock\u7a97\u53e3\u9009\u9879\u5361\u5316
\u6ce8\u610f\uff1a\u5f53\u524d\u5df2\u60ac\u6d6e\u7684\u7a97\u53e3\u4e0d\u53d7\u5f71\u54cd
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.try_cancel_execution","title":"try_cancel_execution() -> None
","text":"\u5c1d\u8bd5\u53d6\u6d88\u51fd\u6570\u6267\u884c
Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Raises:
Type Description FunctionNotCancellableError
\u51fd\u6570\u672a\u88ab\u8bbe\u7f6e\u4e3a\u53ef\u53d6\u6d88\u51fd\u6570\u65f6\uff0c\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
FunctionNotExecutingError
\u51fd\u6570\u672a\u5904\u4e8e\u6b63\u5728\u6267\u884c\u4e2d\u65f6\uff0c\u5c06\u5f15\u53d1\u6b64\u5f02\u5e38
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.update_progress","title":"update_progress(current_value: int, message: Optional[str] = None) -> None
","text":"\u66f4\u65b0\u8fdb\u5ea6\u6761\u8fdb\u5ea6
Parameters:
Name Type Description Default current_value
int
\u5f53\u524d\u8fdb\u5ea6
required message
Optional[str]
\u989d\u5916\u4fe1\u606f
None
Returns:
"},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.FnExecuteWindow.update_progressbar_config","title":"update_progressbar_config(config: Union[ProgressBarConfig, dict, None]) -> None
","text":"\u66f4\u65b0\u8fdb\u5ea6\u6761\u914d\u7f6e
Parameters:
Name Type Description Default config
Union[ProgressBarConfig, dict, None]
\u8fdb\u5ea6\u6761\u914d\u7f6e
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnexec/#_1","title":"\u7c7b\u578b\u4e0e\u5e38\u91cf","text":""},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.DockWidgetArea","title":"DockWidgetArea = Qt.DockWidgetArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.NoDockWidgetArea","title":"NoDockWidgetArea = Qt.DockWidgetArea.NoDockWidgetArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.BottomDockWidgetArea","title":"BottomDockWidgetArea = Qt.DockWidgetArea.BottomDockWidgetArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.TopDockWidgetArea","title":"TopDockWidgetArea = Qt.DockWidgetArea.TopDockWidgetArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.LeftDockWidgetArea","title":"LeftDockWidgetArea = Qt.DockWidgetArea.LeftDockWidgetArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.RightDockWidgetArea","title":"RightDockWidgetArea = Qt.DockWidgetArea.RightDockWidgetArea
module-attribute
","text":""},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.DockWidgetAreas","title":"DockWidgetAreas = Union[DockWidgetArea, int]
module-attribute
","text":""},{"location":"apis/pyguiadapter.windows.fnexec/#pyguiadapter.windows.fnexec.AllDockWidgetAreas","title":"AllDockWidgetAreas = Qt.AllDockWidgetAreas
module-attribute
","text":""},{"location":"apis/pyguiadapter.windows.fnselect/","title":"pyguiadapter.windows.fnselect","text":""},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig","title":"FnSelectWindowConfig
dataclass
","text":" Bases: BaseWindowConfig
Source code in pyguiadapter\\windows\\fnselect\\_window.py
@dataclasses.dataclass(frozen=True)\nclass FnSelectWindowConfig(BaseWindowConfig):\n title: str = \"Select Function\"\n \"\"\"\u7a97\u53e3\u6807\u9898\"\"\"\n\n size: Union[Tuple[int, int], QSize] = (800, 600)\n \"\"\"\u7a97\u53e3\u5c3a\u5bf8\"\"\"\n\n select_button_text: str = \"Select\"\n \"\"\"\u9009\u62e9\u6309\u94ae\u6587\u5b57\"\"\"\n\n icon_mode: bool = False\n \"\"\"\u51fd\u6570\u5217\u8868\u662f\u5426\u542f\u7528\u56fe\u6807\u6a21\u5f0f\"\"\"\n\n icon_size: Union[Tuple[int, int], int, QSize, None] = DEFAULT_FN_ICON_SIZE\n \"\"\"\u51fd\u6570\u56fe\u6807\u5927\u5c0f\"\"\"\n\n default_fn_group_name: str = \"Main Functions\"\n \"\"\"\u9ed8\u8ba4\u51fd\u6570\u5206\u7ec4\u540d\u79f0\"\"\"\n\n default_fn_group_icon: IconType = None\n \"\"\"\u9ed8\u8ba4\u51fd\u6570\u5206\u7ec4\u56fe\u6807\"\"\"\n\n fn_group_icons: Dict[str, IconType] = dataclasses.field(default_factory=dict)\n \"\"\"\u5176\u4ed6\u51fd\u6570\u5206\u7ec4\u56fe\u6807\"\"\"\n\n document_browser_config: Optional[DocumentBrowserConfig] = None\n \"\"\"\u6587\u6863\u6d4f\u89c8\u5668\u914d\u7f6e\"\"\"\n\n document_browser_width: int = 490\n \"\"\"\u6587\u6863\u6d4f\u89c8\u5668\u5bbd\u5ea6\"\"\"\n
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.default_fn_group_icon","title":"default_fn_group_icon: IconType = None
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u51fd\u6570\u5206\u7ec4\u56fe\u6807
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.default_fn_group_name","title":"default_fn_group_name: str = 'Main Functions'
class-attribute
instance-attribute
","text":"\u9ed8\u8ba4\u51fd\u6570\u5206\u7ec4\u540d\u79f0
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.document_browser_config","title":"document_browser_config: Optional[DocumentBrowserConfig] = None
class-attribute
instance-attribute
","text":"\u6587\u6863\u6d4f\u89c8\u5668\u914d\u7f6e
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.document_browser_width","title":"document_browser_width: int = 490
class-attribute
instance-attribute
","text":"\u6587\u6863\u6d4f\u89c8\u5668\u5bbd\u5ea6
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.fn_group_icons","title":"fn_group_icons: Dict[str, IconType] = dataclasses.field(default_factory=dict)
class-attribute
instance-attribute
","text":"\u5176\u4ed6\u51fd\u6570\u5206\u7ec4\u56fe\u6807
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.icon_mode","title":"icon_mode: bool = False
class-attribute
instance-attribute
","text":"\u51fd\u6570\u5217\u8868\u662f\u5426\u542f\u7528\u56fe\u6807\u6a21\u5f0f
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.icon_size","title":"icon_size: Union[Tuple[int, int], int, QSize, None] = DEFAULT_FN_ICON_SIZE
class-attribute
instance-attribute
","text":"\u51fd\u6570\u56fe\u6807\u5927\u5c0f
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.select_button_text","title":"select_button_text: str = 'Select'
class-attribute
instance-attribute
","text":"\u9009\u62e9\u6309\u94ae\u6587\u5b57
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.size","title":"size: Union[Tuple[int, int], QSize] = (800, 600)
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u5c3a\u5bf8
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindowConfig.title","title":"title: str = 'Select Function'
class-attribute
instance-attribute
","text":"\u7a97\u53e3\u6807\u9898
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindow","title":"FnSelectWindow
","text":" Bases: BaseWindow
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindow.get_group_names","title":"get_group_names() -> List[str]
","text":"\u83b7\u53d6\u6240\u6709\u51fd\u6570\u5206\u7ec4\u540d\u79f0\u3002
Returns:
Type Description List[str]
\u8fd4\u56de\u51fd\u6570\u5206\u7ec4\u540d\u79f0\u5217\u8868\u3002
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindow.get_select_button_text","title":"get_select_button_text() -> str
","text":"\u83b7\u53d6\u9009\u62e9\u6309\u94ae\u6587\u5b57\u3002
Returns:
Type Description str
\u8fd4\u56de\u5f53\u524d\u9009\u62e9\u6309\u94ae\u4e0a\u7684\u6587\u5b57\u3002
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindow.remove_group","title":"remove_group(group_name: Optional[str]) -> None
","text":"\u79fb\u9664\u6307\u5b9a\u51fd\u6570\u5206\u7ec4\u3002
Parameters:
Name Type Description Default group_name
Optional[str]
\u5f85\u79fb\u9664\u7684\u51fd\u6570\u5206\u7ec4\u540d\u79f0\u3002
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
Raises:
Type Description ValueError
\u5f53\u6307\u5b9a\u51fd\u6570\u5206\u7ec4\u540d\u79f0\u4e0d\u5b58\u5728\u65f6\uff0c\u5c06\u629b\u51faValueError
\u3002
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindow.set_document_browser_width","title":"set_document_browser_width(width: int) -> None
","text":"\u8bbe\u7f6e\u6587\u6863\u6d4f\u89c8\u5668\u5bbd\u5ea6\u3002
Parameters:
Name Type Description Default width
int
\u76ee\u6807\u5bbd\u5ea6
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows.fnselect/#pyguiadapter.windows.fnselect.FnSelectWindow.set_select_button_text","title":"set_select_button_text(text: str) -> None
","text":"\u8bbe\u7f6e\u9009\u62e9\u6309\u94ae\u6587\u5b57\u3002
Parameters:
Name Type Description Default text
str
\u5e26\u8bbe\u7f6e\u7684\u6587\u5b57
required Returns:
Type Description None
\u65e0\u8fd4\u56de\u503c
"},{"location":"apis/pyguiadapter.windows/","title":"pyguiadapter.windows","text":""},{"location":"apis/pyguiadapter.windows/#pyguiadapter.windows.DocumentBrowserConfig","title":"DocumentBrowserConfig
dataclass
","text":" Bases: TextBrowserConfig
\u6587\u6863\u6d4f\u89c8\u5668\u914d\u7f6e\u7c7b\u3002
Source code in pyguiadapter\\windows\\document_browser.py
@dataclasses.dataclass\nclass DocumentBrowserConfig(TextBrowserConfig):\n \"\"\"\u6587\u6863\u6d4f\u89c8\u5668\u914d\u7f6e\u7c7b\u3002\"\"\"\n\n text_color: str = COLOR_PRIMARY_TEXT\n background_color: str = COLOR_PAGE_BACKGROUND\n line_wrap_mode: LineWrapMode = LineWrapMode.WidgetWidth\n\n parameter_anchor: bool = False\n \"\"\"\u662f\u5426\u542f\u7528\u53c2\u6570\u951a\u70b9\u3002\u5f53\u542f\u7528\u65f6\uff0c\u7528\u6237\u70b9\u51fb\u6587\u6863\u4e2d\u7684\u53c2\u6570\u951a\u70b9\uff0c\u4f1a\u81ea\u52a8\u8df3\u8f6c\u5230\u5bf9\u5e94\u7684\u53c2\u6570\u63a7\u4ef6\u5904\u3002\"\"\"\n\n parameter_anchor_pattern: str = r\"^#\\s*param\\s*=\\s*([\\w]+)\\s*$\"\n \"\"\"\u53c2\u6570\u951a\u70b9\u7684\u683c\u5f0f\u3002\u9ed8\u8ba4\u683c\u5f0f\u4e3a\uff1a#param=\u53c2\u6570\u540d\u3002\"\"\"\n\n group_anchor: bool = False\n \"\"\"\u662f\u5426\u542f\u7528\u53c2\u6570\u5206\u7ec4\u951a\u70b9\u3002\u5f53\u542f\u7528\u65f6\uff0c\u7528\u6237\u70b9\u51fb\u6587\u6863\u4e2d\u7684\u53c2\u6570\u5206\u7ec4\u951a\u70b9\uff0c\u4f1a\u81ea\u52a8\u5c55\u5f00\u5bf9\u5e94\u7684\u53c2\u6570\u5206\u7ec4\u3002\"\"\"\n\n group_anchor_pattern: str = r\"^#\\s*group\\s*=\\s*([\\w\\W\\s]*)\\s*$\"\n \"\"\"\u53c2\u6570\u5206\u7ec4\u951a\u70b9\u7684\u683c\u5f0f\u3002\u9ed8\u8ba4\u683c\u5f0f\u4e3a\uff1a#group=\u5206\u7ec4\u540d\u3002\"\"\"\n
"},{"location":"apis/pyguiadapter.windows/#pyguiadapter.windows.DocumentBrowserConfig.group_anchor","title":"group_anchor: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u53c2\u6570\u5206\u7ec4\u951a\u70b9\u3002\u5f53\u542f\u7528\u65f6\uff0c\u7528\u6237\u70b9\u51fb\u6587\u6863\u4e2d\u7684\u53c2\u6570\u5206\u7ec4\u951a\u70b9\uff0c\u4f1a\u81ea\u52a8\u5c55\u5f00\u5bf9\u5e94\u7684\u53c2\u6570\u5206\u7ec4\u3002
"},{"location":"apis/pyguiadapter.windows/#pyguiadapter.windows.DocumentBrowserConfig.group_anchor_pattern","title":"group_anchor_pattern: str = '^#\\\\s*group\\\\s*=\\\\s*([\\\\w\\\\W\\\\s]*)\\\\s*$'
class-attribute
instance-attribute
","text":"\u53c2\u6570\u5206\u7ec4\u951a\u70b9\u7684\u683c\u5f0f\u3002\u9ed8\u8ba4\u683c\u5f0f\u4e3a\uff1a#group=\u5206\u7ec4\u540d\u3002
"},{"location":"apis/pyguiadapter.windows/#pyguiadapter.windows.DocumentBrowserConfig.parameter_anchor","title":"parameter_anchor: bool = False
class-attribute
instance-attribute
","text":"\u662f\u5426\u542f\u7528\u53c2\u6570\u951a\u70b9\u3002\u5f53\u542f\u7528\u65f6\uff0c\u7528\u6237\u70b9\u51fb\u6587\u6863\u4e2d\u7684\u53c2\u6570\u951a\u70b9\uff0c\u4f1a\u81ea\u52a8\u8df3\u8f6c\u5230\u5bf9\u5e94\u7684\u53c2\u6570\u63a7\u4ef6\u5904\u3002
"},{"location":"apis/pyguiadapter.windows/#pyguiadapter.windows.DocumentBrowserConfig.parameter_anchor_pattern","title":"parameter_anchor_pattern: str = '^#\\\\s*param\\\\s*=\\\\s*([\\\\w]+)\\\\s*$'
class-attribute
instance-attribute
","text":"\u53c2\u6570\u951a\u70b9\u7684\u683c\u5f0f\u3002\u9ed8\u8ba4\u683c\u5f0f\u4e3a\uff1a#param=\u53c2\u6570\u540d\u3002
"}]}
\ No newline at end of file