Module AggiEngine.application

Expand source code
from typing import Optional

from PySide2.QtWidgets import QApplication

from . import State
from .mainwindow import MainWindow


class Application(QApplication):
    """
    This is the core class of an AggiEngine application.
    """

    def __init__(self, state: State, screenFps: Optional[float] = 120, fixedFps: Optional[float] = 60,
                 args: Optional[list] = None) -> None:
        """
        Creates and initializes QWidgets for the application to start.
        ``state:`` The initial state to launch the Application with    
        ``args:`` System arguments passed in    
        ``config:`` Set application parameters    
        """
        if args:
            super(Application, self).__init__(args)
        else:
            super(Application, self).__init__()

        self.window = MainWindow(self, state, screenFps, fixedFps)

    def run(self) -> None:
        """
        Execute the application, this will start the passed State
        """
        self.window.start()
        self.window.show()
        self.exec_()

Classes

class Application (state: State, screenFps: typing.Union[float, NoneType] = 120, fixedFps: typing.Union[float, NoneType] = 60, args: typing.Union[list, NoneType] = None)

This is the core class of an AggiEngine application.

Creates and initializes QWidgets for the application to start. state: The initial state to launch the Application with
args: System arguments passed in
config: Set application parameters

Expand source code
class Application(QApplication):
    """
    This is the core class of an AggiEngine application.
    """

    def __init__(self, state: State, screenFps: Optional[float] = 120, fixedFps: Optional[float] = 60,
                 args: Optional[list] = None) -> None:
        """
        Creates and initializes QWidgets for the application to start.
        ``state:`` The initial state to launch the Application with    
        ``args:`` System arguments passed in    
        ``config:`` Set application parameters    
        """
        if args:
            super(Application, self).__init__(args)
        else:
            super(Application, self).__init__()

        self.window = MainWindow(self, state, screenFps, fixedFps)

    def run(self) -> None:
        """
        Execute the application, this will start the passed State
        """
        self.window.start()
        self.window.show()
        self.exec_()

Ancestors

  • PySide2.QtWidgets.QApplication
  • PySide2.QtGui.QGuiApplication
  • PySide2.QtCore.QCoreApplication
  • PySide2.QtCore.QObject
  • Shiboken.Object

Class variables

var staticMetaObject

Methods

def run(self) ‑> NoneType

Execute the application, this will start the passed State

Expand source code
def run(self) -> None:
    """
    Execute the application, this will start the passed State
    """
    self.window.start()
    self.window.show()
    self.exec_()