Gazebo Gui

API Reference

7.2.2

A Gazebo GUI application loads a QML engine and provides an API to load plugins and configuration files. The application supports either running a single main window or several plugins as standalone dialogs. More...

#include <Application.hh>

Public Slots

void OnPluginClose ()
 Callback when user requests to close a plugin. More...
 

Signals

void PluginAdded (const QString &_objectName)
 Notify that a plugin has been added. More...
 

Public Member Functions

 Application (int &_argc, char **_argv, const WindowType _type=WindowType::kMainWindow)
 Constructor. More...
 
virtual ~Application ()
 Destructor. More...
 
void AddPluginPath (const std::string &_path)
 Add an path to look for plugins. More...
 
bool CreateMainWindow ()
 Create a main window. Just calls InitializeMainWindow. More...
 
std::string DefaultConfigPath ()
 Get the location of the default configuration file. More...
 
QQmlApplicationEngine * Engine () const
 Get the QML engine. More...
 
bool LoadConfig (const std::string &_path)
 Load a configuration file, which includes window configurations and plugins. This function doesn't instantiate the plugins, it just keeps them in memory and they can be applied later by either instantiating a window or several dialogs. More...
 
bool LoadDefaultConfig ()
 Load the configuration from the default config file. More...
 
bool LoadPlugin (const std::string &_filename, const tinyxml2::XMLElement *_pluginElem=nullptr)
 Load a plugin from a file name. The plugin file must be in the path. If a window has been initialized, the plugin is added to the window. Otherwise, the plugin is stored and can be later added to a window or dialog. More...
 
std::shared_ptr< Plugin > PluginByName (const std::string &_pluginName) const
 Get a plugin by its unique name. More...
 
std::vector< std::pair< std::string, std::vector< std::string > > > PluginList ()
 Get the list of available plugins, organized by path. The paths are given in the following order: More...
 
bool RemovePlugin (const std::string &_pluginName)
 Remove plugin by name. The plugin is removed from the application and its shared library unloaded if this was its last instance. More...
 
void SetDefaultConfigPath (const std::string &_path)
 Specifies the location of the default configuration file. This is the file that stores the user settings when pressing "Save configuration". More...
 
void SetPluginPathEnv (const std::string &_env)
 Set the environment variable which defines the paths to look for plugins. More...
 
- Public Member Functions inherited from QApplication
 QApplication (Display *display, int &argc, char **argv, Qt::HANDLE visual, Qt::HANDLE colormap)
 
 QApplication (Display *display, Qt::HANDLE visual, Qt::HANDLE colormap)
 
 QApplication (int &argc, char **argv)
 
 QApplication (int &argc, char **argv, bool GUIenabled)
 
 QApplication (int &argc, char **argv, Type type)
 
 QApplication (QApplication::QS60MainApplicationFactory factory, int &argc, char **argv)
 
virtual ~QApplication ()
 
void aboutToReleaseGpuResources ()
 
void aboutToUseGpuResources ()
 
int autoMaximizeThreshold () const
 
bool autoSipEnabled () const
 
virtual void commitData (QSessionManager &manager)
 
void commitDataRequest (QSessionManager &manager)
 
void focusChanged (QWidget *old, QWidget *now)
 
void fontDatabaseChanged ()
 
QInputContext * inputContext () const
 
bool isSessionRestored () const
 
void lastWindowClosed ()
 
virtual bool macEventFilter (EventHandlerCallRef caller, EventRef event)
 
virtual bool notify (QObject *receiver, QEvent *e)
 
virtual bool qwsEventFilter (QWSEvent *event)
 
void qwsSetCustomColors (QRgb *colorTable, int start, int numColors)
 
virtual void saveState (QSessionManager &manager)
 
void saveStateRequest (QSessionManager &manager)
 
QString sessionId () const
 
QString sessionKey () const
 
void setAutoMaximizeThreshold (const int threshold)
 
void setAutoSipEnabled (const bool enabled)
 
void setInputContext (QInputContext *inputContext)
 
void setStyleSheet (const QString &sheet)
 
QString styleSheet () const
 
