DialogShoulderPoint, DialogPointOfIntersection - check if names of points don't
equal. --HG-- branch : develop
This commit is contained in:
parent
3f50c316de
commit
d4d55228a6
|
@ -53,6 +53,10 @@ DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, QWi
|
||||||
FillComboBoxPoints(ui->comboBoxSecondPoint);
|
FillComboBoxPoints(ui->comboBoxSecondPoint);
|
||||||
|
|
||||||
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfIntersection::NamePointChanged);
|
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfIntersection::NamePointChanged);
|
||||||
|
connect(ui->comboBoxFirstPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
|
||||||
|
this, &DialogPointOfIntersection::PointNameChanged);
|
||||||
|
connect(ui->comboBoxSecondPoint, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
|
||||||
|
this, &DialogPointOfIntersection::PointNameChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -69,8 +73,7 @@ DialogPointOfIntersection::~DialogPointOfIntersection()
|
||||||
*/
|
*/
|
||||||
void DialogPointOfIntersection::setSecondPointId(const quint32 &value, const quint32 &id)
|
void DialogPointOfIntersection::setSecondPointId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
secondPointId = value;
|
setPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
||||||
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -125,6 +128,24 @@ void DialogPointOfIntersection::DialogAccepted()
|
||||||
emit DialogClosed(QDialog::Accepted);
|
emit DialogClosed(QDialog::Accepted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void DialogPointOfIntersection::PointNameChanged()
|
||||||
|
{
|
||||||
|
if (getCurrentObjectId(ui->comboBoxFirstPoint) == getCurrentObjectId(ui->comboBoxSecondPoint))
|
||||||
|
{
|
||||||
|
flagError = false;
|
||||||
|
ChangeColor(ui->labelFirstPoint, Qt::red);
|
||||||
|
ChangeColor(ui->labelSecondPoint, Qt::red);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
flagError = true;
|
||||||
|
ChangeColor(ui->labelFirstPoint, QColor(76, 76, 76));
|
||||||
|
ChangeColor(ui->labelSecondPoint, QColor(76, 76, 76));
|
||||||
|
}
|
||||||
|
CheckState();
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setFirstPointId set id of first point
|
* @brief setFirstPointId set id of first point
|
||||||
|
@ -133,8 +154,7 @@ void DialogPointOfIntersection::DialogAccepted()
|
||||||
*/
|
*/
|
||||||
void DialogPointOfIntersection::setFirstPointId(const quint32 &value, const quint32 &id)
|
void DialogPointOfIntersection::setFirstPointId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
firstPointId = value;
|
setPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
||||||
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -61,6 +61,7 @@ public slots:
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
*/
|
*/
|
||||||
virtual void DialogApply(){}
|
virtual void DialogApply(){}
|
||||||
|
virtual void PointNameChanged();
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogPointOfIntersection)
|
Q_DISABLE_COPY(DialogPointOfIntersection)
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="labelFirstPoint">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
@ -102,7 +102,7 @@
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QLabel" name="labelSecondPoint">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
|
|
@ -64,6 +64,12 @@ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, QWidget *parent
|
||||||
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogShoulderPoint::NamePointChanged);
|
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogShoulderPoint::NamePointChanged);
|
||||||
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogShoulderPoint::FormulaTextChanged);
|
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogShoulderPoint::FormulaTextChanged);
|
||||||
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogShoulderPoint::DeployFormulaTextEdit);
|
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogShoulderPoint::DeployFormulaTextEdit);
|
||||||
|
connect(ui->comboBoxP1Line, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
|
||||||
|
this, &DialogShoulderPoint::PointNameChanged);
|
||||||
|
connect(ui->comboBoxP2Line, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
|
||||||
|
this, &DialogShoulderPoint::PointNameChanged);
|
||||||
|
connect(ui->comboBoxPShoulder, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
|
||||||
|
this, &DialogShoulderPoint::PointNameChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -72,6 +78,31 @@ void DialogShoulderPoint::FormulaTextChanged()
|
||||||
this->FormulaChangedPlainText();
|
this->FormulaChangedPlainText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void DialogShoulderPoint::PointNameChanged()
|
||||||
|
{
|
||||||
|
QSet<quint32> set;
|
||||||
|
set.insert(getCurrentObjectId(ui->comboBoxP1Line));
|
||||||
|
set.insert(getCurrentObjectId(ui->comboBoxP2Line));
|
||||||
|
set.insert(getCurrentObjectId(ui->comboBoxPShoulder));
|
||||||
|
|
||||||
|
if (set.size() != 3)
|
||||||
|
{
|
||||||
|
flagError = false;
|
||||||
|
ChangeColor(ui->labelFirstPoint, Qt::red);
|
||||||
|
ChangeColor(ui->labelSecondPoint, Qt::red);
|
||||||
|
ChangeColor(ui->labelPointShoulder, Qt::red);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
flagError = true;
|
||||||
|
ChangeColor(ui->labelFirstPoint, QColor(76, 76, 76));
|
||||||
|
ChangeColor(ui->labelSecondPoint, QColor(76, 76, 76));
|
||||||
|
ChangeColor(ui->labelPointShoulder, QColor(76, 76, 76));
|
||||||
|
}
|
||||||
|
CheckState();
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogShoulderPoint::DeployFormulaTextEdit()
|
void DialogShoulderPoint::DeployFormulaTextEdit()
|
||||||
{
|
{
|
||||||
|
@ -171,7 +202,7 @@ void DialogShoulderPoint::SaveData()
|
||||||
*/
|
*/
|
||||||
void DialogShoulderPoint::setPShoulder(const quint32 &value, const quint32 &id)
|
void DialogShoulderPoint::setPShoulder(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxPShoulder, pShoulder, value, id);
|
setPointId(ui->comboBoxPShoulder, pShoulder, value, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -182,7 +213,7 @@ void DialogShoulderPoint::setPShoulder(const quint32 &value, const quint32 &id)
|
||||||
*/
|
*/
|
||||||
void DialogShoulderPoint::setP2Line(const quint32 &value, const quint32 &id)
|
void DialogShoulderPoint::setP2Line(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxP2Line, p2Line, value, id);
|
setPointId(ui->comboBoxP2Line, p2Line, value, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -193,7 +224,7 @@ void DialogShoulderPoint::setP2Line(const quint32 &value, const quint32 &id)
|
||||||
*/
|
*/
|
||||||
void DialogShoulderPoint::setP1Line(const quint32 &value, const quint32 &id)
|
void DialogShoulderPoint::setP1Line(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxP1Line, p1Line, value, id);
|
setPointId(ui->comboBoxP1Line, p1Line, value, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -78,6 +78,7 @@ public slots:
|
||||||
* @brief FormulaTextChanged when formula text changes for validation and calc
|
* @brief FormulaTextChanged when formula text changes for validation and calc
|
||||||
*/
|
*/
|
||||||
void FormulaTextChanged();
|
void FormulaTextChanged();
|
||||||
|
virtual void PointNameChanged();
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogShoulderPoint)
|
Q_DISABLE_COPY(DialogShoulderPoint)
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>473</width>
|
<width>512</width>
|
||||||
<height>686</height>
|
<height>674</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -189,7 +189,9 @@
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset theme="go-down"/>
|
<iconset theme="go-down">
|
||||||
|
<normaloff/>
|
||||||
|
</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
<size>
|
<size>
|
||||||
|
@ -268,9 +270,9 @@
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="labelFirstPoint">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -301,9 +303,9 @@
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QLabel" name="labelSecondPoint">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -334,7 +336,7 @@
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="labelPointShoulder">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user