OMC::Application Class Referenceabstract

Detailed Description

The object representing the overall running application at the base level.

The top level object, representing the currently running application, Harmony, Storyboard or Control Center. Generally provided from the main Python module's session.

Public Member Functions

void process_one_event ()
 Processes the next event in the application's event queue. More...
 
void log (const QString &log) const
 Write to the application's Message Log; defaults to a trace_level log. More...
 
void log (const QString &log, const QString &level) const
 Write to the application's Message Log with different levels as an option. More...
 
void trace (const QString &log) const
 Write to the application's Message Log as trace output.
 
void debug (const QString &log) const
 Write to the application's Message Log as debug output.
 
void error (const QString &log) const
 Write to the application's Message Log as error output.
 

Public Attributes

OMC::Projectproject
 Get the active project from the instance of the application.
 
OMC::Aboutabout
 Get the active about details from the instance of the application.
 
OMC::Preferencespreferences
 Get the active preferences from the instance of the application.
 
OMC::Actionsactions
 Get the application's actions.
 
OMC::ViewList * views
 Get the application's available views.
 
OMC::ToolList * tools
 Get the application's available tools.
 
OMC::InterfaceManager * interfaces
 Get the DOM interface manager.
 

Member Function Documentation

◆ log() [1/2]

void OMC::Application::log ( const QString &  log) const

Write to the application's Message Log; defaults to a trace_level log.

from ToonBoom import harmony #Import the Harmony Module
session = harmony.session()
session.log( "Hello World!" ) #Expectation: Hello World appears in the MessageLog's view.

◆ log() [2/2]

void OMC::Application::log ( const QString &  log,
const QString &  level 
) const

Write to the application's Message Log with different levels as an option.

The Message Log supports three levels of output, which can be specified in this function.

Available log levels include:

  • trace : The standard trace output in the MessageLog view.
  • debug : The debug output in the MessageLog view, only available when the Application's debug mode is enabled.
  • error : The error output in the MessageLog view, as well as a critical error popup window.
from ToonBoom import harmony #Import the Harmony Module
session = harmony.session()
session.log( "Hello Debug World!", "debug" ) #Expectation: Hello World appears in the MessageLog's view.

◆ process_one_event()

void OMC::Application::process_one_event ( )

Processes the next event in the application's event queue.

In the event that the script requires updates in the GUI, process_one_event() will ublock the application from the current script and run the next event in the application queue.

from ToonBoom import harmony #Import the Harmony Module
session = harmony.session()
actions = session.actions
actions.perform( "actionThatRequiresGUI" )
session.process_one_event()
Inheritance diagram for OMC::Application:
Collaboration diagram for OMC::Application: