Expose method as protected

This commit is contained in:
Nyall Dawson 2024-12-03 11:49:18 +10:00
parent b7f78e8c73
commit 1c3d2ae06a
4 changed files with 24 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -544,7 +544,7 @@ void QgsTextFormatWidget::setWidgetMode( QgsTextFormatWidget::Mode mode )
switch ( mode )
{
case Labeling:
toggleDDButtons( true );
setPropertyOverrideButtonsVisible( true );
mTextFormatsListWidget->setEntityTypes( QList<QgsStyle::StyleEntity>() << QgsStyle::TextFormatEntity << QgsStyle::LabelSettingsEntity );
mTextOrientationComboBox->addItem( tr( "Rotation-based" ), static_cast<int>( 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<QgsPropertyOverrideButton *>();
for ( QgsPropertyOverrideButton *button : buttons )

View File

@ -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();