@@ -134,8 +134,8 @@ void QgsLabelPropertyDialog::init( const QString& layerId, int featureId, const
134
134
mBufferColorButton ->setColor ( layerSettings.bufferColor );
135
135
mMinScaleSpinBox ->setValue ( layerSettings.scaleMin );
136
136
mMaxScaleSpinBox ->setValue ( layerSettings.scaleMax );
137
- mHaliComboBox ->setCurrentIndex ( mHaliComboBox ->findText ( " Left" ) );
138
- mValiComboBox ->setCurrentIndex ( mValiComboBox ->findText ( " Bottom" ) );
137
+ mHaliComboBox ->setCurrentIndex ( mHaliComboBox ->findData ( " Left" ) );
138
+ mValiComboBox ->setCurrentIndex ( mValiComboBox ->findData ( " Bottom" ) );
139
139
mFontColorButton ->setColorDialogTitle ( tr ( " Font color" ) );
140
140
mBufferColorButton ->setColorDialogTitle ( tr ( " Buffer color" ) );
141
141
@@ -300,10 +300,10 @@ void QgsLabelPropertyDialog::setDataDefinedValues( const QgsPalLayerSettings &la
300
300
break ;
301
301
}
302
302
case QgsPalLayerSettings::Hali:
303
- mHaliComboBox ->setCurrentIndex ( mHaliComboBox ->findText ( result.toString (), Qt::MatchFixedString ) );
303
+ mHaliComboBox ->setCurrentIndex ( mHaliComboBox ->findData ( result.toString () ) );
304
304
break ;
305
305
case QgsPalLayerSettings::Vali:
306
- mValiComboBox ->setCurrentIndex ( mValiComboBox ->findText ( result.toString (), Qt::MatchFixedString ) );
306
+ mValiComboBox ->setCurrentIndex ( mValiComboBox ->findData ( result.toString () ) );
307
307
break ;
308
308
case QgsPalLayerSettings::BufferColor:
309
309
mBufferColorButton ->setColor ( QColor ( result.toString () ) );
@@ -475,17 +475,18 @@ void QgsLabelPropertyDialog::populateFontStyleComboBox()
475
475
476
476
void QgsLabelPropertyDialog::fillHaliComboBox ()
477
477
{
478
- mHaliComboBox ->addItem ( " Left" );
479
- mHaliComboBox ->addItem ( " Center" );
480
- mHaliComboBox ->addItem ( " Right" );
478
+ mHaliComboBox ->addItem ( tr ( " Left " ), " Left" );
479
+ mHaliComboBox ->addItem ( tr ( " Center " ), " Center" );
480
+ mHaliComboBox ->addItem ( tr ( " Right " ), " Right" );
481
481
}
482
482
483
483
void QgsLabelPropertyDialog::fillValiComboBox ()
484
484
{
485
- mValiComboBox ->addItem ( " Bottom" );
486
- mValiComboBox ->addItem ( " Base" );
487
- mValiComboBox ->addItem ( " Half" );
488
- mValiComboBox ->addItem ( " Top" );
485
+ mValiComboBox ->addItem ( tr ( " Bottom" ), " Bottom" );
486
+ mValiComboBox ->addItem ( tr ( " Base" ), " Base" );
487
+ mValiComboBox ->addItem ( tr ( " Half" ), " Half" );
488
+ mValiComboBox ->addItem ( tr ( " Cap" ), " Cap" );
489
+ mValiComboBox ->addItem ( tr ( " Top" ), " Top" );
489
490
}
490
491
491
492
void QgsLabelPropertyDialog::on_mShowLabelChkbx_toggled ( bool chkd )
@@ -626,14 +627,14 @@ void QgsLabelPropertyDialog::on_mBufferColorButton_colorChanged( const QColor &c
626
627
insertChangedValue ( QgsPalLayerSettings::BufferColor, color.name () );
627
628
}
628
629
629
- void QgsLabelPropertyDialog::on_mHaliComboBox_currentIndexChanged ( const QString& text )
630
+ void QgsLabelPropertyDialog::on_mHaliComboBox_currentIndexChanged ( const int index )
630
631
{
631
- insertChangedValue ( QgsPalLayerSettings::Hali, text );
632
+ insertChangedValue ( QgsPalLayerSettings::Hali, mHaliComboBox -> itemData ( index ) );
632
633
}
633
634
634
- void QgsLabelPropertyDialog::on_mValiComboBox_currentIndexChanged ( const QString& text )
635
+ void QgsLabelPropertyDialog::on_mValiComboBox_currentIndexChanged ( const int index )
635
636
{
636
- insertChangedValue ( QgsPalLayerSettings::Vali, text );
637
+ insertChangedValue ( QgsPalLayerSettings::Vali, mValiComboBox -> itemData ( index ) );
637
638
}
638
639
639
640
void QgsLabelPropertyDialog::on_mLabelTextLineEdit_textChanged ( const QString& text )
0 commit comments