Skip to content

Commit

Permalink
fix #2869
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@13893 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jul 6, 2010
1 parent dde5865 commit 295f1e0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
9 changes: 5 additions & 4 deletions src/core/qgsvectorlayer.cpp
@@ -1,13 +1,14 @@
/***************************************************************************
qgsvectorlayer.cpp
--------------------
begin : Oct 29, 2003
copyright : (C) 2003 by Gary E.Sherman
email : sherman at mrcc.com
This class implements a generic means to display vector layers. The features
and attributes are read from the data store using a "data provider" plugin.
QgsVectorLayer can be used with any data store for which an appropriate
plugin is available.
-------------------
begin : Oct 29, 2003
copyright : (C) 2003 by Gary E.Sherman
email : sherman at mrcc.com
***************************************************************************/

Expand Down
13 changes: 9 additions & 4 deletions src/core/qgsvectoroverlay.h
Expand Up @@ -25,16 +25,21 @@ class QgsOverlayObject;
class QgsRect;
class QgsRenderContext;

/**Base class for vector layer overlays (e.g. Diagrams, labels, etc.). For each object, the position of the bounding box is *stored in a QgsOberlayObject. The vector overlays are drawn on top of all layers
* \note This class has been added in version 1.1
*/
/**Base class for vector layer overlays (e.g. diagrams, labels, etc.). For each
* object, the position of the bounding box is stored in a QgsOverlayObject.
* The vector overlays are drawn on top of all layers.
* \note This class has been added in version 1.1
*/
class CORE_EXPORT QgsVectorOverlay
{
public:
QgsVectorOverlay( QgsVectorLayer* vl );
virtual ~QgsVectorOverlay();

/**Create the overlay objects contained in a view extent. Subclasses need to implement this method and assign width/height information to the overlay ovbjects*/
/**Create the overlay objects contained in a view extent. Subclasses need
* to implement this method and assign width/height information to the
* overlay objects
*/

virtual void createOverlayObjects( const QgsRenderContext& renderContext ) = 0;

Expand Down
12 changes: 6 additions & 6 deletions src/plugins/diagram_overlay/qgswkndiagramfactorywidget.cpp
Expand Up @@ -121,10 +121,13 @@ void QgsWKNDiagramFactoryWidget::setExistingFactory( const QgsDiagramFactory* f

void QgsWKNDiagramFactoryWidget::addAttribute()
{
QTreeWidgetItem* newItem = new QTreeWidgetItem( mAttributesTreeWidget );
QString currentText = mAttributesComboBox->currentText();
if ( currentText.isEmpty() )
return;

QTreeWidgetItem *newItem = new QTreeWidgetItem( mAttributesTreeWidget );

//text
QString currentText = mAttributesComboBox->currentText();
newItem->setText( 0, currentText );

//and icon
Expand All @@ -134,10 +137,7 @@ void QgsWKNDiagramFactoryWidget::addAttribute()
QColor randomColor( red, green, blue );
newItem->setBackground( 1, QBrush( randomColor ) );

if ( !currentText.isNull() && !currentText.isEmpty() )
{
mAttributesTreeWidget->addTopLevelItem( newItem );
}
mAttributesTreeWidget->addTopLevelItem( newItem );
}

void QgsWKNDiagramFactoryWidget::removeAttribute()
Expand Down

0 comments on commit 295f1e0

Please sign in to comment.