[QGIS Commit] r13893 - in trunk/qgis/src: core
plugins/diagram_overlay
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Tue Jul 6 14:17:05 EDT 2010
Author: jef
Date: 2010-07-06 18:17:05 +0000 (Tue, 06 Jul 2010)
New Revision: 13893
Modified:
trunk/qgis/src/core/qgsvectorlayer.cpp
trunk/qgis/src/core/qgsvectoroverlay.h
trunk/qgis/src/plugins/diagram_overlay/qgswkndiagramfactorywidget.cpp
Log:
fix #2869
Modified: trunk/qgis/src/core/qgsvectorlayer.cpp
===================================================================
--- trunk/qgis/src/core/qgsvectorlayer.cpp 2010-07-06 17:13:32 UTC (rev 13892)
+++ trunk/qgis/src/core/qgsvectorlayer.cpp 2010-07-06 18:17:05 UTC (rev 13893)
@@ -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
***************************************************************************/
Modified: trunk/qgis/src/core/qgsvectoroverlay.h
===================================================================
--- trunk/qgis/src/core/qgsvectoroverlay.h 2010-07-06 17:13:32 UTC (rev 13892)
+++ trunk/qgis/src/core/qgsvectoroverlay.h 2010-07-06 18:17:05 UTC (rev 13893)
@@ -25,16 +25,21 @@
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;
Modified: trunk/qgis/src/plugins/diagram_overlay/qgswkndiagramfactorywidget.cpp
===================================================================
--- trunk/qgis/src/plugins/diagram_overlay/qgswkndiagramfactorywidget.cpp 2010-07-06 17:13:32 UTC (rev 13892)
+++ trunk/qgis/src/plugins/diagram_overlay/qgswkndiagramfactorywidget.cpp 2010-07-06 18:17:05 UTC (rev 13893)
@@ -121,10 +121,13 @@
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 @@
QColor randomColor( red, green, blue );
newItem->setBackground( 1, QBrush( randomColor ) );
- if ( !currentText.isNull() && !currentText.isEmpty() )
- {
- mAttributesTreeWidget->addTopLevelItem( newItem );
- }
+ mAttributesTreeWidget->addTopLevelItem( newItem );
}
void QgsWKNDiagramFactoryWidget::removeAttribute()
More information about the QGIS-commit
mailing list