diff --git a/python/PyQt6/gui/auto_generated/qgstextformatwidget.sip.in b/python/PyQt6/gui/auto_generated/qgstextformatwidget.sip.in index 2e1347dd52c..5f5f4a4f38c 100644 --- a/python/PyQt6/gui/auto_generated/qgstextformatwidget.sip.in +++ b/python/PyQt6/gui/auto_generated/qgstextformatwidget.sip.in @@ -156,6 +156,13 @@ when registering labels for the labeling settings currently defined by the widge .. versionadded:: 3.16 %End + void setPropertyOverrideButtonsVisible( bool visible ); +%Docstring +Toggles whether data defined buttons should be shown in the widget. + +.. versionadded:: 3.42 +%End + diff --git a/python/gui/auto_generated/qgstextformatwidget.sip.in b/python/gui/auto_generated/qgstextformatwidget.sip.in index 31575f017ff..887ff1a3358 100644 --- a/python/gui/auto_generated/qgstextformatwidget.sip.in +++ b/python/gui/auto_generated/qgstextformatwidget.sip.in @@ -156,6 +156,13 @@ when registering labels for the labeling settings currently defined by the widge .. versionadded:: 3.16 %End + void setPropertyOverrideButtonsVisible( bool visible ); +%Docstring +Toggles whether data defined buttons should be shown in the widget. + +.. versionadded:: 3.42 +%End + diff --git a/src/gui/qgstextformatwidget.cpp b/src/gui/qgstextformatwidget.cpp index f02f9136764..65582f35be0 100644 --- a/src/gui/qgstextformatwidget.cpp +++ b/src/gui/qgstextformatwidget.cpp @@ -544,7 +544,7 @@ void QgsTextFormatWidget::setWidgetMode( QgsTextFormatWidget::Mode mode ) switch ( mode ) { case Labeling: - toggleDDButtons( true ); + setPropertyOverrideButtonsVisible( true ); mTextFormatsListWidget->setEntityTypes( QList() << QgsStyle::TextFormatEntity << QgsStyle::LabelSettingsEntity ); mTextOrientationComboBox->addItem( tr( "Rotation-based" ), static_cast( Qgis::TextOrientation::RotationBased ) ); break; @@ -552,7 +552,7 @@ void QgsTextFormatWidget::setWidgetMode( QgsTextFormatWidget::Mode mode ) case Text: { const int prevIndex = mOptionsTab->currentIndex(); - toggleDDButtons( true ); + setPropertyOverrideButtonsVisible( true ); delete mLabelingOptionsListWidget->takeItem( 8 ); // rendering delete mLabelingOptionsListWidget->takeItem( 7 ); // placement delete mLabelingOptionsListWidget->takeItem( 6 ); // callouts @@ -611,7 +611,7 @@ void QgsTextFormatWidget::setWidgetMode( QgsTextFormatWidget::Mode mode ) } } -void QgsTextFormatWidget::toggleDDButtons( bool visible ) +void QgsTextFormatWidget::setPropertyOverrideButtonsVisible( bool visible ) { const auto buttons = findChildren(); for ( QgsPropertyOverrideButton *button : buttons ) diff --git a/src/gui/qgstextformatwidget.h b/src/gui/qgstextformatwidget.h index 537b828bcc4..b02f9a7c21c 100644 --- a/src/gui/qgstextformatwidget.h +++ b/src/gui/qgstextformatwidget.h @@ -165,6 +165,13 @@ class GUI_EXPORT QgsTextFormatWidget : public QWidget, public QgsExpressionConte */ Qgis::GeometryType labelGeometryType() const; + /** + * Toggles whether data defined buttons should be shown in the widget. + * + * \since QGIS 3.42 + */ + void setPropertyOverrideButtonsVisible( bool visible ); + //! Text substitution list QgsStringReplacementCollection mSubstitutions; //! Tab positions @@ -254,7 +261,6 @@ class GUI_EXPORT QgsTextFormatWidget : public QWidget, public QgsExpressionConte void initWidget(); void setWidgetMode( Mode mode ); - void toggleDDButtons( bool visible ); void blockFontChangeSignals( bool blk ); void populateFontCapitalsComboBox(); void populateFontStyleComboBox();