Skip to content

Commit 703c0a6

Browse files
author
jef
committedNov 3, 2010
also use pixmap cache in old symbology
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14500 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed
 

‎src/app/qgssinglesymboldialog.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <QFileDialog>
3333
#include <QKeyEvent>
3434
#include <QAbstractListModel>
35+
#include <QPixmapCache>
3536

3637
#define DO_NOT_USE_STR "<off>"
3738

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

5657
if ( role == Qt::DecorationRole ) // icon
5758
{
58-
QPen pen( QColor( 0, 0, 255 ) );
59-
QBrush brush( QColor( 220, 220, 220 ), Qt::SolidPattern );
60-
return QPixmap::fromImage( QgsMarkerCatalogue::instance()->imageMarker( marker, 18, pen, brush ) );
59+
QPixmap pixmap;
60+
61+
if ( !QPixmapCache::find( "ssd_" + marker, pixmap ) )
62+
{
63+
QPen pen( QColor( 0, 0, 255 ) );
64+
QBrush brush( QColor( 220, 220, 220 ), Qt::SolidPattern );
65+
pixmap = QPixmap::fromImage( QgsMarkerCatalogue::instance()->imageMarker( marker, 18, pen, brush ) );
66+
QPixmapCache::insert( "ssd_" + marker, pixmap );
67+
}
68+
69+
return pixmap;
6170
}
6271
else if ( role == Qt::UserRole || role == Qt::ToolTipRole )
6372
{

‎src/ui/qgssinglesymboldialogbase.ui

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@
109109
<property name="resizeMode">
110110
<enum>QListView::Adjust</enum>
111111
</property>
112+
<property name="layoutMode">
113+
<enum>QListView::Batched</enum>
114+
</property>
112115
<property name="viewMode">
113116
<enum>QListView::IconMode</enum>
114117
</property>

0 commit comments

Comments
 (0)
Please sign in to comment.