Wrong field will be red.

--HG--
branch : develop
This commit is contained in:
dismine 2013-10-06 19:22:21 +03:00
parent 4c14dd8688
commit 565c697a44
23 changed files with 690 additions and 23 deletions

View File

@ -34,6 +34,8 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, Draw::Draws mode, QWidg
radioButtonIncrements = ui->radioButtonIncrements;
radioButtonLengthLine = ui->radioButtonLengthLine;
lineEditFormula = ui->lineEditFormula;
labelEditFormula = ui->labelEditFormula;
labelEditNamePoint = ui->labelEditNamePoint;
flagFormula = false;
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogAlongLine::DialogAccepted);

View File

@ -24,13 +24,50 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<widget class="QLabel" name="labelEditFormula">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Length</string>
</property>
@ -100,7 +137,44 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="labelEditNamePoint">
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Name new point</string>
</property>

View File

@ -194,14 +194,17 @@ void DialogArc::CheckState(){
}
void DialogArc::EvalRadius(){
labelEditFormula = ui->labelEditRadius;
Eval(ui->lineEditRadius, flagRadius, timerRadius, ui->labelResultRadius);
}
void DialogArc::EvalF1(){
labelEditFormula = ui->labelEditF1;
Eval(ui->lineEditF1, flagF1, timerF1, ui->labelResultF1);
}
void DialogArc::EvalF2(){
labelEditFormula = ui->labelEditF2;
Eval(ui->lineEditF2, flagF2, timerF2, ui->labelResultF2);
}

View File

@ -24,13 +24,50 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<widget class="QLabel" name="labelEditRadius">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Radius</string>
</property>
@ -116,13 +153,50 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="labelEditF1">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>First angle degree</string>
</property>
@ -208,13 +282,50 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="labelEditF2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Second angle degree</string>
</property>

View File

@ -34,6 +34,8 @@ DialogBisector::DialogBisector(const VContainer *data, Draw::Draws mode, QWidget
radioButtonIncrements = ui->radioButtonIncrements;
radioButtonLengthLine = ui->radioButtonLengthLine;
lineEditFormula = ui->lineEditFormula;
labelEditFormula = ui->labelEditFormula;
labelEditNamePoint = ui->labelEditNamePoint;
flagFormula = false;
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogBisector::DialogAccepted);

View File

@ -21,13 +21,50 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<widget class="QLabel" name="labelEditFormula">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Length</string>
</property>
@ -97,13 +134,50 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Name new point</string>
</property>

View File

@ -28,7 +28,7 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
<widget class="QLabel" name="labelEditNameDetail">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>

View File

@ -39,6 +39,8 @@ DialogEndLine::DialogEndLine(const VContainer *data, Draw::Draws mode, QWidget *
radioButtonIncrements = ui->radioButtonIncrements;
radioButtonLengthLine = ui->radioButtonLengthLine;
lineEditFormula = ui->lineEditFormula;
labelEditFormula = ui->labelEditFormula;
labelEditNamePoint = ui->labelEditNamePoint;
flagFormula = false;
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogEndLine::DialogAccepted);

View File

@ -24,13 +24,50 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<widget class="QLabel" name="labelEditFormula">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Length</string>
</property>
@ -141,13 +178,50 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Name new point</string>
</property>

View File

@ -29,6 +29,7 @@ DialogLineIntersect::DialogLineIntersect(const VContainer *data, Draw::Draws mod
number = 0;
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogLineIntersect::DialogAccepted);
labelEditNamePoint = ui->labelEditNamePoint;
flagName = false;
QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogLineIntersect::DialogRejected);

View File

@ -24,13 +24,50 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Name new point</string>
</property>

View File

@ -36,6 +36,8 @@ DialogNormal::DialogNormal(const VContainer *data, Draw::Draws mode, QWidget *pa
radioButtonIncrements = ui->radioButtonIncrements;
radioButtonLengthLine = ui->radioButtonLengthLine;
lineEditFormula = ui->lineEditFormula;
labelEditFormula = ui->labelEditFormula;
labelEditNamePoint = ui->labelEditNamePoint;
flagFormula = false;
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogNormal::DialogAccepted);

View File

@ -24,13 +24,50 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<widget class="QLabel" name="labelEditFormula">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Length</string>
</property>
@ -100,13 +137,50 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Name new point</string>
</property>

View File

@ -33,6 +33,8 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, Draw::Draws m
radioButtonIncrements = ui.radioButtonIncrements;
radioButtonLengthLine = ui.radioButtonLengthLine;
lineEditFormula = ui.lineEditFormula;
labelEditFormula = ui.labelEditFormula;
labelEditNamePoint = ui.labelEditNamePoint;
flagFormula = false;
bOk = ui.buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogPointOfContact::DialogAccepted);

View File

@ -24,13 +24,50 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
<widget class="QLabel" name="labelEditFormula">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Radius</string>
</property>
@ -100,13 +137,50 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Name new point</string>
</property>

View File

@ -35,6 +35,8 @@ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, Draw::Draws mod
radioButtonIncrements = ui->radioButtonIncrements;
radioButtonLengthLine = ui->radioButtonLengthLine;
lineEditFormula = ui->lineEditFormula;
labelEditFormula = ui->labelEditFormula;
labelEditNamePoint = ui->labelEditNamePoint;
flagFormula = false;
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogShoulderPoint::DialogAccepted);

View File

@ -24,13 +24,50 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
<widget class="QLabel" name="labelEditFormula">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Length</string>
</property>
@ -100,13 +137,50 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="labelEditNamePoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Name new point</string>
</property>

