Skip to content

Commit

Permalink
also use pixmap cache in old symbology
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14500 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 3, 2010
1 parent c78d2af commit 703c0a6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/app/qgssinglesymboldialog.cpp
Expand Up @@ -32,6 +32,7 @@
#include <QFileDialog>
#include <QKeyEvent>
#include <QAbstractListModel>
#include <QPixmapCache>

#define DO_NOT_USE_STR "<off>"

Expand All @@ -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 )
{
Expand Down
3 changes: 3 additions & 0 deletions src/ui/qgssinglesymboldialogbase.ui
Expand Up @@ -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>
Expand Down

0 comments on commit 703c0a6

Please sign in to comment.