17#include "moc_qgscalloutpanelwidget.cpp"
32 for (
const QString &type : calloutTypes )
38 connect( mCalloutStyleComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, &QgsCalloutPanelWidget::calloutTypeChanged );
50 if (
QgsCalloutWidget *cw = qobject_cast< QgsCalloutWidget * >( mCalloutStackedWidget->currentWidget() ) )
73 const QString calloutType = mCalloutStyleComboBox->currentData().toString();
74 std::unique_ptr< QgsCallout >
callout;
75 if (
QgsCalloutWidget *pew = qobject_cast< QgsCalloutWidget * >( mCalloutStackedWidget->currentWidget() ) )
77 callout.reset( pew->callout()->clone() );
86void QgsCalloutPanelWidget::calloutTypeChanged()
88 const QString newCalloutType = mCalloutStyleComboBox->currentData().toString();
89 QgsCalloutWidget *pew = qobject_cast< QgsCalloutWidget * >( mCalloutStackedWidget->currentWidget() );
108 updateCalloutWidget( newCallout.get() );
112void QgsCalloutPanelWidget::updateCalloutWidget(
const QgsCallout *callout )
116 mCalloutStackedWidget->setCurrentWidget( pageDummy );
120 if ( mCalloutStackedWidget->currentWidget() != pageDummy )
123 if (
QgsCalloutWidget *pew = qobject_cast< QgsCalloutWidget * >( mCalloutStackedWidget->currentWidget() ) )
133 if (
QgsVectorLayer *vLayer = qobject_cast< QgsVectorLayer * >( mLayer ) )
139 mCalloutStackedWidget->addWidget( w );
140 mCalloutStackedWidget->setCurrentWidget( w );
147 mCalloutStackedWidget->setCurrentWidget( pageDummy );
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
static QgsCalloutRegistry * calloutRegistry()
Returns the application's callout registry, used for managing callout types.
Registry of available callout classes.
QgsCalloutAbstractMetadata * calloutMetadata(const QString &type) const
Returns the metadata for specified the specified callout type.
QStringList calloutTypes() const
Returns a list of all available callout types.
Abstract base class for callout renderers.
void setEnabled(bool enabled)
Sets whether the callout is enabled.
virtual QString type() const =0
Returns a unique string representing the callout type.
virtual QVariantMap properties(const QgsReadWriteContext &context) const
Returns the properties describing the callout encoded in a string format.
static void initCalloutWidgets()
Initializes callout widgets.
Base class for all map layer types.
The class is used as a container of context for various read/write operations on other objects.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
Represents a vector layer which manages a vector based data sets.
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.