virtual bool symbianEventFilter (const QSymbianEvent *event)
 
int symbianProcessEvent (const QSymbianEvent *event)
 
virtual bool x11EventFilter (XEvent *event)
 
int x11ProcessEvent (XEvent *event)
 
- Public Member Functions inherited from QCoreApplication
 QCoreApplication (int &argc, char **argv)
 
 ~QCoreApplication ()
 
void aboutToQuit ()
 
bool filterEvent (void *message, long *result)
 
void lock ()
 
bool locked ()
 
EventFilter setEventFilter (EventFilter filter)
 
bool tryLock ()
 
void unlock (bool wakeUpGui)
 
virtual bool winEventFilter (MSG *msg, long *result)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 

Additional Inherited Members

- Static Public Member Functions inherited from QApplication
void aboutQt ()
 
QWidget * activeModalWidget ()
 
QWidget * activePopupWidget ()
 
QWidget * activeWindow ()
 
void alert (QWidget *widget, int msec)
 
QWidgetList allWidgets ()
 
void beep ()
 
void changeOverrideCursor (const QCursor &cursor)
 
QClipboard * clipboard ()
 
void closeAllWindows ()
 
ColorMode colorMode ()
 
int colorSpec ()
 
int cursorFlashTime ()
 
QDesktopWidget * desktop ()
 
bool desktopSettingsAware ()
 
int doubleClickInterval ()
 
int exec ()
 
void flushX ()
 
QWidget * focusWidget ()
 
QFont font ()
 
QFont font (const char *className)
 
QFont font (const QWidget *widget)
 
QFontMetrics fontMetrics ()
 
QSize globalStrut ()
 
bool hasGlobalMouseTracking ()
 
Qt::Alignment horizontalAlignment (QFlags< Qt::AlignmentFlag > align)
 
bool isEffectEnabled (Qt::UIEffect effect)
 
bool isLeftToRight ()
 
bool isRightToLeft ()
 
Qt::LayoutDirection keyboardInputDirection ()
 
int keyboardInputInterval ()
 
QLocale keyboardInputLocale ()
 
Qt::KeyboardModifiers keyboardModifiers ()
 
bool keypadNavigationEnabled ()
 
Qt::LayoutDirection layoutDirection ()
 
Qt::MacintoshVersion macVersion ()
 
QWidget * mainWidget ()
 
Qt::MouseButtons mouseButtons ()
 
Qt::NavigationMode navigationMode ()
 
QCursor * overrideCursor ()
 
QPalette palette ()
 
QPalette palette (const char *className)
 
QPalette palette (const QWidget *widget)
 
Qt::KeyboardModifiers queryKeyboardModifiers ()
 
bool quitOnLastWindowClosed ()
 
QDecoration & qwsDecoration ()
 
QDecoration * qwsSetDecoration (const QString &decoration)
 
void qwsSetDecoration (QDecoration *decoration)
 
void restoreOverrideCursor ()
 
bool reverseLayout ()
 
void setActiveWindow (QWidget *active)
 
void setColorMode (ColorMode mode)
 
void setColorSpec (int spec)
 
void setCursorFlashTime (int)
 
void setDesktopSettingsAware (bool on)
 
void setDoubleClickInterval (int)
 
void setEffectEnabled (Qt::UIEffect effect, bool enable)
 
void setFont (const QFont &font, bool b, const char *className)
 
void setFont (const QFont &font, const char *className)
 
void setGlobalMouseTracking (bool dummy)
 
void setGlobalStrut (const QSize &)
 
void setGraphicsSystem (const QString &system)
 
void setKeyboardInputInterval (int)
 
void setLayoutDirection (Qt::LayoutDirection direction)
 
void setMainWidget (QWidget *mainWidget)
 
void setNavigationMode (Qt::NavigationMode mode)
 
void setOverrideCursor (const QCursor &cursor)
 
void setOverrideCursor (const QCursor &cursor, bool replace)
 
void setPalette (const QPalette &pal, bool b, const char *className)
 
void setPalette (const QPalette &palette, const char *className)
 
