Bases: PyQt4.QtGui.QMainWindow, taurus.qt.qtgui.container.taurusbasecontainer.TaurusBaseContainer
A Taurus-aware QMainWindow with several customizations:
It takes care of (re)storing its geometry and state (see loadSettings())
It provides a splashScreen (which can be disabled)
It provides a statusBar (@TODO)
It incorporates a TaurusLogo (@TODO)
Adds launchers for an external application to the Tools Menu and/or to the Tools ToolBar.
returns a QToolBar with few basic buttons (most important, the logo)
Tries to connect via a QLocalSocket to an existing application with the given key. If another instance already exists (i.e. the connection succeeds), it means that this application is not the only one
This event handler receives widget close events
copies the current settings file into the given file name.
|Parameters:||fname (:class:~`str`) – name of output file. If None given, a file dialog will be shown.|
returns the file name of the “factory settings” (the ini file with default settings). The default implementation returns “<path>/<appname>.ini”, where <path> is the path of the module where the main window class is defined and <appname> is the application name (as obtained from QApplication).
|Returns:||the absolute file name.|
Returns the list of saved perspectives
|Parameters:||settings (:class:~`QSettings` or :class:~`None`) – a QSettings object. If None given, the default one returned by getQSettings() will be used|
|Returns:||the list of the names of the currently saved perspectives|
Returns the main window settings object. If it was not previously set, it will create a new QSettings object following the Taurus convention i.e., it using Ini format and userScope)
|Returns:||the main window QSettings object|
loads settings (including importing all perspectives) from a given ini file. It warns before overwriting an existing perspective.
|Parameters:||fname (:class:~`str`) – name of ini file. If None given, a file dialog will be shown.|
Loads the settings saved for the given perspective
restores the application settings previously saved with saveSettings().
This method should be called explicitly from derived classes after all initialization is done
Returns the model name for this component.
|Returns:||the model name.|
Returns a settings taurus-specific QSettings object. The returned QSettings object will comply with the Taurus defaults for storing application settings (i.e., it uses Ini format and userScope)
|Returns:||a taurus-specific QSettings object|
Slot to be called when another application/instance with the same key checks if this application exists.
This is a dummy implementation which just logs the connection and discards the associated socket You may want to reimplement this if you want to act on such connections
Shows the User Manual in a dockwidget
removes the given perspective from the settings
equivalent to setQSettings(None)
Stores current state of the application as a perspective with the given name
|Parameters:||name (:class:~`str`) – name of the perspective|
saves the application settings (so that they can be restored with loadSettings())
this method is automatically called by default when closing the window, so in general there is no need to call it from derived classes
|Parameters:||group (:class:~`str`) – a prefix that will be added to the keys to be saved (no prefix by default)|
sets the main window settings object
|Parameters:||settings (:class:~`QSettings` or :class:~`None`) –|
Returns if showing the quality as a background color
|Returns:||True if showing the quality or False otherwise|
returns a the splashScreen
re-checks the perspectives available to update self.perspectivesMenu
This method may need be called by derived classes at the end of their initialization.
|Returns:||the updated perspectives menu|
Returns whether this component is using the parent model
|Returns:||True if using parent model or False otherwise|