10#include "RenderPlugin.h"
13#include "DialogConfigurationInterface.h"
15#include "MarbleDebug.h"
16#include "RenderPluginModel.h"
17#include "RenderState.h"
21#include <QStandardItem>
27class Q_DECL_HIDDEN RenderPlugin::Private
30 Private(
const MarbleModel *marbleModel )
31 : m_marbleModel( marbleModel ),
45 const MarbleModel *
const m_marbleModel;
56RenderPlugin::RenderPlugin(
const MarbleModel *marbleModel )
57 : d( new Private( marbleModel ) )
59 connect( &d->m_action, SIGNAL(toggled(
bool)),
60 this, SLOT(setVisible(
bool)) );
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()) );
69 this, SIGNAL(repaintNeeded()) );
71 this, SIGNAL(repaintNeeded()) );
74RenderPlugin::~RenderPlugin()
81 return d->m_marbleModel;
87 d->m_action.setChecked( visible() );
88 d->m_action.setIcon( icon() );
89 d->m_action.setText( guiString() );
90 d->m_action.setToolTip( description() );
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 );
125void RenderPlugin::applyItemState()
127 setEnabled( d->m_item.checkState() ==
Qt::Checked );
130void RenderPlugin::retrieveItemState()
135void RenderPlugin::setEnabled(
bool enabled )
137 if ( enabled == d->m_enabled )
140 d->m_enabled = enabled;
144 emit enabledChanged( enabled );
147void RenderPlugin::setVisible(
bool visible )
149 if ( visible == d->m_visible )
152 d->m_visible = visible;
154 emit visibilityChanged( visible, nameId() );
157void RenderPlugin::setUserCheckable(
bool checkable )
159 if ( checkable != d->m_userCheckable ) {
160 d->m_action.setEnabled( checkable );
161 d->m_userCheckable = checkable;
162 emit userCheckableChanged( checkable );
166bool RenderPlugin::enabled()
const
171bool RenderPlugin::visible()
const
176bool RenderPlugin::isUserCheckable()
const
178 return d->m_userCheckable;
185 result.
insert(QStringLiteral(
"enabled"), enabled());
186 result.
insert(QStringLiteral(
"visible"), visible());
193 setEnabled(settings.
value(QStringLiteral(
"enabled"), enabled()).toBool());
194 setVisible(settings.
value(QStringLiteral(
"visible"), visible()).toBool());
199 return UnknownRenderType;
202RenderState RenderPlugin::renderState()
const
204 return RenderState( name() );
207QString RenderPlugin::runtimeTrace()
const
217void RenderPlugin::restoreDefaultSettings()
224 return settings().keys();
232 settings [ key ] = value;
233 setSettings( settings );
247#include "moc_RenderPlugin.cpp"
This file contains the headers for MarbleModel.
The data model (not based on QAbstractModel) for a MarbleWidget.
RenderType
A Type of plugin.
Binds a QML item to a specific geodetic location in screen coordinates.
bool contains(const Key &key) const const
iterator insert(const Key &key, const T &value)
T value(const Key &key) const const
void setIcon(const QIcon &icon)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)