void setQuitOnLastWindowClosed (bool quit)
 
void setReverseLayout (bool reverse)
 
void setStartDragDistance (int l)
 
void setStartDragTime (int ms)
 
QStyle * setStyle (const QString &style)
 
void setStyle (QStyle *style)
 
void setWheelScrollLines (int)
 
void setWindowIcon (const QIcon &icon)
 
void setWinStyleHighlightColor (const QColor &c)
 
int startDragDistance ()
 
int startDragTime ()
 
QStyle * style ()
 
void syncX ()
 
QWidget * topLevelAt (const QPoint &point)
 
QWidget * topLevelAt (int x, int y)
 
QWidgetList topLevelWidgets ()
 
Type type ()
 
int wheelScrollLines ()
 
QWidget * widgetAt (const QPoint &point)
 
QWidget * widgetAt (const QPoint &point, bool child)
 
QWidget * widgetAt (int x, int y)
 
QWidget * widgetAt (int x, int y, bool child)
 
QIcon windowIcon ()
 
const QColor & winStyleHighlightColor ()
 
Qt::WindowsVersion winVersion ()
 
- Static Public Member Functions inherited from QCoreApplication
void addLibraryPath (const QString &path)
 
QString applicationDirPath ()
 
QString applicationFilePath ()
 
QString applicationName ()
 
qint64 applicationPid ()
 
QString applicationVersion ()
 
int argc ()
 
QStringList arguments ()
 
char ** argv ()
 
bool closingDown ()
 
int enter_loop ()
 
int exec ()
 
void exit (int returnCode)
 
void exit_loop ()
 
void flush ()
 
bool hasPendingEvents ()
 
void installTranslator (QTranslator *translationFile)
 
QCoreApplication * instance ()
 
QStringList libraryPaths ()
 
int loopLevel ()
 
QString organizationDomain ()
 
QString organizationName ()
 
void postEvent (QObject *receiver, QEvent *event)
 
void postEvent (QObject *receiver, QEvent *event, int priority)
 
void processEvents (QFlags< QEventLoop::ProcessEventsFlag > flags)
 
void processEvents (QFlags< QEventLoop::ProcessEventsFlag > flags, int maxtime)
 
void processOneEvent ()
 
void quit ()
 
void removeLibraryPath (const QString &path)
 
void removePostedEvents (QObject *receiver)
 
void removePostedEvents (QObject *receiver, int eventType)
 
void removeTranslator (QTranslator *translationFile)
 
bool sendEvent (QObject *receiver, QEvent *event)
 
void sendPostedEvents ()
 
void sendPostedEvents (QObject *receiver, int event_type)
 
void setApplicationName (const QString &application)
 
void setApplicationVersion (const QString &version)
 
void setAttribute (Qt::ApplicationAttribute attribute, bool on)
 
void setLibraryPaths (const QStringList &paths)
 
void setOrganizationDomain (const QString &orgDomain)
 
void setOrganizationName (const QString &orgName)
 
bool startingUp ()
 
bool testAttribute (Qt::ApplicationAttribute attribute)
 
QString translate (const char *context, const char *sourceText, const char *disambiguation, Encoding encoding)
 
QString translate (const char *context, const char *sourceText, const char *disambiguation, Encoding encoding, int n)
 
- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QApplication
typedef ColorMode
 
typedef QS60MainApplicationFactory
 
- Public Attributes inherited from QCoreApplication
typedef EventFilter
 
- Protected Member Functions inherited from QApplication
virtual bool event (QEvent *e)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QApplication
 autoMaximizeThreshold
 
 autoSipEnabled
 
 cursorFlashTime
 
 doubleClickInterval
 
 globalStrut
 
 keyboardInputInterval
 
 layoutDirection
 
 quitOnLastWindowClosed
 
 startDragDistance
 
 startDragTime
 
 styleSheet
 
 wheelScrollLines
 
 windowIcon
 
- Properties inherited from QCoreApplication
 applicationName
 
 applicationVersion
 
 organizationDomain
 
 organizationName
 
- Properties inherited from QObject
 objectName
 

