Skip to content
Permalink
Browse files

Fix display of descriptions for symbol layer data defined buttons

  • Loading branch information
nyalldawson committed Jan 29, 2015
1 parent 77fcf8c commit 16f309b6172fc2272f2fdfaae72b81beb92c5c04
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/gui/symbology-ng/qgssymbollayerv2widget.cpp
@@ -45,12 +45,11 @@
#include <QStandardItemModel>
#include <QSvgRenderer>
#include <QMessageBox>
#include <QTextDocument>

void QgsSymbolLayerV2Widget::registerDataDefinedButton( QgsDataDefinedButton * button, const QString & propertyName, QgsDataDefinedButton::DataType type, const QString & description )
{
QgsDataDefined dd( symbolLayer()->dataDefinedProperty( propertyName ) );
button->init( mVectorLayer, &dd, type, Qt::escape( description ) );
button->init( mVectorLayer, &dd, type, description );
button->setProperty( "propertyName", propertyName );
connect( button, SIGNAL( dataDefinedChanged( const QString& ) ), this, SLOT( updateDataDefinedProperty() ) );
connect( button, SIGNAL( dataDefinedActivated( bool ) ), this, SLOT( updateDataDefinedProperty() ) );
@@ -422,7 +421,11 @@ void QgsSimpleMarkerSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer
mHorizontalAnchorComboBox->blockSignals( false );
mVerticalAnchorComboBox->blockSignals( false );

registerDataDefinedButton( mNameDDBtn, "name", QgsDataDefinedButton::String, "'square'|'rectangle'|'diamond'|'pentagon'|'triangle'|'equilateral_triangle'|'star'|'regular_star'|'arrow'|'filled_arrowhead'|'circle'|'cross'|'x'|'cross2'|'line'|'arrowhead'" );
registerDataDefinedButton( mNameDDBtn, "name", QgsDataDefinedButton::String, tr( "string " ) + QString( "[<b>square</b>|<b>rectangle</b>|<b>diamond</b>|"
"<b>pentagon</b>|<b>triangle</b>|<b>equilateral_triangle</b>|"
"<b>star</b>|<b>regular_star</b>|<b>arrow</b>|<b>filled_arrowhead</b>|"
"<b>circle</b>|<b>cross</b>|<b>x</b>|"
"<b>cross2</b>|<b>line</b>|<b>arrowhead</b>]" ) );
registerDataDefinedButton( mFillColorDDBtn, "color", QgsDataDefinedButton::String, QgsDataDefinedButton::colorAlphaDesc() );
registerDataDefinedButton( mBorderColorDDBtn, "color_border", QgsDataDefinedButton::String, QgsDataDefinedButton::colorAlphaDesc() );
registerDataDefinedButton( mOutlineWidthDDBtn, "outline_width", QgsDataDefinedButton::Double, QgsDataDefinedButton::doublePosDesc() );
@@ -1398,7 +1401,7 @@ void QgsMarkerLineSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer )

registerDataDefinedButton( mIntervalDDBtn, "interval", QgsDataDefinedButton::Double, QgsDataDefinedButton::doublePosDesc() );
registerDataDefinedButton( mLineOffsetDDBtn, "offset", QgsDataDefinedButton::Double, QgsDataDefinedButton::doubleDesc() );
registerDataDefinedButton( mPlacementDDBtn, "placement", QgsDataDefinedButton::String, "'vertex'|'lastvertex'|'firstvertex'|'centerpoint'" );
registerDataDefinedButton( mPlacementDDBtn, "placement", QgsDataDefinedButton::String, tr( "string " ) + QString( "[<b>vertex</b>|<b>lastvertex</b>|<b>firstvertex</b>|<b>centerpoint</b>]" ) );
registerDataDefinedButton( mOffsetAlongLineDDBtn, "offset_along_line", QgsDataDefinedButton::Double, QgsDataDefinedButton::doublePosDesc() );
}

0 comments on commit 16f309b

Please sign in to comment.
You can’t perform that action at this time.