Uranium
Application Framework
UM.Qt.QtApplication.QtApplication Class Reference

Application subclass that provides a Qt application object. More...

Inheritance diagram for UM.Qt.QtApplication.QtApplication:
UM.Application.Application

Public Member Functions

def __init__ (self, tray_icon_name=None, kwargs)
 
def recentFiles (self)
 
def run (self)
 
def hideMessage (self, message)
 
def showMessage (self, message)
 
def showToastMessage
 
def setMainQml (self, path)
 
def initializeEngine (self)
 
def exec_ (self, args, kwargs)
 
def reloadQML (self)
 
def purgeWindows (self)
 
def isShuttingDown (self)
 
def registerObjects (self, engine)
 
def getRenderer (self)
 
def addCommandLineOptions (self, parser, parsed_command_line={})
 
def getMainWindow (self)
 
def setMainWindow (self, window)
 
def setVisible (self, visible)
 
def isVisible (self)
 
def getTheme (self)
 
def functionEvent (self, event)
 
def event (self, event)
 
def windowClosed (self)
 
def checkWindowMinimizedState (self)
 
def getBackend (self)
 
def backend (self)
 
def loadQtTranslation (self, file_name, language="default")
 Load a Qt translation catalog. More...
 
def createSplash (self)
 
def showSplashMessage (self, message)
 Display text on the splash screen. More...
 
def closeSplash (self)
 Close the splash screen after the application has started. More...
 
def createQmlComponent
 Create a QML component from a qml file. More...
 
- Public Member Functions inherited from UM.Application.Application
def __init__
 Init method. More...
 
def getContainerRegistry (self)
 
def setGlobalContainerStack
 
def getGlobalContainerStack (self)
 
def hideMessage (self, message)
 
def showMessage (self, message)
 
def showToastMessage
 
def getVersion (self)
 Get the version of the application. More...
 
def getStaticVersion (cls)
 
def getBuildType (self)
 Get the buildtype of the application. More...
 
def getIsDebugMode (self)
 
def hideMessageById (self, message_id)
 Hide message by ID (as provided by built-in id function) More...
 
def getVisibleMessages (self)
 Get list of all visible messages. More...
 
def getCommandLineOption (self, name, default=None)
 
def getApplicationName (self)
 Get name of the application. More...
 
def getApplicationLanguage (self)
 Get the currently used IETF language tag. More...
 
def getRequiredPlugins (self)
 Application has a list of plugins that it must have. More...
 
def setRequiredPlugins
 Set the plugins that the application must have in order to function. More...
 
def setBackend
 Set the backend of the application (the program that does the heavy lifting). More...
 
def getBackend (self)
 Get the backend of the application (the program that does the heavy lifting). More...
 
def getPluginRegistry (self)
 Get the PluginRegistry of this application. More...
 
def getController (self)
 Get the Controller of this application. More...
 
def getMeshFileHandler (self)
 Get the MeshFileHandler of this application. More...
 
def getWorkspaceFileHandler (self)
 
def getOperationStack (self)
 
def getOutputDeviceManager (self)
 
def preRun (self)
 Includes eg. More...
 
def run (self)
 Run the main event loop. More...
 
def getRenderer (self)
 Return an application-specific Renderer object. More...
 
def functionEvent (self, event)
 Post a function event onto the event loop. More...
 
def callLater
 Call a function the next time the event loop runs. More...
 
def getMainThread (self)
 Get the application"s main thread. More...
 
def getInstance (cls, kwargs)
 Return the singleton instance of the application object.
 
def getCommandlineParser (self, with_help=False)
 
def parseCommandLine (self)
 
def addCommandLineOptions (cls, parser, parsed_command_line={})
 Can be overridden to add additional command line options to the parser. More...
 
def addExtension
 
def getExtensions (self)
 

Static Public Attributes

 pluginsLoaded = Signal()
 
 applicationRunning = Signal()
 
 recentFilesChanged = pyqtSignal()
 
 notify
 
 engineCreatedSignal = Signal()
 
 mainWindowChanged = Signal()
 
 result
 Get the backend of the application (the program that does the heavy lifting). More...
 
 constant
 Property used to expose the backend It is made static as the backend is not supposed to change during runtime. More...
 
 splash = None
 Create a class variable so we can manage the splash in the CrashHandler dialog when the Application instance is not yet created, e.g. More...
 
- Static Public Attributes inherited from UM.Application.Application
 applicationShuttingDown = Signal()
 Emitted when the application window was closed and we need to shut down the application.
 
 showMessageSignal = Signal()
 
 hideMessageSignal = Signal()
 
 globalContainerStackChanged = Signal()
 
 workspaceLoaded = Signal()
 
 visibleMessageAdded = Signal()
 
 visibleMessageRemoved = Signal()
 

Additional Inherited Members

- Static Public Member Functions inherited from UM.Application.Application
def getInstallPrefix ()
 
- Public Attributes inherited from UM.Application.Application
 default_theme
 

Detailed Description

Application subclass that provides a Qt application object.

Member Function Documentation

◆ closeSplash()

def UM.Qt.QtApplication.QtApplication.closeSplash (   self)

Close the splash screen after the application has started.

◆ createQmlComponent()

def UM.Qt.QtApplication.QtApplication.createQmlComponent (   self,
  qml_file_path 
)

Create a QML component from a qml file.

Parameters
qml_file_pathThe absolute file path to the root qml file.
context_propertiesOptional dictionary containing the properties that will be set on the context of the qml instance before creation.
Returns
None in case the creation failed (qml error), else it returns the qml instance.
Note
If the creation fails, this function will ensure any errors are logged to the logging service.

◆ loadQtTranslation()

def UM.Qt.QtApplication.QtApplication.loadQtTranslation (   self,
  file_name,
  language = "default" 
)

Load a Qt translation catalog.

This method will locate, load and install a Qt message catalog that can be used by Qt's translation system, like qsTr() in QML files.

Parameters
file_nameThe file name to load, without extension. It will be searched for in the i18nLocation Resources directory. If it can not be found a warning will be logged but no error will be thrown.
languageThe language to load translations for. This can be any valid language code or 'default' in which case the language is looked up based on system locale. If the specified language can not be found, this method will fall back to loading the english translations file.
Note
When language is default, the language to load can be changed with the environment variable "LANGUAGE".

◆ showSplashMessage()

def UM.Qt.QtApplication.QtApplication.showSplashMessage (   self,
  message 
)

Display text on the splash screen.

Member Data Documentation

◆ constant

UM.Qt.QtApplication.QtApplication.constant
static

Property used to expose the backend It is made static as the backend is not supposed to change during runtime.

This makes the connection between backend and QML more reliable than the pyqtSlot above.

Returns
Backend Backend

◆ result

UM.Qt.QtApplication.QtApplication.result
static

Get the backend of the application (the program that does the heavy lifting).

The backend is also a QObject, which can be used from qml.

Returns
Backend Backend

◆ splash

UM.Qt.QtApplication.QtApplication.splash = None
static

Create a class variable so we can manage the splash in the CrashHandler dialog when the Application instance is not yet created, e.g.

when an error occurs during the initialization


The documentation for this class was generated from the following file: