Just set default values and don't show dialog. User still can easy get access

to options.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-07-03 22:22:52 +03:00
parent 0d43f83b34
commit cc64b0627e
13 changed files with 44 additions and 41 deletions

View File

@ -188,15 +188,14 @@ void DialogCurveIntersectAxis::ShowDialog(bool click)
return;
}
}
this->setModal(true);
VisToolCurveIntersectAxis *line = qobject_cast<VisToolCurveIntersectAxis *>(vis);
SCASSERT(line != nullptr);
this->SetAngle(line->Angle());//Show in dialog angle what user choose
emit ToolTip("");
timerFormula->start();
this->show();
DialogAccepted();// Just set default values and don't show dialog
}
}

View File

@ -201,8 +201,7 @@ void DialogHeight::ChosenObject(quint32 id, const SceneObject &type)
line->setLineP2Id(id);
line->RefreshGeometry();
prepare = true;
this->setModal(true);
this->show();
DialogAccepted();
}
}
}

View File

@ -136,6 +136,12 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type)
prepare = true;
flagPoint = CheckIntersecion();
CheckState();
if (flagPoint)
{
DialogAccepted();
}
else
{
this->setModal(true);
this->show();
connect(ui->comboBoxP1Line1,
@ -153,6 +159,7 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type)
}
}
}
}
break;
default:
break;

View File

@ -212,15 +212,14 @@ void DialogLineIntersectAxis::ShowDialog(bool click)
return;
}
}
this->setModal(true);
VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis);
SCASSERT(line != nullptr);
this->SetAngle(line->Angle());//Show in dialog angle what user choose
emit ToolTip("");
timerFormula->start();
this->show();
DialogAccepted();// Just set default values and don't show dialog
}
}

View File

@ -155,8 +155,7 @@ void DialogPointFromArcAndTangent::ChosenObject(quint32 id, const SceneObject &t
point->setArcId(id);
point->RefreshGeometry();
prepare = true;
this->setModal(true);
this->show();
DialogAccepted();
}
}
break;

View File

@ -60,7 +60,7 @@ DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, con
this, &DialogPointOfIntersection::PointNameChanged);
vis = new VisToolPointOfIntersection(data);
vis->VisualMode(NULL_ID);
vis->VisualMode(NULL_ID);//Show vertical axis
FixateSize();
}
@ -119,8 +119,7 @@ void DialogPointOfIntersection::ChosenObject(quint32 id, const SceneObject &type
line->setPoint2Id(id);
line->RefreshGeometry();
prepare = true;
this->setModal(true);
this->show();
DialogAccepted();
}
}
break;

View File

@ -155,8 +155,7 @@ void DialogPointOfIntersectionArcs::ChosenObject(quint32 id, const SceneObject &
point->setArc2Id(id);
point->RefreshGeometry();
prepare = true;
this->setModal(true);
this->show();
DialogAccepted();
}
}
break;

View File

@ -241,8 +241,7 @@ void DialogPointOfIntersectionCircles::ChosenObject(quint32 id, const SceneObjec
point->setPoint2Id(id);
point->RefreshGeometry();
prepare = true;
this->setModal(true);
this->show();
DialogAccepted();
}
}
break;

View File

@ -340,8 +340,12 @@ inline void DialogTool::AddVisualization()
T *toolVis = qobject_cast<T *>(vis);
SCASSERT(toolVis != nullptr);
if (not scene->items().contains(toolVis))
{
connect(scene, &VMainGraphicsScene::NewFactor, toolVis, &Visualization::SetFactor);
scene->addItem(toolVis);
}
toolVis->RefreshGeometry();
}
}

View File

@ -144,8 +144,7 @@ void DialogTriangle::ChosenObject(quint32 id, const SceneObject &type)
line->setHypotenuseP2Id(id);
line->RefreshGeometry();
prepare = true;
this->setModal(true);
this->show();
DialogAccepted();
}
}
}

View File

@ -284,8 +284,7 @@ void DialogTrueDarts::ChosenObject(quint32 id, const SceneObject &type)
points->setD3PointId(id);
points->RefreshGeometry();
prepare = true;
this->setModal(true);
this->show();
DialogAccepted();
}
}
break;

View File

@ -66,13 +66,14 @@ void VisToolPointOfIntersection::RefreshGeometry()
if (point2Id <= NULL_ID)
{
axisL2 = Axis(Visualization::scenePos, 180);
ShowIntersection(axisL1, axisL2, supportColor);
}
else
{
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(point2Id);
DrawPoint(axisP2, second->toQPointF(), supportColor);
axisL2 = Axis(second->toQPointF(), 180);
ShowIntersection(axisL1, axisL2);
ShowIntersection(axisL1, axisL2, mainColor);
}
DrawLine(axis2, axisL2, supportColor, Qt::DashLine);
}
@ -85,14 +86,14 @@ void VisToolPointOfIntersection::setPoint2Id(const quint32 &value)
}
//---------------------------------------------------------------------------------------------------------------------
void VisToolPointOfIntersection::ShowIntersection(const QLineF &axis1, const QLineF &axis2)
void VisToolPointOfIntersection::ShowIntersection(const QLineF &axis1, const QLineF &axis2, const QColor &color)
{
QPointF p;
QLineF::IntersectType intersect = axis1.intersect(axis2, &p);
if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
{
point->setVisible(true);
DrawPoint(point, p, mainColor);
DrawPoint(point, p, color);
}
else
{

View File

@ -51,7 +51,7 @@ private:
QGraphicsEllipseItem *axisP2;
QGraphicsLineItem *axis2;//axis1 is class themself
void ShowIntersection(const QLineF &axis1, const QLineF &axis2);
void ShowIntersection(const QLineF &axis1, const QLineF &axis2, const QColor &color);
};
#endif // VISTOOLPOINTOFINTERSECTION_H