Marble
10 #include "RenderPlugin.h"
13 #include "DialogConfigurationInterface.h"
15 #include "MarbleDebug.h"
16 #include "RenderPluginModel.h"
17 #include "RenderState.h"
21 #include <QStandardItem>
27 class Q_DECL_HIDDEN RenderPlugin::Private
30 Private(
const MarbleModel *marbleModel )
31 : m_marbleModel( marbleModel ),
45 const MarbleModel *
const m_marbleModel;
56 RenderPlugin::RenderPlugin(
const MarbleModel *marbleModel )
57 : d( new Private( marbleModel ) )
59 connect( &d->m_action, SIGNAL(toggled(
bool)),
60 this, SLOT(setVisible(
bool)) );
61 connect(
this, SIGNAL(visibilityChanged(
bool,
QString)),
62 &d->m_action, SLOT(setChecked(
bool)) );
63 connect(
this, SIGNAL(enabledChanged(
bool)),
64 &d->m_action, SLOT(setVisible(
bool)) );
65 connect(
this, SIGNAL(enabledChanged(
bool)),
66 SIGNAL(actionGroupsChanged()) );
68 connect(
this, SIGNAL(visibilityChanged(
bool,
QString)),
69 this, SIGNAL(repaintNeeded()) );
70 connect(
this, SIGNAL(settingsChanged(
QString)),
71 this, SIGNAL(repaintNeeded()) );
74 RenderPlugin::~RenderPlugin()
81 return d->m_marbleModel;
86 d->m_action.setCheckable(
true );
87 d->m_action.setChecked( visible() );
88 d->m_action.setIcon(
icon() );
90 d->m_action.setToolTip( description() );
106 d->m_item.setIcon(
icon() );
107 d->m_item.setText( name() );
108 d->m_item.setEditable(
false );
109 d->m_item.setCheckable(
true );
111 d->m_item.setToolTip( description() );
115 d->m_item.setData( nameId(), RenderPluginModel::NameId );
116 d->m_item.setData( (
bool) qobject_cast<DialogConfigurationInterface *>(
this ), RenderPluginModel::ConfigurationDialogAvailable );
117 d->m_item.setData(
backendTypes(), RenderPluginModel::BackendTypes );
118 d->m_item.setData( version(), RenderPluginModel::Version );
119 d->m_item.setData(
aboutDataText(), RenderPluginModel::AboutDataText );
120 d->m_item.setData( copyrightYears(), RenderPluginModel::CopyrightYears );
125 void RenderPlugin::applyItemState()
130 void RenderPlugin::retrieveItemState()
137 if ( enabled == d->m_enabled )
140 d->m_enabled = enabled;
149 if ( visible == d->m_visible )
152 d->m_visible = visible;
159 if ( checkable != d->m_userCheckable ) {
160 d->m_action.setEnabled( checkable );
161 d->m_userCheckable = checkable;
166 bool RenderPlugin::enabled()
const
171 bool RenderPlugin::visible()
const
178 return d->m_userCheckable;
185 result.
insert(QStringLiteral(
"enabled"), enabled());
186 result.
insert(QStringLiteral(
"visible"), visible());
199 return UnknownRenderType;
202 RenderState RenderPlugin::renderState()
const
204 return RenderState( name() );
207 QString RenderPlugin::runtimeTrace()
const
247 #include "moc_RenderPlugin.cpp"
const T value(const Key &key) const const
QAction * action() const
Plugin's menu action.
virtual RenderType renderType() const
Render type of the plugin.
QVariant setting(const QString &key) const
Getting setting value from the settings.
QList< Key > keys() const const
void setUserCheckable(bool isUserCheckable)
setting user checkable
void visibilityChanged(bool visible, const QString &nameId)
This signal is emitted if the visibility is changed with.
virtual QStringList backendTypes() const =0
Returns the name(s) of the backend that the plugin can render.
void setEnabled(bool enabled)
setting enabled
const MarbleModel * marbleModel() const
Access to the MarbleModel.
void setVisible(bool visible)
setting visible
virtual const QList< QActionGroup * > * actionGroups() const
Getting all actions.
void enabledChanged(bool enable)
This signal is emitted if the enabled property is changed with.
QHash::iterator insert(const Key &key, const T &value)
virtual QString aboutDataText() const
Returns about text (credits) for external data the plugin uses.
void restoreDefaultSettings()
Passes an empty set of settings to the plugin.
virtual QString guiString() const =0
String that should be displayed in GUI.
void userCheckableChanged(bool isUserCheckable)
This signal is emitted if the user checkable property is changed with.
Binds a QML item to a specific geodetic location in screen coordinates.
RenderType
A Type of plugin.
virtual void setSettings(const QHash< QString, QVariant > &settings)
Set the settings of the plugin.
bool setSetting(const QString &key, const QVariant &value)
Change setting key's values.
virtual QIcon icon() const =0
Returns an icon for the plugin.
bool isUserCheckable() const
is user checkable
virtual QHash< QString, QVariant > settings() const
Settings of the plugin.
bool contains(const Key &key) const const
The data model (not based on QAbstractModel) for a MarbleWidget.
QStringList settingKeys() const
Full list of the settings keys.
virtual const QList< QActionGroup * > * toolbarActionGroups() const
Getting all actions which should be placed in the toolbar.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:28 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.