Skip to content
Permalink
Browse files
add table icon and fix warnings related to geometryless layers
git-svn-id: http://svn.osgeo.org/qgis/trunk@14216 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Sep 10, 2010
1 parent 60bab29 commit 53447de4e57bb08ac9e9a6025c9cd8edde821d6e
Binary file not shown.
@@ -370,7 +370,7 @@ QPixmap QgsLegendLayer::getOriginalPixmap()
return QgisApp::getThemePixmap( "/mIconPolygonLayer.png" );
break;
case QGis::NoGeometry:
return QgisApp::getThemePixmap( "mActionOpenTable.png" );
return QgisApp::getThemePixmap( "/mIconTableLayer.png" );
default:
return QgisApp::getThemePixmap( "/mIconLayer.png" );
}
@@ -39,8 +39,15 @@

#define FONT_WORKAROUND_SCALE 10 //scale factor for upscaling fontsize and downscaling painter

QgsComposerItem::QgsComposerItem( QgsComposition* composition, bool manageZValue ): QObject( 0 ), QGraphicsRectItem( 0 ), mComposition( composition ), mBoundingResizeRectangle( 0 ), \
mFrame( true ), mItemPositionLocked( false ), mLastValidViewScaleFactor( -1 ), mRotation( 0 )
QgsComposerItem::QgsComposerItem( QgsComposition* composition, bool manageZValue )
: QObject( 0 )
, QGraphicsRectItem( 0 )
, mComposition( composition )
, mBoundingResizeRectangle( 0 )
, mFrame( true )
, mItemPositionLocked( false )
, mLastValidViewScaleFactor( -1 )
, mRotation( 0 )
{
setFlag( QGraphicsItem::ItemIsSelectable, true );
setAcceptsHoverEvents( true );
@@ -58,9 +65,15 @@ QgsComposerItem::QgsComposerItem( QgsComposition* composition, bool manageZValue
}
}

QgsComposerItem::QgsComposerItem( qreal x, qreal y, qreal width, qreal height, QgsComposition* composition, bool manageZValue ): \
QObject( 0 ), QGraphicsRectItem( 0, 0, width, height, 0 ), mComposition( composition ), mBoundingResizeRectangle( 0 ), mFrame( true ), \
mItemPositionLocked( false ), mLastValidViewScaleFactor( -1 ), mRotation( 0 )
QgsComposerItem::QgsComposerItem( qreal x, qreal y, qreal width, qreal height, QgsComposition* composition, bool manageZValue )
: QObject( 0 )
, QGraphicsRectItem( 0, 0, width, height, 0 )
, mComposition( composition )
, mBoundingResizeRectangle( 0 )
, mFrame( true )
, mItemPositionLocked( false )
, mLastValidViewScaleFactor( -1 )
, mRotation( 0 )
{
setFlag( QGraphicsItem::ItemIsSelectable, true );
setAcceptsHoverEvents( true );
@@ -530,8 +543,8 @@ void QgsComposerItem::changeItemRectangle( const QPointF& currentPosition, const
}
else //for composer items, we prefer setSceneRect as subclasses can implement custom behaviour (e.g. item group)
{
changeComposerItem->setSceneRect( QRectF( originalItem->transform().dx() + moveRectX, \
originalItem->transform().dy() + moveRectY, \
changeComposerItem->setSceneRect( QRectF( originalItem->transform().dx() + moveRectX,
originalItem->transform().dy() + moveRectY,
originalItem->rect().width(), originalItem->rect().height() ) );
}
}
@@ -550,7 +563,7 @@ void QgsComposerItem::changeItemRectangle( const QPointF& currentPosition, const
}
else //for composer items, we prefer setSceneRect as subclasses can implement custom behaviour (e.g. item group)
{
changeComposerItem->setSceneRect( QRectF( originalItem->transform().dx() + mx, originalItem->transform().dy() + my, \
changeComposerItem->setSceneRect( QRectF( originalItem->transform().dx() + mx, originalItem->transform().dy() + my,
originalItem->rect().width() + rx, originalItem->rect().height() + ry ) );
}
}
@@ -27,7 +27,13 @@
#include <QDomElement>
#include <QPainter>

QgsComposerLegend::QgsComposerLegend( QgsComposition* composition ): QgsComposerItem( composition ), mTitle( tr( "Legend" ) ), mBoxSpace( 2 ), mLayerSpace( 3 ), mSymbolSpace( 2 ), mIconLabelSpace( 2 )
QgsComposerLegend::QgsComposerLegend( QgsComposition* composition )
: QgsComposerItem( composition )
, mTitle( tr( "Legend" ) )
, mBoxSpace( 2 )
, mLayerSpace( 3 )
, mSymbolSpace( 2 )
, mIconLabelSpace( 2 )
{
//QStringList idList = layerIdList();
//mLegendModel.setLayerSet( idList );
@@ -326,6 +332,7 @@ void QgsComposerLegend::drawSymbol( QPainter* p, QgsSymbol* s, double currentYCo
symbolHeight = mSymbolHeight;
break;
case QGis::UnknownGeometry:
case QGis::NoGeometry:
// shouldn't occur
break;
}
@@ -22,6 +22,7 @@
#include "qgssymbolv2.h"
#include "qgssymbollayerv2utils.h"
#include "qgsvectorlayer.h"
#include "qgsapplication.h"
#include <QDomDocument>
#include <QDomElement>

@@ -135,6 +136,9 @@ void QgsComposerSymbolItem::readXML( const QDomElement& itemElem )
case QGis::Polygon:
setIcon( QIcon( QPixmap::fromImage( symbol->getPolygonSymbolAsImage() ) ) );
break;
case QGis::NoGeometry:
setIcon( QIcon( QgsApplication::activeThemePath() + "/mIconTableLayer.png" ) );
break;
case QGis::UnknownGeometry:
// should not occur
break;
@@ -1796,6 +1796,7 @@ bool QgsGeometry::deleteVertex( int atVertex )
}
break;
}
case QGis::WKBNoGeometry:
case QGis::WKBUnknown:
break;
}
@@ -2099,6 +2100,7 @@ bool QgsGeometry::insertVertex( double x, double y, int beforeVertex )
}
break;
}
case QGis::WKBNoGeometry:
case QGis::WKBUnknown:
break;
}
@@ -6588,6 +6590,7 @@ void QgsGeometry::validateGeometry( QList<Error> &errors )
}
break;

case QGis::WKBNoGeometry:
case QGis::WKBUnknown:
QgsDebugMsg( QObject::tr( "Unknown geometry type" ) );
errors << Error( QObject::tr( "Unknown geometry type" ) );
@@ -1171,6 +1171,7 @@ void QgsWMSServer::drawLegendSymbol( QgsComposerLegendItem* item, QPainter* p, d
drawPolygonSymbol( p, symbol, boxSpace, currentY, symbolWidth, symbolHeight, layerOpacity, yDownShift );
break;
case QGis::UnknownGeometry:
case QGis::NoGeometry:
// shouldn't occur
break;
}

0 comments on commit 53447de

Please sign in to comment.