Skip to content

Commit 3ee7056

Browse files
author
wonder
committed
Applied patch from #2285 by Mark Baas.
Thanks for contributing! git-svn-id: http://svn.osgeo.org/qgis/trunk@12480 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 2285668 commit 3ee7056

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

CONTRIBUTORS

+1
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ Anita Graser
4141
Richard Duivenvoorde
4242
Alexander Bruy
4343
Andres Manz
44+
Mark Baas

src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ QgsCategorizedSymbolRendererV2Widget::QgsCategorizedSymbolRendererV2Widget( QgsV
6161
connect( btnAddCategories, SIGNAL( clicked() ), this, SLOT( addCategories() ) );
6262
connect( btnDeleteCategory, SIGNAL( clicked() ), this, SLOT( deleteCategory() ) );
6363
connect( btnDeleteAllCategories, SIGNAL( clicked() ), this, SLOT( deleteAllCategories() ) );
64+
connect( m, SIGNAL( itemChanged( QStandardItem * ) ), this, SLOT( changeCurrentValue( QStandardItem * ) ) );
6465

6566
// update GUI from renderer
6667
updateUiFromRenderer();
@@ -330,3 +331,12 @@ void QgsCategorizedSymbolRendererV2Widget::deleteAllCategories()
330331
populateCategories();
331332
}
332333

334+
void QgsCategorizedSymbolRendererV2Widget::changeCurrentValue( QStandardItem * item )
335+
{
336+
if ( item->column() == 1 )
337+
{
338+
QString label = item->text();
339+
int idx = item->row();
340+
mRenderer->updateCategoryLabel( idx, label );
341+
}
342+
}

src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.h

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define QGSCATEGORIZEDSYMBOLRENDERERV2WIDGET_H
33

44
#include "qgsrendererv2widget.h"
5+
#include <QStandardItem>
56

67
class QgsCategorizedSymbolRendererV2;
78

@@ -27,6 +28,7 @@ class GUI_EXPORT QgsCategorizedSymbolRendererV2Widget : public QgsRendererV2Widg
2728
void addCategories();
2829
void deleteCategory();
2930
void deleteAllCategories();
31+
void changeCurrentValue( QStandardItem * item );
3032

3133
protected:
3234

0 commit comments

Comments
 (0)