31 for (
const QString &type : calloutTypes )
37 connect( mCalloutStyleComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, &QgsCalloutPanelWidget::calloutTypeChanged );
49 if (
QgsCalloutWidget *cw = qobject_cast< QgsCalloutWidget * >( mCalloutStackedWidget->currentWidget() ) )
72 const QString calloutType = mCalloutStyleComboBox->currentData().toString();
73 std::unique_ptr< QgsCallout >
callout;
74 if (
QgsCalloutWidget *pew = qobject_cast< QgsCalloutWidget * >( mCalloutStackedWidget->currentWidget() ) )
76 callout.reset( pew->callout()->clone() );
85void QgsCalloutPanelWidget::calloutTypeChanged()
87 const QString newCalloutType = mCalloutStyleComboBox->currentData().toString();
88 QgsCalloutWidget *pew = qobject_cast< QgsCalloutWidget * >( mCalloutStackedWidget->currentWidget() );
107 updateCalloutWidget( newCallout.get() );
111void QgsCalloutPanelWidget::updateCalloutWidget(
const QgsCallout *callout )
115 mCalloutStackedWidget->setCurrentWidget( pageDummy );
119 if ( mCalloutStackedWidget->currentWidget() != pageDummy )
122 if (
QgsCalloutWidget *pew = qobject_cast< QgsCalloutWidget * >( mCalloutStackedWidget->currentWidget() ) )
132 if (
QgsVectorLayer *vLayer = qobject_cast< QgsVectorLayer * >( mLayer ) )
138 mCalloutStackedWidget->addWidget( w );
139 mCalloutStackedWidget->setCurrentWidget( w );
146 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.