跳转至

pyguiadapter.adapter.udialog

模块级方法

show_info_messagebox(text: str, title: str = 'Information', buttons: Union[StandardButton, int] = Ok, default_button: Union[StandardButton, int] = Ok, **kwargs) -> Union[int, StandardButton]

弹出Information消息对话框。

Parameters:

Name Type Description Default
text str

消息文本

required
title str

对话框标题

'Information'
buttons Union[StandardButton, int]

对话框的按钮

Ok
default_button Union[StandardButton, int]

默认按钮

Ok
**kwargs

其他参数

{}

Returns:

Type Description
Union[int, StandardButton]

返回用户按下的按钮。

show_warning_messagebox(text: str, title: str = 'Warning', buttons: Union[StandardButton, int] = Ok, default_button: Union[StandardButton, int] = Ok, **kwargs) -> Union[int, StandardButton]

弹出Warning消息对话框。

Parameters:

Name Type Description Default
text str

消息文本

required
title str

对话框标题

'Warning'
buttons Union[StandardButton, int]

对话框的按钮

Ok
default_button Union[StandardButton, int]

默认按钮

Ok
**kwargs

其他参数

{}

Returns:

Type Description
Union[int, StandardButton]

返回用户按下的按钮。

show_critical_messagebox(text: str, title: str = 'Critical', buttons: Union[StandardButton, int] = Ok, default_button: Union[StandardButton, int] = NoButton, **kwargs) -> Union[int, StandardButton]

弹出Critical消息对话框。

Parameters:

Name Type Description Default
text str

消息文本

required
title str

对话框标题

'Critical'
buttons Union[StandardButton, int]

对话框的按钮

Ok
default_button Union[StandardButton, int]

默认按钮

NoButton
**kwargs

其他参数

{}

Returns:

Type Description
Union[int, StandardButton]

返回用户按下的按钮。

show_question_messagebox(text: str, title: str = 'Question', buttons: Union[StandardButton, int] = Yes | No, default_button: Union[StandardButton, int] = NoButton, **kwargs) -> Union[int, StandardButton]

弹出Question消息对话框。

Parameters:

Name Type Description Default
text str

消息文本

required
title str

对话框标题

'Question'
buttons Union[StandardButton, int]

对话框的按钮

Yes | No
default_button Union[StandardButton, int]

默认按钮

NoButton
**kwargs

其他参数

{}

Returns:

Type Description
Union[int, StandardButton]

返回用户按下的按钮。

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

显示多行文本内容。

Parameters:

Name Type Description Default
text_content str

文本内容

required
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

Returns:

Type Description
None

无返回值

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

展示文本文件内容。

Parameters:

Name Type Description Default
text_file str

文本文件路径

required
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

Returns:

Type Description
None

无返回值

show_custom_dialog(dialog_class: Type[BaseCustomDialog], **kwargs) -> Any

弹出自定义对话框。

Parameters:

Name Type Description Default
dialog_class Type[BaseCustomDialog]

自定义对话框类

required
**kwargs

自定义对话框初始化参数

{}

Returns:

Type Description
Any

返回自定义对话框show_and_get_result()函数的返回值。