We don't need DialogTool::ShowVisToolTip slot anymore.

--HG--
branch : feature
This commit is contained in:
Valentina Zhuravska 2016-07-26 13:45:17 +03:00
parent d248c4f18a
commit f9c9cedfac
9 changed files with 29 additions and 17 deletions

View File

@ -1920,9 +1920,9 @@ void VPattern::ParseToolSpline(VMainGraphicsScene *scene, QDomElement &domElemen
if (spl != nullptr) if (spl != nullptr)
{ {
MainWindow *window = qobject_cast<MainWindow *>(qApp->getMainWindow()); VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow());
SCASSERT(window != nullptr); SCASSERT(window != nullptr);
connect(spl, &VToolSpline::ToolTip, window, &MainWindow::ShowToolTip); connect(spl, &VToolSpline::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
} }
//Rewrite attribute formula. Need for situation when we have wrong formula. //Rewrite attribute formula. Need for situation when we have wrong formula.
@ -2109,9 +2109,9 @@ void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement
if (spl != nullptr) if (spl != nullptr)
{ {
MainWindow *window = qobject_cast<MainWindow *>(qApp->getMainWindow()); VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow());
SCASSERT(window != nullptr); SCASSERT(window != nullptr);
connect(spl, &VToolSplinePath::ToolTip, window, &MainWindow::ShowToolTip); connect(spl, &VToolSplinePath::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
} }
//Rewrite attribute formula. Need for situation when we have wrong formula. //Rewrite attribute formula. Need for situation when we have wrong formula.

View File

@ -29,6 +29,7 @@
#include "dialogcubicbezierpath.h" #include "dialogcubicbezierpath.h"
#include "ui_dialogcubicbezierpath.h" #include "ui_dialogcubicbezierpath.h"
#include "../../visualization/path/vistoolcubicbezierpath.h" #include "../../visualization/path/vistoolcubicbezierpath.h"
#include "../vwidgets/vabstractmainwindow.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
# include "../vmisc/vmath.h" # include "../vmisc/vmath.h"
@ -129,7 +130,9 @@ void DialogCubicBezierPath::ChosenObject(quint32 id, const SceneObject &type)
if (path.CountPoints() == 1) if (path.CountPoints() == 1)
{ {
visPath->VisualMode(NULL_ID); visPath->VisualMode(NULL_ID);
connect(visPath, &VisToolCubicBezierPath::ToolTip, this, &DialogTool::ShowVisToolTip); VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow());
SCASSERT(window != nullptr);
connect(visPath, &VisToolCubicBezierPath::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
} }
else else
{ {

View File

@ -36,6 +36,7 @@
#include "../../../vwidgets/vmaingraphicsscene.h" #include "../../../vwidgets/vmaingraphicsscene.h"
#include "../../tools/vabstracttool.h" #include "../../tools/vabstracttool.h"
#include "../support/dialogeditwrongformula.h" #include "../support/dialogeditwrongformula.h"
#include "../vwidgets/vabstractmainwindow.h"
#include <QTimer> #include <QTimer>
@ -218,7 +219,9 @@ void DialogCurveIntersectAxis::ChosenObject(quint32 id, const SceneObject &type)
{ {
number++; number++;
line->VisualMode(id); line->VisualMode(id);
connect(line, &VisToolCurveIntersectAxis::ToolTip, this, &DialogTool::ShowVisToolTip); VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow());
SCASSERT(window != nullptr);
connect(line, &VisToolCurveIntersectAxis::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
} }
} }
break; break;

View File

@ -36,6 +36,7 @@
#include "../../../vwidgets/vmaingraphicsscene.h" #include "../../../vwidgets/vmaingraphicsscene.h"
#include "../../tools/vabstracttool.h" #include "../../tools/vabstracttool.h"
#include "../support/dialogeditwrongformula.h" #include "../support/dialogeditwrongformula.h"
#include "../vwidgets/vabstractmainwindow.h"
#include <QTimer> #include <QTimer>
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -167,7 +168,9 @@ void DialogEndLine::ChosenObject(quint32 id, const SceneObject &type)
if (SetObject(id, ui->comboBoxBasePoint, "")) if (SetObject(id, ui->comboBoxBasePoint, ""))
{ {
vis->VisualMode(id); vis->VisualMode(id);
connect(vis, &Visualization::ToolTip, this, &DialogTool::ShowVisToolTip); VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow());
SCASSERT(window != nullptr);
connect(vis, &Visualization::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
prepare = true; prepare = true;
} }
} }

