Skip to content
Permalink
Browse files
Fix for the bug reported by Stephan where the vector layer properties…
… was not restored properly for unique value renderers. And removed a call to QgsVectorLayerProperties::reset() in QgsVectorLayer::showLayerProperties() because it is already called in the constructor of vector layer properties

git-svn-id: http://svn.osgeo.org/qgis/trunk@4928 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Feb 28, 2006
1 parent fc7ca7b commit 5720a463b64fe6e5c6c7f16ab2ae2f36d7d9e181
Showing with 7 additions and 19 deletions.
  1. +7 −15 src/gui/qgsuniquevaluedialog.cpp
  2. +0 −4 src/gui/qgsvectorlayer.cpp
@@ -52,12 +52,6 @@ QgsUniqueValueDialog::QgsUniqueValueDialog(QgsVectorLayer* vl): QDialog(), mVect
return;
}

QObject::connect(mClassificationComboBox, SIGNAL(activated(int)), this, SLOT(changeClassificationAttribute(int)));
QObject::connect(mClassBreakBox, SIGNAL(selectionChanged()), this, SLOT(changeCurrentValue()));
QObject::connect(&sydialog, SIGNAL(settingsChanged()), this, SLOT(applySymbologyChanges()));
mSymbolWidgetStack->addWidget(&sydialog);
mSymbolWidgetStack->raiseWidget(&sydialog);

const QgsUniqueValueRenderer* renderer = dynamic_cast < const QgsUniqueValueRenderer * >(mVectorLayer->renderer());

if (renderer)
@@ -66,11 +60,6 @@ QgsUniqueValueDialog::QgsUniqueValueDialog(QgsVectorLayer* vl): QDialog(), mVect
std::list<int>::iterator iter=renderer->classificationAttributes().begin();
int classattr=*iter;
mClassificationComboBox->setCurrentItem(classattr);

if(renderer->symbols().size()>0)
{
changeClassificationAttribute(classattr);
}

const std::list<QgsSymbol*> list = renderer->symbols();
//fill the items of the renderer into mValues
@@ -83,7 +72,6 @@ QgsUniqueValueDialog::QgsUniqueValueDialog(QgsVectorLayer* vl): QDialog(), mVect
sym->setBrush(symbol->brush());
sym->setNamedPointSymbol(symbol->pointSymbolName());
sym->setPointSize(symbol->pointSize());

mValues.insert(std::make_pair(symbolvalue,sym));
mClassBreakBox->insertItem(symbolvalue);
}
@@ -92,6 +80,13 @@ QgsUniqueValueDialog::QgsUniqueValueDialog(QgsVectorLayer* vl): QDialog(), mVect
{
changeClassificationAttribute(0);
}

QObject::connect(mClassificationComboBox, SIGNAL(activated(int)), this, SLOT(changeClassificationAttribute(int)));
QObject::connect(mClassBreakBox, SIGNAL(selectionChanged()), this, SLOT(changeCurrentValue()));
QObject::connect(&sydialog, SIGNAL(settingsChanged()), this, SLOT(applySymbologyChanges()));
mSymbolWidgetStack->addWidget(&sydialog);
mSymbolWidgetStack->raiseWidget(&sydialog);

mClassBreakBox->setCurrentItem(0);
}

@@ -118,9 +113,6 @@ void QgsUniqueValueDialog::apply()
for(std::map<QString,QgsSymbol*>::iterator it=mValues.begin();it!=mValues.end();++it)
{
QgsSymbol* symbol=it->second;
#ifdef QGISDEBUG
qWarning("apply: lower value is "+symbol->lowerValue());
#endif
QgsSymbol* newsymbol=new QgsSymbol(mVectorLayer->vectorType(), symbol->lowerValue(), symbol->upperValue(), symbol->label());
newsymbol->setPen(symbol->pen());
newsymbol->setBrush(symbol->brush());
@@ -1414,10 +1414,6 @@ void QgsVectorLayer::showLayerProperties()
#endif
m_propertiesDialog->setDisplayField(displayField());

#ifdef QGISDEBUG
std::cerr << "Resetting prop dialog\n";
#endif
m_propertiesDialog->reset();
#ifdef QGISDEBUG
std::cerr << "Raising prop dialog\n";
#endif

0 comments on commit 5720a46

Please sign in to comment.