products:pyrog:api:lastest:types:properties:utils
Различия
Показаны различия между двумя версиями страницы.
| products:pyrog:api:lastest:types:properties:utils [2026/05/15 20:49] – создано - внешнее изменение 127.0.0.1 | products:pyrog:api:lastest:types:properties:utils [2026/08/14 13:32] (текущий) – удалено - внешнее изменение (Дата неизвестна) 127.0.0.1 | ||
|---|---|---|---|
| Строка 1: | Строка 1: | ||
| - | ~~NOTOC~~ | ||
| - | <WRAP center round info 80%> | ||
| - | Текст документации сгенерирован автоматически из [[https:// | ||
| - | Если обнаружили ошибку, | ||
| - | </ | ||
| - | |||
| - | ====== Module: utils ====== | ||
| - | |||
| - | |||
| - | ===== Functions ===== | ||
| - | |||
| - | |||
| - | ==== create_param_property ==== | ||
| - | |||
| - | |||
| - | <code python> | ||
| - | |||
| - | Creates property for parameter specified in [_param_schema] | ||
| - | |||
| - | **Parameters: | ||
| - | |||
| - | * **attr_name**: | ||
| - | * **validate_value**: | ||
| - | * **update_widget**: | ||
| - | * **doc**: //str// — docstring of property | ||
| - | |||
| - | **Returns: | ||
| - | * // | ||
| - | |||
| - | ===== Classes ===== | ||
| - | |||
| - | |||
| - | ==== Resetter ==== | ||
| - | |||
| - | |||
| - | **Inherits: | ||
| - | |||
| - | |||
| - | Provides wrapper for child widget, adds reset button on the left side. | ||
| - | |||
| - | **Attributes: | ||
| - | |||
| - | * **reset_requested**: | ||
| - | |||
| - | **Constructor: | ||
| - | |||
| - | <code python> | ||
| - | |||
| - | 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**: | ||
| - | |||
| - | |||
| - | === Properties === | ||
| - | |||
| - | |||
| - | == child_widget == | ||
| - | |||
| - | |||
| - | <code python> | ||
| - | def child_widget() -> QWidget</ | ||
| - | |||
| - | Returns child widget | ||
| - | |||
| - | **Returns: | ||
| - | * //QWidget// — reference to child widget | ||
| - | |||
| - | |||
| - | === Methods === | ||
| - | |||
| - | |||
| - | == set_reset_btn_visibility == | ||
| - | |||
| - | |||
| - | <code python> | ||
| - | |||
| - | Sets reset button visibility | ||
| - | |||
| - | **Parameters: | ||
| - | |||
| - | * **visibility**: | ||
| - | |||
| - | |||
| - | == update_reset_btn_visibility == | ||
| - | |||
| - | |||
| - | <code python> | ||
| - | |||
| - | 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, | ||
| - | |||
| - | **Raises:** | ||
| - | * **AttributeError** — if widget owner is not specified. | ||