Skip to content
Permalink
Browse files
Correctly restore font and character for font marker widget
  • Loading branch information
nyalldawson committed May 22, 2015
1 parent ef0d413 commit f81d808ca71f62d85f1a4fb5e0f600684621a742
Showing with 14 additions and 1 deletion.
  1. +6 −0 src/gui/symbology-ng/characterwidget.cpp
  2. +1 −0 src/gui/symbology-ng/characterwidget.h
  3. +7 −1 src/gui/symbology-ng/qgssymbollayerv2widget.cpp
@@ -114,6 +114,12 @@ void CharacterWidget::updateColumns( int cols )
update();
}

void CharacterWidget::setCharacter( const QChar& character )
{
lastKey = character.unicode();
update();
}

//! [3]
QSize CharacterWidget::sizeHint() const
{
@@ -76,6 +76,7 @@ class GUI_EXPORT CharacterWidget : public QWidget
void updateStyle( const QString &fontStyle );
void updateFontMerging( bool enable );
void updateColumns( int cols );
void setCharacter( const QChar& character );

signals:
void characterSelected( const QChar &character );
@@ -2529,9 +2529,10 @@ void QgsFontMarkerSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer )
// layer type is correct, we can do the cast
mLayer = static_cast<QgsFontMarkerSymbolLayerV2*>( layer );

QFont layerFont( mLayer->fontFamily() );
// set values
cboFont->blockSignals( true );
cboFont->setCurrentFont( QFont( mLayer->fontFamily() ) );
cboFont->setCurrentFont( layerFont );
cboFont->blockSignals( false );
spinSize->blockSignals( true );
spinSize->setValue( mLayer->size() );
@@ -2543,6 +2544,11 @@ void QgsFontMarkerSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer )
spinAngle->setValue( mLayer->angle() );
spinAngle->blockSignals( false );

widgetChar->blockSignals( true );
widgetChar->updateFont( layerFont );
widgetChar->setCharacter( mLayer->character() );
widgetChar->blockSignals( false );

//block
spinOffsetX->blockSignals( true );
spinOffsetX->setValue( mLayer->offset().x() );

0 comments on commit f81d808

Please sign in to comment.