text editor and textfield editor : use QPropertyUndoCommand instead of ChangePartCommand

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4072 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2015-07-24 12:56:27 +00:00
parent d56e6e60b1
commit 58d247ced7
4 changed files with 267 additions and 116 deletions

View File

@@ -17,49 +17,57 @@
*/
#ifndef TEXT_EDITOR_H
#define TEXT_EDITOR_H
#include <QtWidgets>
#include "elementitemeditor.h"
class PartText;
class QTextOrientationSpinBoxWidget;
class QLineEdit;
class QDoubleSpinBox;
class QSpinBox;
class QButtonGroup;
class QRadioButton;
/**
This class provides a widget to edit static texts within the element
editor.
*/
class TextEditor : public ElementItemEditor {
class TextEditor : public ElementItemEditor
{
Q_OBJECT
// Constructors, destructor
// Constructors, destructor
public:
TextEditor(QETElementEditor *, PartText * = 0, QWidget * = 0);
virtual ~TextEditor();
TextEditor(QETElementEditor *, PartText * = 0, QWidget * = 0);
virtual ~TextEditor();
private:
TextEditor(const TextEditor &);
TextEditor(const TextEditor &);
// attributes
// attributes
private:
PartText *part;
QLineEdit *qle_text;
QDoubleSpinBox *qle_x, *qle_y;
QSpinBox *font_size;
QButtonGroup *color_;
QRadioButton *black_color_, *white_color_;
QTextOrientationSpinBoxWidget *rotation_angle_;
PartText *part;
QLineEdit *qle_text;
QDoubleSpinBox *qle_x, *qle_y;
QSpinBox *font_size;
QButtonGroup *color_;
QRadioButton *black_color_, *white_color_;
QTextOrientationSpinBoxWidget *rotation_angle_;
bool m_locked;
// methods
// methods
public:
virtual bool setPart(CustomElementPart *);
virtual CustomElementPart *currentPart() const;
virtual bool setPart(CustomElementPart *);
virtual CustomElementPart *currentPart() const;
public slots:
void updateText();
void updateTextX();
void updateTextY();
void updateTextT();
void updateTextS();
void updateTextC();
void updateTextRotationAngle();
void updateForm();
void updateTextT();
void updateTextS();
void updateTextC();
void updateTextRotationAngle();
void updatePos();
void updateForm();
private:
void activeConnections(bool);
void activeConnections(bool);
};
#endif