RenderPlugin Class Reference
from PyKDE4.marble import *
Inherits: QObject,Marble.RenderPluginInterface → Marble.PluginInterface
Namespace: Marble
Detailed Description
- Abstract class:
- This class can be used as a base class for new classes, but can not be instantiated directly.
The abstract class that creates a renderable item
Renderable Plugins can be used to extend Marble's functionality: They allow to draw stuff on top of the map / globe
Enumerations | |
RenderType | { UnknownRenderType, TopLevelRenderType, PanelRenderType, OnlineRenderType, ThemeRenderType } |
Signals | |
actionGroupsChanged () | |
enabledChanged (bool enable) | |
repaintNeeded (QRegion dirtyRegion=QRegion()) | |
settingsChanged (QString nameId) | |
userCheckableChanged (bool isUserCheckable) | |
visibilityChanged (bool visible, QString nameId) | |
Methods | |
__init__ (self, Marble.MarbleModel marbleModel) | |
QAction | action (self) |
[QActionGroup] | actionGroups (self) |
bool | enabled (self) |
bool | eventFilter (self, QObject a0, QEvent a1) |
QString | guiString (self) |
bool | isUserCheckable (self) |
Marble.MarbleModel | marbleModel (self) |
Marble.RenderPlugin | newInstance (self, Marble.MarbleModel marbleModel) |
Marble.RenderPlugin.RenderType | renderType (self) |
restoreDefaultSettings (self) | |
QString | runtimeTrace (self) |
setEnabled (self, bool enabled) | |
bool | setSetting (self, QString key, QVariant value) |
setSettings (self, {QString:QVariant} settings) | |
setUserCheckable (self, bool isUserCheckable) | |
setVisible (self, bool visible) | |
QVariant | setting (self, QString key) |
QStringList | settingKeys (self) |
{QString:QVariant} | settings (self) |
[QActionGroup] | toolbarActionGroups (self) |
bool | visible (self) |
Signal Documentation
actionGroupsChanged | ( | ) |
This signal is emitted if the actions that the plugin supports change in any way
- Signal syntax:
QObject.connect(source, SIGNAL("actionGroupsChanged()"), target_slot)
enabledChanged | ( | bool | enable | |
) |
This signal is emitted if the enabled property is changed with
- See also:
- setEnabled
- Signal syntax:
QObject.connect(source, SIGNAL("enabledChanged(bool)"), target_slot)
repaintNeeded | ( | QRegion | dirtyRegion=QRegion() | |
) |
This signal is emitted if an update of the view is needed. If available with the dirtyRegion which is the region the view will change in. If dirtyRegion.isEmpty() returns true, the whole viewport has to be repainted.
- Signal syntax:
QObject.connect(source, SIGNAL("repaintNeeded(QRegion)"), target_slot)
settingsChanged | ( | QString | nameId | |
) |
This signal is emitted if the settings of the RenderPlugin changed.
- Signal syntax:
QObject.connect(source, SIGNAL("settingsChanged(QString)"), target_slot)
userCheckableChanged | ( | bool | isUserCheckable | |
) |
This signal is emitted if the user checkable property is changed with
- See also:
- setUserCheckable
- Signal syntax:
QObject.connect(source, SIGNAL("userCheckableChanged(bool)"), target_slot)
visibilityChanged | ( | bool | visible, | |
QString | nameId | |||
) |
This signal is emitted if the visibility is changed with
- See also:
- setVisible
- Signal syntax:
QObject.connect(source, SIGNAL("visibilityChanged(bool, const QString&)"), target_slot)
Method Documentation
__init__ | ( | self, | ||
Marble.MarbleModel | marbleModel | |||
) |
QAction action | ( | self ) |
Plugin's menu action
The action is checkable and controls the visibility of the plugin.
- Returns:
- action, displayed in menu
[QActionGroup] actionGroups | ( | self ) |
Getting all actions
This method is used by the main window to get all of the actions that this plugin defines. There is no guarantee where the main window will place the actions but it will generally be in a Menu. The returned QList should also contain all of the actions returned by
- See also:
- toolbarActions().
- Returns:
- a list of grouped actions
bool enabled | ( | self ) |
is enabled
This method indicates enableability of the plugin
If plugin is enabled it going to be displayed in Marble Menu as active action which can be
- See also:
- setUserCheckable
- Returns:
- enableability of the plugin
- See also:
- setEnabled
bool eventFilter | ( | self, | ||
QObject | a0, | |||
QEvent | a1 | |||
) |
QString guiString | ( | self ) |
- Abstract method:
- This method is abstract and can be overridden but not called directly.
String that should be displayed in GUI
Using a "&" you can suggest key shortcuts
Example: "&Stars"
- Returns:
- string for gui usage
bool isUserCheckable | ( | self ) |
is user checkable
This method indicates user checkability of plugin's action displayed in application menu
Can control plugin visibility
- Warning:
- User can do it only if
- See also:
- enabled is true
- Returns:
- checkability of the plugin
- See also:
- setUserCheckable
Marble.MarbleModel marbleModel | ( | self ) |
Access to the MarbleModel
Internal way to access the model of marble. Can be used to interact with the main application
- Returns:
- marble model
- See also:
- MarbleModel
Marble.RenderPlugin newInstance | ( | self, | ||
Marble.MarbleModel | marbleModel | |||
) |
- Abstract method:
- This method is abstract and can be overridden but not called directly.
Creation a new instance of the plugin
This method is used to create a new object of the current plugin using the marbleModel given.
- Parameters:
-
marbleModel base model
- Returns:
- new instance of current plugin
- Note:
- Typically this method is implemented with the help of the MARBLE_PLUGIN() macro.
Marble.RenderPlugin.RenderType renderType | ( | self ) |
Render type of the plugin
Function for returning the type of plugin this is for. This affects where in the menu tree the action() is placed.
- See also:
- RenderType
restoreDefaultSettings | ( | self ) |
Passes an empty set of settings to the plugin
Well behaving plugins restore their settings to default values as a result of calling this method.
QString runtimeTrace | ( | self ) |
setEnabled | ( | self, | ||
bool | enabled | |||
) |
settting enabled
If enabled = true, plugin will be enabled
If plugin is enabled it will be possible to show/hide it from menu (access from UI)
- Parameters:
-
enabled plugin's enabled state
- See also:
- enabled
bool setSetting | ( | self, | ||
QString | key, | |||
QVariant | value | |||
) |
Change setting key's values
- Parameters:
-
key setting key value new value
This method applies value for the key
- Returns:
- successfully changed or not
setSettings | ( | self, | ||
{QString:QVariant} | settings | |||
) |
Set the settings of the plugin
Usually this is called at startup to restore saved settings.
- Parameters:
-
new plugin's settings
- See also:
- settings
setUserCheckable | ( | self, | ||
bool | isUserCheckable | |||
) |
settting user checkable
If isUserCheckable = true, user will get an option to control visibility in application menu
- Parameters:
-
isUserCheckable user checkability of the plugin
- See also:
- isUserCheckable
setVisible | ( | self, | ||
bool | visible | |||
) |
settting visible
If visible = true, plugin will be visible
- Parameters:
-
visible visibility of the plugin
- See also:
- visible
QVariant setting | ( | self, | ||
QString | key | |||
) |
Getting setting value from the settings
- Parameters:
-
key setting's key index
This method should be used to get current value of key in settings hash table
- Returns:
- setting value
QStringList settingKeys | ( | self ) |
Full list of the settings keys
This method should be used to get all possible settings' keys for the plugin's settings
- Returns:
- list with the keys of settings
{QString:QVariant} settings | ( | self ) |
Settings of the plugin
Settings is the map (hash table) of plugin's settings This method is called to determine the current settings of the plugin for serialization, e.g. when closing the application.
- Returns:
- plugin's settings
- See also:
- setSettings
[QActionGroup] toolbarActionGroups | ( | self ) |
Getting all actions which should be placed in the toolbar
This method returns a subset of the actions returned by
- See also:
- actions() which are intended to be placed in a more prominent place such as a toolbar above the Marble Widget. You are not guaranteed that they will be in an actual toolbar but they will be visible and discoverable
- Returns:
- a list of grouped toolbar actions
bool visible | ( | self ) |
is visible
This method indicates visibility of the plugin
If plugin is visible you can see it on the map/globe
- Returns:
- visibility of the plugin
- See also:
- setVisible
Enumeration Documentation
RenderType |
A Type of plugin
- Enumerator:
-
UnknownRenderType TopLevelRenderType PanelRenderType OnlineRenderType ThemeRenderType