Added special check for tools those use free click.
When a user click on point the app show line between selected point and a mouse cursor. This usefull when need to select an angle or length. But because selection of a point also emit release event this particular event should be ignored. In case of release inside of point circle all worked good, but not if select point by label. --HG-- branch : feature
This commit is contained in:
parent
ebda4292a8
commit
33da692248
|
@ -56,8 +56,11 @@
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
DialogCurveIntersectAxis::DialogCurveIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent)
|
DialogCurveIntersectAxis::DialogCurveIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent)
|
||||||
:DialogTool(data, toolId, parent), ui(new Ui::DialogCurveIntersectAxis), formulaAngle(QString()),
|
: DialogTool(data, toolId, parent),
|
||||||
formulaBaseHeightAngle(0)
|
ui(new Ui::DialogCurveIntersectAxis),
|
||||||
|
formulaAngle(),
|
||||||
|
formulaBaseHeightAngle(0),
|
||||||
|
m_firstRelease(false)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
@ -191,6 +194,14 @@ void DialogCurveIntersectAxis::ShowDialog(bool click)
|
||||||
{
|
{
|
||||||
if (click)
|
if (click)
|
||||||
{
|
{
|
||||||
|
// The check need to ignore first release of mouse button.
|
||||||
|
// User can select point by clicking on a label.
|
||||||
|
if (not m_firstRelease)
|
||||||
|
{
|
||||||
|
m_firstRelease = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*We will ignore click if poinet is in point circle*/
|
/*We will ignore click if poinet is in point circle*/
|
||||||
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
|
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
|
||||||
SCASSERT(scene != nullptr)
|
SCASSERT(scene != nullptr)
|
||||||
|
|
|
@ -88,6 +88,8 @@ private:
|
||||||
|
|
||||||
QString formulaAngle;
|
QString formulaAngle;
|
||||||
int formulaBaseHeightAngle;
|
int formulaBaseHeightAngle;
|
||||||
|
|
||||||
|
bool m_firstRelease;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIALOGCURVEINTERSECTAXIS_H
|
#endif // DIALOGCURVEINTERSECTAXIS_H
|
||||||
|
|
|
@ -62,8 +62,13 @@
|
||||||
* @param parent parent widget
|
* @param parent parent widget
|
||||||
*/
|
*/
|
||||||
DialogEndLine::DialogEndLine(const VContainer *data, const quint32 &toolId, QWidget *parent)
|
DialogEndLine::DialogEndLine(const VContainer *data, const quint32 &toolId, QWidget *parent)
|
||||||
:DialogTool(data, toolId, parent), ui(new Ui::DialogEndLine),
|
: DialogTool(data, toolId, parent),
|
||||||
formulaLength(QString()), formulaAngle(QString()), formulaBaseHeight(0), formulaBaseHeightAngle(0)
|
ui(new Ui::DialogEndLine),
|
||||||
|
formulaLength(),
|
||||||
|
formulaAngle(),
|
||||||
|
formulaBaseHeight(0),
|
||||||
|
formulaBaseHeightAngle(0),
|
||||||
|
m_firstRelease(false)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
@ -298,6 +303,14 @@ void DialogEndLine::ShowDialog(bool click)
|
||||||
{
|
{
|
||||||
if (click)
|
if (click)
|
||||||
{
|
{
|
||||||
|
// The check need to ignore first release of mouse button.
|
||||||
|
// User can select point by clicking on a label.
|
||||||
|
if (not m_firstRelease)
|
||||||
|
{
|
||||||
|
m_firstRelease = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*We will ignore click if pointer is in point circle*/
|
/*We will ignore click if pointer is in point circle*/
|
||||||
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
|
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
|
||||||
SCASSERT(scene != nullptr)
|
SCASSERT(scene != nullptr)
|
||||||
|
|
|
@ -110,6 +110,8 @@ private:
|
||||||
/** @brief formulaBaseHeight base height defined by dialogui */
|
/** @brief formulaBaseHeight base height defined by dialogui */
|
||||||
int formulaBaseHeight;
|
int formulaBaseHeight;
|
||||||
int formulaBaseHeightAngle;
|
int formulaBaseHeightAngle;
|
||||||
|
|
||||||
|
bool m_firstRelease;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIALOGENDLINE_H
|
#endif // DIALOGENDLINE_H
|
||||||
|
|
|
@ -60,8 +60,11 @@
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
DialogLineIntersectAxis::DialogLineIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent)
|
DialogLineIntersectAxis::DialogLineIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent)
|
||||||
:DialogTool(data, toolId, parent), ui(new Ui::DialogLineIntersectAxis), formulaAngle(QString()),
|
: DialogTool(data, toolId, parent),
|
||||||
formulaBaseHeightAngle(0)
|
ui(new Ui::DialogLineIntersectAxis),
|
||||||
|
formulaAngle(),
|
||||||
|
formulaBaseHeightAngle(0),
|
||||||
|
m_firstRelease(false)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
@ -220,6 +223,14 @@ void DialogLineIntersectAxis::ShowDialog(bool click)
|
||||||
{
|
{
|
||||||
if (click)
|
if (click)
|
||||||
{
|
{
|
||||||
|
// The check need to ignore first release of mouse button.
|
||||||
|
// User can select point by clicking on a label.
|
||||||
|
if (not m_firstRelease)
|
||||||
|
{
|
||||||
|
m_firstRelease = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*We will ignore click if poinet is in point circle*/
|
/*We will ignore click if poinet is in point circle*/
|
||||||
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
|
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
|
||||||
SCASSERT(scene != nullptr)
|
SCASSERT(scene != nullptr)
|
||||||
|
|
|
@ -92,6 +92,8 @@ private:
|
||||||
|
|
||||||
QString formulaAngle;
|
QString formulaAngle;
|
||||||
int formulaBaseHeightAngle;
|
int formulaBaseHeightAngle;
|
||||||
|
|
||||||
|
bool m_firstRelease;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIALOGLINEINTERSECTAXIS_H
|
#endif // DIALOGLINEINTERSECTAXIS_H
|
||||||
|
|
|
@ -72,7 +72,8 @@ DialogRotation::DialogRotation(const VContainer *data, const quint32 &toolId, QW
|
||||||
formulaBaseHeightAngle(0),
|
formulaBaseHeightAngle(0),
|
||||||
objects(),
|
objects(),
|
||||||
stage1(true),
|
stage1(true),
|
||||||
m_suffix()
|
m_suffix(),
|
||||||
|
m_firstRelease(false)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
@ -200,6 +201,14 @@ void DialogRotation::ShowDialog(bool click)
|
||||||
}
|
}
|
||||||
else if (not stage1 && prepare && click)
|
else if (not stage1 && prepare && click)
|
||||||
{
|
{
|
||||||
|
// The check need to ignore first release of mouse button.
|
||||||
|
// User can select point by clicking on a label.
|
||||||
|
if (not m_firstRelease)
|
||||||
|
{
|
||||||
|
m_firstRelease = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*We will ignore click if pointer is in point circle*/
|
/*We will ignore click if pointer is in point circle*/
|
||||||
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
|
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
|
||||||
SCASSERT(scene != nullptr)
|
SCASSERT(scene != nullptr)
|
||||||
|
|
|
@ -109,6 +109,8 @@ private:
|
||||||
|
|
||||||
QString m_suffix;
|
QString m_suffix;
|
||||||
|
|
||||||
|
bool m_firstRelease;
|
||||||
|
|
||||||
void EvalAngle();
|
void EvalAngle();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user