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

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


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

Текст документации сгенерирован автоматически из исходного кода.
Если обнаружили ошибку, отправьте об этом сообщение на 📧почту.

Module: utils

Functions

create_param_property

def create_param_property(attr_name: str, validate_value: bool = True, update_widget: bool = True, doc: str = None) -> property

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:

def Resetter.__init__(widget: QWidget, property: Optional[Property] = None)

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] — reference to widget owner

Properties

child_widget
@property
def child_widget() -> QWidget

Returns child widget

Returns:

  • QWidget — reference to child widget

Methods

set_reset_btn_visibility
def set_reset_btn_visibility(visibility: bool)

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
def update_reset_btn_visibility()

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.
products/pyrog/api/lastest/types/properties/utils.txt · Последнее изменение: 127.0.0.1