Skip to content
Permalink
Browse files

Further improvements in the speed when opening symbol properties dial…

…og (symbology-ng)

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14499 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Nov 3, 2010
1 parent 63a117a commit c78d2af909e30bf0ae2e3dccf06ffc042f8b3187
@@ -438,6 +438,7 @@ QgsSvgMarkerSymbolLayerV2Widget::QgsSvgMarkerSymbolLayerV2Widget( QWidget* paren

#include <QTime>
#include <QAbstractListModel>
#include <QPixmapCache>

class QgsSvgListModel : public QAbstractListModel
{
@@ -458,16 +459,22 @@ class QgsSvgListModel : public QAbstractListModel

if ( role == Qt::DecorationRole ) // icon
{
QSvgRenderer renderer;
QPainter painter;

// render SVG file
renderer.load( entry );
QPixmap pixmap( QSize( 24, 24 ) );
pixmap.fill();
painter.begin( &pixmap );
renderer.render( &painter );
painter.end();

QPixmap pixmap;
if ( !QPixmapCache::find( entry, pixmap ) )
{
// render SVG file
QSvgRenderer renderer;
QPainter painter;
renderer.load( entry );
pixmap = QPixmap( QSize( 24, 24 ) );
pixmap.fill();
painter.begin( &pixmap );
renderer.render( &painter );
painter.end();

QPixmapCache::insert( entry, pixmap );
}

return pixmap;
}
@@ -55,9 +55,15 @@
<property name="flow">
<enum>QListView::LeftToRight</enum>
</property>
<property name="layoutMode">
<enum>QListView::Batched</enum>
</property>
<property name="viewMode">
<enum>QListView::IconMode</enum>
</property>
<property name="uniformItemSizes">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
@@ -141,6 +141,9 @@
<property name="movement">
<enum>QListView::Static</enum>
</property>
<property name="layoutMode">
<enum>QListView::Batched</enum>
</property>
<property name="spacing">
<number>2</number>
</property>
@@ -153,6 +156,9 @@
<property name="viewMode">
<enum>QListView::IconMode</enum>
</property>
<property name="uniformItemSizes">
<bool>true</bool>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>

0 comments on commit c78d2af

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