Line editor : use QPropertyUndoCommand instead of ChangePartCommand

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4068 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2015-07-23 10:52:56 +00:00
parent 65d4b08c86
commit 5b8a6a9745
5 changed files with 213 additions and 134 deletions

View File

@@ -17,32 +17,37 @@
*/
#ifndef LINE_EDITOR_H
#define LINE_EDITOR_H
#include <QtWidgets>
#include "elementitemeditor.h"
class PartLine;
class StyleEditor;
class QComboBox;
class QDoubleSpinBox;
/**
This class provides a widget to edit lines within the element editor.
*/
class LineEditor : public ElementItemEditor
{
Q_OBJECT
// constructors, destructor
// constructors, destructor
public:
LineEditor(QETElementEditor *, PartLine * = 0, QWidget * = 0);
virtual ~LineEditor();
private:
LineEditor(const LineEditor &);
// attributes
// attributes
private:
PartLine *part;
StyleEditor *style_;
QDoubleSpinBox *x1, *y1, *x2, *y2;
QComboBox *end1_type, *end2_type;
QDoubleSpinBox*end1_length, *end2_length;
bool m_locked;
// methods
// methods
public:
virtual bool setPart(CustomElementPart *);
virtual CustomElementPart *currentPart() const;
@@ -50,15 +55,11 @@ class LineEditor : public ElementItemEditor
QPointF editedP2() const;
public slots:
void updateLine();
void updateLineX1();
void updateLineY1();
void updateLineX2();
void updateLineY2();
void updateLineEndType1();
void updateLineEndLength1();
void updateLineEndType2();
void updateLineEndLength2();
void lineEditingFinished();
void updateForm();
private: