Can not add one point to detail twice

--HG--
branch : feature
This commit is contained in:
Valentina Zhuravska 2015-11-10 10:07:40 +02:00
parent 779117a34f
commit 4c41e04d49

View File

@ -180,6 +180,23 @@ void DialogDetail::NewItem(quint32 id, const Tool &typeTool, const NodeDetail &t
return; return;
} }
bool canAddNewPoint = false;
if(ui.listWidget->count() == 0)
{
canAddNewPoint = true;
}
else
{
QString lastItemName = ui.listWidget->item(ui.listWidget->count()-1)->text();
if(QString::compare(lastItemName, name) != 0)
{
canAddNewPoint = true;
}
}
if(canAddNewPoint)
{
QListWidgetItem *item = new QListWidgetItem(name); QListWidgetItem *item = new QListWidgetItem(name);
item->setFont(QFont("Times", 12, QFont::Bold)); item->setFont(QFont("Times", 12, QFont::Bold));
VNodeDetail node(id, typeTool, typeNode, mx, my, reverse); VNodeDetail node(id, typeTool, typeNode, mx, my, reverse);
@ -206,6 +223,7 @@ void DialogDetail::NewItem(quint32 id, const Tool &typeTool, const NodeDetail &t
ui.doubleSpinBoxBiasX->blockSignals(false); ui.doubleSpinBoxBiasX->blockSignals(false);
ui.doubleSpinBoxBiasY->blockSignals(false); ui.doubleSpinBoxBiasY->blockSignals(false);
} }
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VDetail DialogDetail::CreateDetail() const VDetail DialogDetail::CreateDetail() const