Detailed Description

A Gazebo GUI application loads a QML engine and provides an API to load plugins and configuration files. The application supports either running a single main window or several plugins as standalone dialogs.

Constructor & Destructor Documentation

◆ Application()

Application ( int &  _argc,
char **  _argv,
const WindowType  _type = WindowType::kMainWindow 
)

Constructor.

Parameters
[in]_argcArgument count.
[in]_argvArgument values.
[in]_typeWindow type, by default it's a main window.

◆ ~Application()

virtual ~Application ( )
virtual

Destructor.

Member Function Documentation

◆ AddPluginPath()

void AddPluginPath ( const std::string &  _path)

Add an path to look for plugins.

Parameters
[in]_pathFull path.

◆ CreateMainWindow()

bool CreateMainWindow ( )

Create a main window. Just calls InitializeMainWindow.

Returns
True if successful
See also
InitializeMainWindow

◆ DefaultConfigPath()

std::string DefaultConfigPath ( )

Get the location of the default configuration file.

Returns
The default configuration path.
See also
LoadDefaultConfig
SetDefaultConfigPath

◆ Engine()

QQmlApplicationEngine* Engine ( ) const

Get the QML engine.

Returns
Pointer to QML engine

◆ LoadConfig()

bool LoadConfig ( const std::string &  _path)

Load a configuration file, which includes window configurations and plugins. This function doesn't instantiate the plugins, it just keeps them in memory and they can be applied later by either instantiating a window or several dialogs.

Parameters
[in]_pathFull path to configuration file.
Returns
True if successful
See also
InitializeMainWindow
InitializeDialogs

◆ LoadDefaultConfig()

bool LoadDefaultConfig ( )

Load the configuration from the default config file.

Returns
True if successful
See also
SetDefaultConfigPath
DefaultConfigPath
LoadConfig

◆ LoadPlugin()

bool LoadPlugin ( const std::string &  _filename,
const tinyxml2::XMLElement *  _pluginElem = nullptr 
)

Load a plugin from a file name. The plugin file must be in the path. If a window has been initialized, the plugin is added to the window. Otherwise, the plugin is stored and can be later added to a window or dialog.

Parameters
[in]_filenamePlugin filename.
[in]_pluginElemElement containing plugin configuration
Returns
True if successful
See also
LoadConfig
AddPluginsToWindow

◆ OnPluginClose

void OnPluginClose ( )
slot

Callback when user requests to close a plugin.

◆ PluginAdded

void PluginAdded ( const QString &  _objectName)
signal

Notify that a plugin has been added.

Parameters
[in]_objectNamePlugin's object name.

◆ PluginByName()

std::shared_ptr<Plugin> PluginByName ( const std::string &  _pluginName) const

Get a plugin by its unique name.

Parameters
[in]_pluginNamePlugn instance's unique name. This is the plugin card's object name.
Returns
Pointer to plugin object, null if not found.

◆ PluginList()

Get the list of available plugins, organized by path. The paths are given in the following order:

  1. Paths given by the environment variable
  2. Paths added by calling addPluginPath
  3. Path ~/.gz/gui/plugins
  4. The path where Gazebo GUI plugins are installed
Returns
A vector of pairs, where each pair contains:
  • A path
  • A vector of plugins in that path

◆ RemovePlugin()

bool RemovePlugin ( const std::string &  _pluginName)

Remove plugin by name. The plugin is removed from the application and its shared library unloaded if this was its last instance.

Parameters
[in]_pluginNamePlugn instance's unique name. This is the plugin card's object name.
Returns
True if successful

◆ SetDefaultConfigPath()

void SetDefaultConfigPath ( const std::string &  _path)

Specifies the location of the default configuration file. This is the file that stores the user settings when pressing "Save configuration".

Parameters
[in]_pathThe default configuration full path including filename.
See also
LoadDefaultConfig
defaultConfigPath

◆ SetPluginPathEnv()

void SetPluginPathEnv ( const std::string &  _env)

Set the environment variable which defines the paths to look for plugins.

Parameters
[in]_envName of environment variable.

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