Fixed bug with dialog of arc.

--HG--
branch : develop
This commit is contained in:
dismine 2013-10-09 21:11:25 +03:00
parent b791ac648d
commit 7b56218e09
6 changed files with 19 additions and 13 deletions

View File

@ -64,7 +64,7 @@ void VContainer::setData(const VContainer &data){
standartTable = *data.DataStandartTable();
incrementTable = *data.DataIncrementTable();
lengthLines = *data.DataLengthLines();
lineAngles = *data.DataLengthArcs();
lineAngles = *data.DataLineAngles();
splines = *data.DataSplines();
modelingSplines = *data.DataModelingSplines();
lengthSplines = *data.DataLengthSplines();

View File

@ -63,7 +63,7 @@ DialogArc::DialogArc(const VContainer *data, Draw::Draws mode, QWidget *parent)
connect(ui->radioButtonStandartTable, &QRadioButton::clicked, this, &DialogArc::StandartTable);
connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, &DialogArc::Increments);
connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, &DialogArc::LengthLines);
connect(ui->radioButtonLineAngles, &QRadioButton::clicked, this, &DialogArc::LineArcs);
connect(ui->radioButtonLineAngles, &QRadioButton::clicked, this, &DialogArc::LineAngles);
connect(ui->toolButtonEqualRadius, &QPushButton::clicked, this, &DialogArc::EvalRadius);
connect(ui->toolButtonEqualF1, &QPushButton::clicked, this, &DialogArc::EvalF1);
@ -173,19 +173,22 @@ void DialogArc::PutF2(){
PutValHere(ui->lineEditF2, ui->listWidget);
}
void DialogArc::LineArcs(){
ShowLineArcs();
void DialogArc::LineAngles(){
ShowLineAngles();
}
void DialogArc::RadiusChanged(){
labelEditFormula = ui->labelEditRadius;
ValFormulaChanged(flagRadius, ui->lineEditRadius, timerRadius);
}
void DialogArc::F1Changed(){
labelEditFormula = ui->labelEditF1;
ValFormulaChanged(flagF1, ui->lineEditF1, timerF1);
}
void DialogArc::F2Changed(){
labelEditFormula = ui->labelEditF2;
ValFormulaChanged(flagF2, ui->lineEditF2, timerF2);
}
@ -209,12 +212,13 @@ void DialogArc::EvalF2(){
Eval(ui->lineEditF2, flagF2, timerF2, ui->labelResultF2);
}
void DialogArc::ShowLineArcs(){
void DialogArc::ShowLineAngles(){
disconnect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogArc::ValChenged);
ui->listWidget->clear();
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogArc::ValChenged);
const QHash<QString, qreal> *lineArcsTable = data->DataLineAngles();
QHashIterator<QString, qreal> i(*lineArcsTable);
const QHash<QString, qreal> *lineAnglesTable = data->DataLineAngles();
Q_CHECK_PTR(lineAnglesTable);
QHashIterator<QString, qreal> i(*lineAnglesTable);
while (i.hasNext()) {
i.next();
QListWidgetItem *item = new QListWidgetItem(i.key());

View File

@ -53,7 +53,7 @@ public slots:
void PutRadius();
void PutF1();
void PutF2();
void LineArcs();
void LineAngles();
void RadiusChanged();
void F1Changed();
void F2Changed();
@ -75,7 +75,7 @@ private:
void EvalRadius();
void EvalF1();
void EvalF2();
void ShowLineArcs();
void ShowLineAngles();
};
#endif // DIALOGARC_H

View File

@ -482,7 +482,7 @@
<item>
<widget class="QRadioButton" name="radioButtonLengthArc">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="text">
<string>Length of arcs</string>
@ -492,10 +492,10 @@
<item>
<widget class="QRadioButton" name="radioButtonLengthSpline">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="text">
<string>Length of arcs</string>
<string>Length of curves</string>
</property>
</widget>
</item>

View File

@ -47,6 +47,8 @@ protected:
template <typename Dialog, typename Tool>
void ContextMenu(QSharedPointer<Dialog> &dialog, Tool *tool, QGraphicsSceneContextMenuEvent *event,
bool showRemove = true){
Q_CHECK_PTR(tool);
Q_CHECK_PTR(event);
if(!ignoreContextMenuEvent){
QMenu menu;
QAction *actionOption = menu.addAction(tr("Options"));

View File

@ -44,9 +44,9 @@ void VToolArc::setDialog(){
if(!dialogArc.isNull()){
VArc arc = VAbstractTool::data.GetArc(id);
dialogArc->SetCenter(arc.GetCenter());
dialogArc->SetRadius(arc.GetFormulaRadius());
dialogArc->SetF1(arc.GetFormulaF1());
dialogArc->SetF2(arc.GetFormulaF2());
dialogArc->SetRadius(arc.GetFormulaRadius());
}
}