Skip to content

HistoryState

Qt Base Class: QHistoryState

Signature: QHistoryState(self, parent: Optional[PySide6.QtStateMachine.QState] = None) -> None QHistoryState(self, type: PySide6.QtStateMachine.QHistoryState.HistoryType, parent: Optional[PySide6.QtStateMachine.QState] = None) -> None

Base classes

Name Children Inherits
AbstractStateMixin
prettyqt.statemachine.abstractstate
QHistoryState
PySide6.QtStateMachine
QHistoryState(self, parent: Optional[PySide6.QtStateMachine.QState] \= None) -> None

⋔ Inheritance diagram

graph TD
  1473374538448["statemachine.HistoryState"]
  1473374532592["statemachine.AbstractStateMixin"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473374495504["QtStateMachine.QHistoryState"]
  1473374523808["QtStateMachine.QAbstractState"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473374532592 --> 1473374538448
  1473299815024 --> 1473374532592
  140713234304496 --> 1473299815024
  1473374495504 --> 1473374538448
  1473374523808 --> 1473374495504
  1473288842240 --> 1473374523808
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: AbstractStateMixin, QHistoryState

Source code in prettyqt\statemachine\historystate.py
class HistoryState(statemachine.AbstractStateMixin, statemachine.QHistoryState):
    def set_history_type(
        self, typ: HistoryTypeStr | statemachine.QHistoryState.HistoryType
    ):
        """Set history type to use.

        Args:
            typ: history type to use
        """
        self.setHistoryType(HISTORY_TYPE.get_enum_value(typ))

    def get_history_type(self) -> HistoryTypeStr:
        """Return current history type.

        Returns:
            history type
        """
        return HISTORY_TYPE.inverse[self.historyType()]

get_history_type() -> HistoryTypeStr

Return current history type.

Source code in prettyqt\statemachine\historystate.py
def get_history_type(self) -> HistoryTypeStr:
    """Return current history type.

    Returns:
        history type
    """
    return HISTORY_TYPE.inverse[self.historyType()]

set_history_type(typ: HistoryTypeStr | statemachine.QHistoryState.HistoryType)

Set history type to use.

Parameters:

Name Type Description Default
typ HistoryTypeStr | HistoryType

history type to use

required
Source code in prettyqt\statemachine\historystate.py
def set_history_type(
    self, typ: HistoryTypeStr | statemachine.QHistoryState.HistoryType
):
    """Set history type to use.

    Args:
        typ: history type to use
    """
    self.setHistoryType(HISTORY_TYPE.get_enum_value(typ))

⌗ Property table

Qt Property Type Doc
objectName QString
active bool
defaultState QAbstractState
defaultTransition QAbstractTransition
historyType QHistoryState::HistoryType