Skip to content

Commit 5720a46

Browse files
author
mhugent
committedFeb 28, 2006
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
1 parent fc7ca7b commit 5720a46

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed
 

‎src/gui/qgsuniquevaluedialog.cpp

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@ QgsUniqueValueDialog::QgsUniqueValueDialog(QgsVectorLayer* vl): QDialog(), mVect
5252
return;
5353
}
5454

55-
QObject::connect(mClassificationComboBox, SIGNAL(activated(int)), this, SLOT(changeClassificationAttribute(int)));
56-
QObject::connect(mClassBreakBox, SIGNAL(selectionChanged()), this, SLOT(changeCurrentValue()));
57-
QObject::connect(&sydialog, SIGNAL(settingsChanged()), this, SLOT(applySymbologyChanges()));
58-
mSymbolWidgetStack->addWidget(&sydialog);
59-
mSymbolWidgetStack->raiseWidget(&sydialog);
60-
6155
const QgsUniqueValueRenderer* renderer = dynamic_cast < const QgsUniqueValueRenderer * >(mVectorLayer->renderer());
6256

6357
if (renderer)
@@ -66,11 +60,6 @@ QgsUniqueValueDialog::QgsUniqueValueDialog(QgsVectorLayer* vl): QDialog(), mVect
6660
std::list<int>::iterator iter=renderer->classificationAttributes().begin();
6761
int classattr=*iter;
6862
mClassificationComboBox->setCurrentItem(classattr);
69-
70-
if(renderer->symbols().size()>0)
71-
{
72-
changeClassificationAttribute(classattr);
73-
}
7463

7564
const std::list<QgsSymbol*> list = renderer->symbols();
7665
//fill the items of the renderer into mValues
@@ -83,7 +72,6 @@ QgsUniqueValueDialog::QgsUniqueValueDialog(QgsVectorLayer* vl): QDialog(), mVect
8372
sym->setBrush(symbol->brush());
8473
sym->setNamedPointSymbol(symbol->pointSymbolName());
8574
sym->setPointSize(symbol->pointSize());
86-
8775
mValues.insert(std::make_pair(symbolvalue,sym));
8876
mClassBreakBox->insertItem(symbolvalue);
8977
}
@@ -92,6 +80,13 @@ QgsUniqueValueDialog::QgsUniqueValueDialog(QgsVectorLayer* vl): QDialog(), mVect
9280
{
9381
changeClassificationAttribute(0);
9482
}
83+
84+
QObject::connect(mClassificationComboBox, SIGNAL(activated(int)), this, SLOT(changeClassificationAttribute(int)));
85+
QObject::connect(mClassBreakBox, SIGNAL(selectionChanged()), this, SLOT(changeCurrentValue()));
86+
QObject::connect(&sydialog, SIGNAL(settingsChanged()), this, SLOT(applySymbologyChanges()));
87+
mSymbolWidgetStack->addWidget(&sydialog);
88+
mSymbolWidgetStack->raiseWidget(&sydialog);
89+
9590
mClassBreakBox->setCurrentItem(0);
9691
}
9792

@@ -118,9 +113,6 @@ void QgsUniqueValueDialog::apply()
118113
for(std::map<QString,QgsSymbol*>::iterator it=mValues.begin();it!=mValues.end();++it)
119114
{
120115
QgsSymbol* symbol=it->second;
121-
#ifdef QGISDEBUG
122-
qWarning("apply: lower value is "+symbol->lowerValue());
123-
#endif
124116
QgsSymbol* newsymbol=new QgsSymbol(mVectorLayer->vectorType(), symbol->lowerValue(), symbol->upperValue(), symbol->label());
125117
newsymbol->setPen(symbol->pen());
126118
newsymbol->setBrush(symbol->brush());

‎src/gui/qgsvectorlayer.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,10 +1414,6 @@ void QgsVectorLayer::showLayerProperties()
14141414
#endif
14151415
m_propertiesDialog->setDisplayField(displayField());
14161416

1417-
#ifdef QGISDEBUG
1418-
std::cerr << "Resetting prop dialog\n";
1419-
#endif
1420-
m_propertiesDialog->reset();
14211417
#ifdef QGISDEBUG
14221418
std::cerr << "Raising prop dialog\n";
14231419
#endif

0 commit comments

Comments
 (0)
Please sign in to comment.