Skip to content
Permalink
Browse files

also use pixmap cache in old symbology

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14500 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Nov 3, 2010
1 parent c78d2af commit 703c0a6ef3971a81b5c8cecae4b706c68a7c7cd2
Showing with 15 additions and 3 deletions.
  1. +12 −3 src/app/qgssinglesymboldialog.cpp
  2. +3 −0 src/ui/qgssinglesymboldialogbase.ui
@@ -32,6 +32,7 @@
#include <QFileDialog>
#include <QKeyEvent>
#include <QAbstractListModel>
#include <QPixmapCache>

#define DO_NOT_USE_STR "<off>"

@@ -55,9 +56,17 @@ class QgsMarkerListModel : public QAbstractListModel

if ( role == Qt::DecorationRole ) // icon
{
QPen pen( QColor( 0, 0, 255 ) );
QBrush brush( QColor( 220, 220, 220 ), Qt::SolidPattern );
return QPixmap::fromImage( QgsMarkerCatalogue::instance()->imageMarker( marker, 18, pen, brush ) );
QPixmap pixmap;

if ( !QPixmapCache::find( "ssd_" + marker, pixmap ) )
{
QPen pen( QColor( 0, 0, 255 ) );
QBrush brush( QColor( 220, 220, 220 ), Qt::SolidPattern );
pixmap = QPixmap::fromImage( QgsMarkerCatalogue::instance()->imageMarker( marker, 18, pen, brush ) );
QPixmapCache::insert( "ssd_" + marker, pixmap );
}

return pixmap;
}
else if ( role == Qt::UserRole || role == Qt::ToolTipRole )
{
@@ -109,6 +109,9 @@
<property name="resizeMode">
<enum>QListView::Adjust</enum>
</property>
<property name="layoutMode">
<enum>QListView::Batched</enum>
</property>
<property name="viewMode">
<enum>QListView::IconMode</enum>
</property>

0 comments on commit 703c0a6

Please sign in to comment.
You can’t perform that action at this time.