DialogBisector - check if names of points don't equal.
--HG-- branch : develop
This commit is contained in:
parent
0e3da0d902
commit
0c6dc67090
|
@ -66,6 +66,12 @@ DialogBisector::DialogBisector(const VContainer *data, QWidget *parent)
|
|||
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogBisector::NamePointChanged);
|
||||
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogBisector::FormulaTextChanged);
|
||||
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogBisector::DeployFormulaTextEdit);
|
||||
connect(ui->comboBoxFirstPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
|
||||
this, &DialogBisector::PointChanged);
|
||||
connect(ui->comboBoxSecondPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
|
||||
this, &DialogBisector::PointChanged);
|
||||
connect(ui->comboBoxThirdPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
|
||||
this, &DialogBisector::PointChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -74,6 +80,31 @@ void DialogBisector::FormulaTextChanged()
|
|||
this->FormulaChangedPlainText();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::PointChanged()
|
||||
{
|
||||
QSet<quint32> set;
|
||||
set.insert(getCurrentObjectId(ui->comboBoxFirstPoint));
|
||||
set.insert(getCurrentObjectId(ui->comboBoxSecondPoint));
|
||||
set.insert(getCurrentObjectId(ui->comboBoxThirdPoint));
|
||||
|
||||
if (set.size() != 3)
|
||||
{
|
||||
flagError = false;
|
||||
ChangeColor(ui->labelFirstPoint, Qt::red);
|
||||
ChangeColor(ui->labelSecondPoint, Qt::red);
|
||||
ChangeColor(ui->labelThirdPoint, Qt::red);
|
||||
}
|
||||
else
|
||||
{
|
||||
flagError = true;
|
||||
ChangeColor(ui->labelFirstPoint, QColor(76, 76, 76));
|
||||
ChangeColor(ui->labelSecondPoint, QColor(76, 76, 76));
|
||||
ChangeColor(ui->labelThirdPoint, QColor(76, 76, 76));
|
||||
}
|
||||
CheckState();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::DeployFormulaTextEdit()
|
||||
{
|
||||
|
@ -175,6 +206,18 @@ void DialogBisector::setFormula(const QString &value)
|
|||
ui->plainTextEditFormula->setPlainText(formula);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::setPointId(QComboBox *box, quint32 &pointId, const quint32 &value, const quint32 &id)
|
||||
{
|
||||
disconnect(box, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), this,
|
||||
&DialogBisector::PointChanged);
|
||||
|
||||
setCurrentPointId(box, pointId, value, id);
|
||||
|
||||
connect(box, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), this,
|
||||
&DialogBisector::PointChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief setFirstPointId set id of first point
|
||||
|
@ -183,7 +226,7 @@ void DialogBisector::setFormula(const QString &value)
|
|||
*/
|
||||
void DialogBisector::setFirstPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
||||
setPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -194,7 +237,7 @@ void DialogBisector::setFirstPointId(const quint32 &value, const quint32 &id)
|
|||
*/
|
||||
void DialogBisector::setSecondPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
||||
setPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -205,7 +248,7 @@ void DialogBisector::setSecondPointId(const quint32 &value, const quint32 &id)
|
|||
*/
|
||||
void DialogBisector::setThirdPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxThirdPoint, thirdPointId, value, id);
|
||||
setPointId(ui->comboBoxThirdPoint, thirdPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -79,6 +79,7 @@ public slots:
|
|||
* @brief FormulaTextChanged when formula text changes for validation and calc
|
||||
*/
|
||||
void FormulaTextChanged();
|
||||
virtual void PointChanged();
|
||||
private:
|
||||
Q_DISABLE_COPY(DialogBisector)
|
||||
|
||||
|
@ -113,6 +114,8 @@ private:
|
|||
* @brief SaveData Put dialog data in local variables
|
||||
*/
|
||||
void SaveData();
|
||||
private:
|
||||
void setPointId(QComboBox *box, quint32 &pointId, const quint32 &value, const quint32 &id);
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -186,7 +186,9 @@
|
|||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="go-down"/>
|
||||
<iconset theme="go-down">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
|
@ -265,7 +267,7 @@
|
|||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<widget class="QLabel" name="labelFirstPoint">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
|
@ -289,7 +291,7 @@
|
|||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<widget class="QLabel" name="labelSecondPoint">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
|
@ -313,7 +315,7 @@
|
|||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<widget class="QLabel" name="labelThirdPoint">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
|
|
Loading…
Reference in New Issue
Block a user