Fixed issue #704. Valentina crashes if click on detail.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-06-09 12:39:24 +03:00
parent f12e9ee4ac
commit 45ced25561
7 changed files with 31 additions and 2 deletions

View File

@ -19,6 +19,7 @@
- [#702] Valentina produces broken shortcut (.lnk) files on Windows.
- Changed default behaviour if path to multisize measurements or templates doesn't exist.
- [#703] Valentina warns about format rewriting for unsaved files.
- [#704] Valentina crashes if click on detail.
# Version 0.5.0 May 9, 2017
- [#581] User can now filter input lists by keyword in function wizard.

View File

@ -103,7 +103,7 @@ enum class PiecePathIncludeType : unsigned char
enum class PiecePathType : unsigned char {PiecePath = 0, CustomSeamAllowance = 1, InternalPath = 2, Unknown = 3};
typedef unsigned char ToolVisHolderType;
typedef int ToolVisHolderType;
enum class Tool : ToolVisHolderType
{
Arrow,
@ -207,7 +207,13 @@ enum class Vis : ToolVisHolderType
ToolPiece,
ToolPiecePath,
ToolPin,
PiecePins
PiecePins,
NoBrush,
CurvePathItem,
GrainlineItem,
PieceItem,
TextGraphicsItem,
LAST_ONE_DO_NOT_USE //add new stuffs above this, this constant must be last and never used
};
enum class VarType : char { Measurement, Increment, LineLength, CurveLength, CurveCLength, LineAngle, CurveAngle,

View File

@ -32,6 +32,8 @@
#include <QGraphicsPathItem>
#include <QtGlobal>
#include "../vmisc/def.h"
class VCurvePathItem : public QGraphicsPathItem
{
public:
@ -40,6 +42,9 @@ public:
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Vis::CurvePathItem)};
void SetDirectionPath(const QPainterPath &path);
private:
Q_DISABLE_COPY(VCurvePathItem)

View File

@ -31,6 +31,7 @@
#include "vpieceitem.h"
#include "../vpatterndb/floatItemData/vgrainlinedata.h"
#include "../vmisc/def.h"
class VGrainlineItem : public VPieceItem
{
@ -44,6 +45,9 @@ public:
virtual void paint(QPainter* pP, const QStyleOptionGraphicsItem* pOption, QWidget* pWidget) Q_DECL_OVERRIDE;
void UpdateGeometry(const QPointF& ptPos, qreal dRotation, qreal dLength, ArrowType eAT);
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Vis::GrainlineItem)};
bool IsContained(const QPointF &pt, qreal dRot, qreal &dX, qreal &dY) const;
signals:

View File

@ -33,6 +33,8 @@
#include <QGraphicsPathItem>
#include <QtGlobal>
#include "../vmisc/def.h"
class VNoBrushScalePathItem : public QGraphicsPathItem
{
public:
@ -42,6 +44,9 @@ protected:
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option,
QWidget * widget = nullptr) Q_DECL_OVERRIDE;
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Vis::NoBrush)};
private:
Q_DISABLE_COPY(VNoBrushScalePathItem)
};

View File

@ -32,6 +32,8 @@
#include <QtCore/qglobal.h>
#include <QGraphicsObject>
#include "../vmisc/def.h"
class VPieceItem : public QGraphicsObject
{
Q_OBJECT
@ -60,6 +62,9 @@ public:
VPieceItem::MoveTypes GetMoveType() const;
void SetMoveType(const VPieceItem::MoveTypes &moveType);
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Vis::PieceItem)};
signals:
void SignalMoved(const QPointF &ptPos);

View File

@ -58,6 +58,9 @@ public:
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
virtual void Update() Q_DECL_OVERRIDE;
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Vis::TextGraphicsItem)};
void SetFont(const QFont& fnt);
int GetFontSize() const;
void AddLine(const TextLine& tl);