Skip to content
Permalink
Browse files
fix #2869
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13893 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jul 6, 2010
1 parent 6e71a1c commit 04972ac781996c22a5b9ce9e5c77b24ab5ee68a7
Showing with 20 additions and 14 deletions.
  1. +5 −4 src/core/qgsvectorlayer.cpp
  2. +9 −4 src/core/qgsvectoroverlay.h
  3. +6 −6 src/plugins/diagram_overlay/qgswkndiagramfactorywidget.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
***************************************************************************/

@@ -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;

@@ -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
@@ -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()

0 comments on commit 04972ac

Please sign in to comment.