Skip to content

Commit

Permalink
fix #2013
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11816 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Oct 15, 2009
1 parent f74ee37 commit 653abd6
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions src/app/qgsuniquevaluedialog.cpp
Expand Up @@ -73,7 +73,7 @@ QgsUniqueValueDialog::QgsUniqueValueDialog( QgsVectorLayer* vl ): QDialog(), mVe
//fill the items of the renderer into mValues
for ( QList<QgsSymbol*>::const_iterator iter = list.begin(); iter != list.end(); ++iter )
{
QgsSymbol* symbol = ( *iter );
QgsSymbol* symbol = *iter;
QString symbolvalue = symbol->lowerValue();
QgsSymbol* sym = new QgsSymbol( mVectorLayer->geometryType(), symbol->lowerValue(), symbol->upperValue(), symbol->label() );
sym->setPen( symbol->pen() );
Expand All @@ -97,15 +97,15 @@ QgsUniqueValueDialog::QgsUniqueValueDialog( QgsVectorLayer* vl ): QDialog(), mVe

mDeletePushButton->setEnabled( false );

QObject::connect( mClassifyButton, SIGNAL( clicked() ), this, SLOT( changeClassificationAttribute() ) );
QObject::connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addClass() ) );
QObject::connect( mDeletePushButton, SIGNAL( clicked() ), this, SLOT( deleteSelectedClasses() ) );
QObject::connect( mRandomizeColors, SIGNAL( clicked() ), this, SLOT( randomizeColors() ) );
QObject::connect( mResetColors, SIGNAL( clicked() ), this, SLOT( resetColors() ) );
QObject::connect( mClassListWidget, SIGNAL( itemSelectionChanged() ), this, SLOT( selectionChanged() ) );
QObject::connect( mCommonPropertyLock, SIGNAL( clicked() ), this, SLOT( selectionChanged() ) );
QObject::connect( mClassListWidget, SIGNAL( itemChanged( QListWidgetItem * ) ), this, SLOT( itemChanged( QListWidgetItem * ) ) );
QObject::connect( &sydialog, SIGNAL( settingsChanged() ), this, SLOT( applySymbologyChanges() ) );
connect( mClassifyButton, SIGNAL( clicked() ), this, SLOT( changeClassificationAttribute() ) );
connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addClass() ) );
connect( mDeletePushButton, SIGNAL( clicked() ), this, SLOT( deleteSelectedClasses() ) );
connect( mRandomizeColors, SIGNAL( clicked() ), this, SLOT( randomizeColors() ) );
connect( mResetColors, SIGNAL( clicked() ), this, SLOT( resetColors() ) );
connect( mClassListWidget, SIGNAL( itemSelectionChanged() ), this, SLOT( selectionChanged() ) );
connect( mCommonPropertyLock, SIGNAL( clicked() ), this, SLOT( selectionChanged() ) );
connect( mClassListWidget, SIGNAL( itemChanged( QListWidgetItem * ) ), this, SLOT( itemChanged( QListWidgetItem * ) ) );
connect( &sydialog, SIGNAL( settingsChanged() ), this, SLOT( applySymbologyChanges() ) );
mSymbolWidgetStack->addWidget( &sydialog );
mSymbolWidgetStack->setCurrentWidget( &sydialog );
}
Expand Down Expand Up @@ -436,18 +436,21 @@ void QgsUniqueValueDialog::applySymbologyChanges()
}
}

void QgsUniqueValueDialog::updateEntryIcon( QgsSymbol * thepSymbol,
QListWidgetItem * thepItem )
void QgsUniqueValueDialog::updateEntryIcon( QgsSymbol *thepSymbol, QListWidgetItem *thepItem )
{
QGis::GeometryType myType = mVectorLayer->geometryType();
switch ( myType )
{
case QGis::Point:
{
int myWidthScale = 4; //magick no to try to make vector props dialog preview look same as legend
thepItem->setIcon( QIcon( QPixmap::fromImage( thepSymbol->getPointSymbolAsImage( myWidthScale ) ) ) );
}
break;
{
double size = thepSymbol->pointSize();
if( size > 50.0 )
thepSymbol->setPointSize( 50.0 );
thepItem->setIcon( QIcon( QPixmap::fromImage( thepSymbol->getPointSymbolAsImage( 4.0, false, Qt::yellow, 1.0, 0.0001 ) ) ) );
if( size > 50.0 )
thepSymbol->setPointSize( size );
}
break;
case QGis::Line:
thepItem->setIcon( QIcon( QPixmap::fromImage( thepSymbol->getLineSymbolAsImage() ) ) );
break;
Expand Down

0 comments on commit 653abd6

Please sign in to comment.