Инструменты пользователя

Инструменты сайта


products:pyrog:api:lastest:types:properties:utils

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

products:pyrog:api:lastest:types:properties:utils [2026/05/15 20:49] – создано - внешнее изменение 127.0.0.1products:pyrog:api:lastest:types:properties:utils [2026/08/14 13:32] (текущий) – удалено - внешнее изменение (Дата неизвестна) 127.0.0.1
Строка 1: Строка 1:
-~~NOTOC~~ 
-<WRAP center round info 80%> 
-Текст документации сгенерирован автоматически из [[https://github.com/iron-mesh/Pyrog|исходного кода]].\\ 
-Если обнаружили ошибку, отправьте об этом сообщение на [[feedback@ironmesh.ru|📧почту]]. 
-</WRAP> 
- 
-====== Module: utils ====== 
- 
- 
-===== Functions ===== 
- 
- 
-==== create_param_property ==== 
- 
- 
-<code python>def create_param_property(attr_name: str, validate_value: bool = True, update_widget: bool = True, doc: str = None) -> property</code> 
- 
-Creates property for parameter specified in [_param_schema] 
- 
-**Parameters:** 
- 
-  * **attr_name**: //str// — name of parameter specified in _param_schema 
-  * **validate_value**: //bool// — do value validation after property setting 
-  * **update_widget**: //bool// — update widget after property setting 
-  * **doc**: //str// — docstring of property 
- 
-**Returns:** 
-  * //property// — property for read/write a parameter 
- 
-===== Classes ===== 
- 
- 
-==== Resetter ==== 
- 
- 
-**Inherits:** QWidget 
- 
- 
-Provides wrapper for child widget, adds reset button on the left side. 
- 
-**Attributes:** 
- 
-  * **reset_requested**: //Signal// — Occurs if reset button has been clicked 
- 
-**Constructor:** 
- 
-<code python>def Resetter.__init__(widget: QWidget, property: Optional[Property] = None)</code> 
- 
-Creates an instance of wrapper for child widget. 
- 
-Creates reset button on the right side of property widget, it's hidden by default. 
-Set reference to widget owner to use update_reset_btn_visibility() method. 
- 
-**Parameters:** 
- 
-  * **widget**: //QWidget// — original child widget 
-  * **property**: //Optional%%[%%[[.:property#property|Property]]%%]%%// — reference to widget owner 
- 
- 
-=== Properties === 
- 
- 
-== child_widget == 
- 
- 
-<code python>@property 
-def child_widget() -> QWidget</code> 
- 
-Returns child widget 
- 
-**Returns:** 
-  * //QWidget// — reference to child widget 
- 
- 
-=== Methods === 
- 
- 
-== set_reset_btn_visibility == 
- 
- 
-<code python>def set_reset_btn_visibility(visibility: bool)</code> 
- 
-Sets reset button visibility 
- 
-**Parameters:** 
- 
-  * **visibility**: //bool// — set visibility to the reset button True: show reset button False: hide reset button 
- 
- 
-== update_reset_btn_visibility == 
- 
- 
-<code python>def update_reset_btn_visibility()</code> 
- 
-Updates reset button visibility 
- 
-Compares default value and value of property and sets reset button visible if they are not equal and invisible otherwise. Takes into account state of show_reset_btn flag. 
-Following properties must be included into widget owner: value, default_value, show_reset_btn 
- 
-**Raises:** 
-  * **AttributeError** — if widget owner is not specified.