Fixed issue #242. Tool Dialogs: Label at bottom doesn't update for empty lists.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-02-08 23:55:24 +02:00
parent ba5e218ff4
commit 2885abb5a1
4 changed files with 2 additions and 25 deletions

View File

@ -263,28 +263,6 @@ void DialogArc::closeEvent(QCloseEvent *event)
DialogTool::closeEvent(event); DialogTool::closeEvent(event);
} }
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ValChenged show description angles of lines
* @param row number of row
*/
void DialogArc::ValChenged(int row)
{
if (ui->listWidget->count() == 0)
{
return;
}
QListWidgetItem *item = ui->listWidget->item( row );
if (ui->radioButtonAngleLine->isChecked())
{
qreal angle = *data->GetVariable<VLineAngle>(item->text())->GetValue();
QString desc = QString("%1(%2) - %3").arg(item->text()).arg(angle).arg(tr("Value of angle of line."));
ui->labelDescription->setText(desc);
return;
}
DialogTool::ValChenged(row);
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/** /**
* @brief PutRadius put variable into formula of radius * @brief PutRadius put variable into formula of radius

View File

@ -70,7 +70,6 @@ public slots:
void DeployFormulaTextEdit(); void DeployFormulaTextEdit();
void DeployF1TextEdit(); void DeployF1TextEdit();
void DeployF2TextEdit(); void DeployF2TextEdit();
virtual void ValChenged(int row);
void PutRadius(); void PutRadius();
void PutF1(); void PutF1();
void PutF2(); void PutF2();

View File

@ -62,7 +62,6 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, const quint32
connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogPointOfContact::PutHere); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogPointOfContact::PutHere);
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogPointOfContact::PutVal); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogPointOfContact::PutVal);
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogPointOfContact::ValChenged);
if (qApp->patternType() == MeasurementsType::Standard) if (qApp->patternType() == MeasurementsType::Standard)
{ {

View File

@ -1020,6 +1020,7 @@ void DialogTool::ValChenged(int row)
SCASSERT(radioButtonLengthCurve != nullptr); SCASSERT(radioButtonLengthCurve != nullptr);
if (listWidget->count() == 0) if (listWidget->count() == 0)
{ {
labelDescription->setText("");
return; return;
} }
QListWidgetItem *item = listWidget->item( row ); QListWidgetItem *item = listWidget->item( row );
@ -1078,7 +1079,6 @@ void DialogTool::ValChenged(int row)
labelDescription->setText(desc); labelDescription->setText(desc);
return; return;
} }
if (radioButtonAngleLine->isChecked()) if (radioButtonAngleLine->isChecked())
{ {
QString desc = QString("%1(%2) - %3").arg(item->text()) QString desc = QString("%1(%2) - %3").arg(item->text())
@ -1158,6 +1158,7 @@ void DialogTool::ShowVariable(const QMap<key, val> var)
SCASSERT(checkBoxHideEmpty != nullptr); SCASSERT(checkBoxHideEmpty != nullptr);
listWidget->blockSignals(true); listWidget->blockSignals(true);
listWidget->clear(); listWidget->clear();
labelDescription->setText("");
QMapIterator<key, val> iMap(var); QMapIterator<key, val> iMap(var);
while (iMap.hasNext()) while (iMap.hasNext())