View File

@ -36,6 +36,7 @@
#include "../../../vwidgets/vmaingraphicsscene.h" #include "../../../vwidgets/vmaingraphicsscene.h"
#include "../../tools/vabstracttool.h" #include "../../tools/vabstracttool.h"
#include "../support/dialogeditwrongformula.h" #include "../support/dialogeditwrongformula.h"
#include "../vwidgets/vabstractmainwindow.h"
#include <QTimer> #include <QTimer>
@ -243,7 +244,9 @@ void DialogLineIntersectAxis::ChosenObject(quint32 id, const SceneObject &type)
{ {
number++; number++;
line->VisualMode(id); line->VisualMode(id);
connect(line, &VisToolLineIntersectAxis::ToolTip, this, &DialogTool::ShowVisToolTip); VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow());
SCASSERT(window != nullptr);
connect(line, &VisToolLineIntersectAxis::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
} }
break; break;
case (1): case (1):

View File

@ -38,6 +38,7 @@
#include "../../visualization/line/vistoolrotation.h" #include "../../visualization/line/vistoolrotation.h"
#include "../support/dialogeditwrongformula.h" #include "../support/dialogeditwrongformula.h"
#include "../qmuparser/qmudef.h" #include "../qmuparser/qmudef.h"
#include "../vwidgets/vabstractmainwindow.h"
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogRotation::DialogRotation(const VContainer *data, const quint32 &toolId, QWidget *parent) DialogRotation::DialogRotation(const VContainer *data, const quint32 &toolId, QWidget *parent)
@ -217,7 +218,9 @@ void DialogRotation::ChosenObject(quint32 id, const SceneObject &type)
VisToolRotation *operation = qobject_cast<VisToolRotation *>(vis); VisToolRotation *operation = qobject_cast<VisToolRotation *>(vis);
SCASSERT(operation != nullptr); SCASSERT(operation != nullptr);
connect(operation, &Visualization::ToolTip, this, &DialogTool::ShowVisToolTip); VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow());
SCASSERT(window != nullptr);
connect(operation, &Visualization::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
operation->SetOriginPointId(id); operation->SetOriginPointId(id);
operation->RefreshGeometry(); operation->RefreshGeometry();

View File

@ -33,6 +33,7 @@
#include "../../visualization/path/vistoolsplinepath.h" #include "../../visualization/path/vistoolsplinepath.h"
#include "../support/dialogeditwrongformula.h" #include "../support/dialogeditwrongformula.h"
#include "../qmuparser/qmuparsererror.h" #include "../qmuparser/qmuparsererror.h"
#include "../vwidgets/vabstractmainwindow.h"
#include <QTimer> #include <QTimer>
@ -182,7 +183,10 @@ void DialogSplinePath::ChosenObject(quint32 id, const SceneObject &type)
if (path.CountPoints() == 1) if (path.CountPoints() == 1)
{ {
visPath->VisualMode(NULL_ID); visPath->VisualMode(NULL_ID);
connect(visPath, &VisToolSplinePath::ToolTip, this, &DialogTool::ShowVisToolTip); VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow());
SCASSERT(window != nullptr);
connect(visPath, &VisToolSplinePath::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
connect(visPath, &VisToolSplinePath::PathChanged, this, &DialogSplinePath::PathUpdated); connect(visPath, &VisToolSplinePath::PathChanged, this, &DialogSplinePath::PathUpdated);
} }
else else

View File

@ -907,12 +907,6 @@ QString DialogTool::getPointName() const
return pointName; return pointName;
} }
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::ShowVisToolTip(const QString &toolTip)
{
emit ToolTip(toolTip);
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogTool::ShowDialog(bool click) void DialogTool::ShowDialog(bool click)
{ {

View File

@ -91,7 +91,6 @@ signals:
*/ */
void ToolTip(const QString &toolTip); void ToolTip(const QString &toolTip);
public slots: public slots:
void ShowVisToolTip(const QString &toolTip);
virtual void ChosenObject(quint32 id, const SceneObject &type); virtual void ChosenObject(quint32 id, const SceneObject &type);
virtual void SelectedObject(bool selected, quint32 object, quint32 tool); virtual void SelectedObject(bool selected, quint32 object, quint32 tool);
void NamePointChanged(); void NamePointChanged();