View File

@ -33,6 +33,7 @@ DialogSinglePoint::DialogSinglePoint(const VContainer *data, QWidget *parent) :
ui->doubleSpinBoxX->setRange(0,PaperSize/PrintDPI*25.4);
ui->doubleSpinBoxY->setRange(0,PaperSize/PrintDPI*25.4);
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
labelEditNamePoint = ui->labelEditName;
flagName = false;
CheckState();
connect(bOk, &QPushButton::clicked, this, &DialogSinglePoint::DialogAccepted);

View File

@ -64,7 +64,7 @@
</item>
</layout>
</widget>
<widget class="QLabel" name="labelName">
<widget class="QLabel" name="labelEditName">
<property name="geometry">
<rect>
<x>170</x>
@ -73,6 +73,43 @@
<height>17</height>
</rect>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>159</red>
<green>158</green>
<blue>158</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Point name</string>
</property>

View File

@ -28,8 +28,8 @@
DialogTool::DialogTool(const VContainer *data, Draw::Draws mode, QWidget *parent):QDialog(parent), data(data),
isInitialized(false), flagName(true), flagFormula(true), timerFormula(0), bOk(0), spinBoxAngle(0),
lineEditFormula(0), listWidget(0), labelResultCalculation(0), labelDescription(0),
radioButtonSizeGrowth(0), radioButtonStandartTable(0), radioButtonIncrements(0),
lineEditFormula(0), listWidget(0), labelResultCalculation(0), labelDescription(0), labelEditNamePoint(0),
labelEditFormula(0), radioButtonSizeGrowth(0), radioButtonStandartTable(0), radioButtonIncrements(0),
radioButtonLengthLine(0), idDetail(0), mode(mode){
Q_CHECK_PTR(data);
timerFormula = new QTimer(this);
@ -146,9 +146,13 @@ void DialogTool::PutValHere(QLineEdit *lineEdit, QListWidget *listWidget){
void DialogTool::ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer *timer){
Q_CHECK_PTR(edit);
Q_CHECK_PTR(timer);
Q_CHECK_PTR(labelEditFormula);
if(edit->text().isEmpty()){
flag = false;
CheckState();
QPalette palette = labelEditFormula->palette();
palette.setColor(labelEditFormula->foregroundRole(), Qt::red);
labelEditFormula->setPalette(palette);
return;
}
timer->start(1000);
@ -158,8 +162,11 @@ void DialogTool::Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label)
Q_CHECK_PTR(edit);
Q_CHECK_PTR(timer);
Q_CHECK_PTR(label);
Q_CHECK_PTR(labelEditFormula);
QPalette palette = labelEditFormula->palette();
if(edit->text().isEmpty()){
flag = false;
palette.setColor(labelEditFormula->foregroundRole(), Qt::red);
} else {
Calculator cal(data);
QString errorMsg;
@ -167,13 +174,16 @@ void DialogTool::Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label)
if(!errorMsg.isEmpty()){
label->setText(tr("Error"));
flag = false;
palette.setColor(labelEditFormula->foregroundRole(), Qt::red);
} else {
label->setText(QString().setNum(result));
flag = true;
palette.setColor(labelEditFormula->foregroundRole(), QColor(76,76,76));
}
}
CheckState();
timer->stop();
labelEditFormula->setPalette(palette);
}
void DialogTool::setCurrentPointId(QComboBox *box, qint64 &pointId, const qint64 &value,
@ -207,13 +217,20 @@ void DialogTool::ChoosedObject(qint64 id, Scene::Scenes type){
}
void DialogTool::NamePointChanged(){
Q_CHECK_PTR(labelEditNamePoint);
QLineEdit* edit = qobject_cast<QLineEdit*>(sender());
if (edit){
QString name = edit->text();
if(name.isEmpty() || name.contains(" ")){
flagName = false;
QPalette palette = labelEditNamePoint->palette();
palette.setColor(labelEditNamePoint->foregroundRole(), Qt::red);
labelEditNamePoint->setPalette(palette);
} else {
flagName = true;
QPalette palette = labelEditNamePoint->palette();
palette.setColor(labelEditNamePoint->foregroundRole(), QColor(76,76,76));
labelEditNamePoint->setPalette(palette);
}
}
CheckState();

View File

@ -79,6 +79,8 @@ protected:
QListWidget *listWidget;
QLabel *labelResultCalculation;
QLabel *labelDescription;
QLabel *labelEditNamePoint;
QLabel *labelEditFormula;
QRadioButton *radioButtonSizeGrowth;
QRadioButton *radioButtonStandartTable;
QRadioButton *radioButtonIncrements;

View File

@ -108,6 +108,8 @@ MainWindow::MainWindow(QWidget *parent) :
connect(ui->actionAbout_Qt, &QAction::triggered, this, &MainWindow::AboutQt);
connect(ui->actionAbout_Valentina, &QAction::triggered, this, &MainWindow::About);
connect(ui->actionExit, &QAction::triggered, this, &MainWindow::close);
ui->toolBox->setCurrentIndex(0);
}
void MainWindow::ActionNewDraw(){

View File

@ -40,7 +40,7 @@
<string/>
</property>
<property name="currentIndex">
<number>4</number>
<number>0</number>
</property>
<widget class="QWidget" name="page">
<property name="geometry">
@ -303,7 +303,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>150</width>
<width>137</width>
<height>58</height>
</rect>
</property>
@ -379,7 +379,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>150</width>
<width>137</width>
<height>58</height>
</rect>
</property>