Skip to content

Commit

Permalink
Add configuration GUI for label geometry generators
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Mar 10, 2019
1 parent ae51dce commit cbca612
Show file tree
Hide file tree
Showing 3 changed files with 231 additions and 215 deletions.
10 changes: 10 additions & 0 deletions src/gui/qgstextformatwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,10 @@ void QgsTextFormatWidget::initWidget()

connect( mQuadrantBtnGrp, static_cast<void ( QButtonGroup::* )( int )>( &QButtonGroup::buttonClicked ), this, &QgsTextFormatWidget::updatePreview );

mGeometryGeneratorType->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconPolygonLayer.svg" ) ), tr( "Polygon / MultiPolygon" ), QgsWkbTypes::GeometryType::PolygonGeometry );
mGeometryGeneratorType->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconLineLayer.svg" ) ), tr( "LineString / MultiLineString" ), QgsWkbTypes::GeometryType::LineGeometry );
mGeometryGeneratorType->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconPointLayer.svg" ) ), tr( "Point / MultiPoint" ), QgsWkbTypes::GeometryType::PointGeometry );

// set correct initial tab to match displayed setting page
whileBlocking( mOptionsTab )->setCurrentIndex( mLabelStackedWidget->currentIndex() );

Expand All @@ -530,6 +534,12 @@ void QgsTextFormatWidget::initWidget()
lblFontPreview->setMapUnits( mMapCanvas->mapSettings().mapUnits() );
mPreviewScaleComboBox->setScale( mMapCanvas->mapSettings().scale() );
}

setupWidget();
}

void QgsTextFormatWidget::setupWidget()
{
}

void QgsTextFormatWidget::setWidgetMode( QgsTextFormatWidget::Mode mode )
Expand Down
4 changes: 4 additions & 0 deletions src/gui/qgstextformatwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ class GUI_EXPORT QgsTextFormatWidget : public QWidget, protected Ui::QgsTextForm
bool mLoadSvgParams = false;

void initWidget();
/**
* Used to setup child classes. Called at the end of initWidget.
*/
virtual void setupWidget();
void setWidgetMode( Mode mode );
void toggleDDButtons( bool visible );
void blockFontChangeSignals( bool blk );
Expand Down
Loading

0 comments on commit cbca612

Please sign in to comment.