Changeset 13537 for branches/OMEdit/OMEditGUI/TextAnnotation.h
- Timestamp:
- 2012-10-20T20:27:24+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OMEdit/OMEditGUI/TextAnnotation.h
r13405 r13537 45 45 class OMCProxy; 46 46 class IconParameters; 47 class Component _OMC;47 class Component; 48 48 49 class TextAnnotation _OMC : public ShapeAnnotation_OMC49 class TextAnnotation : public ShapeAnnotation 50 50 { 51 51 Q_OBJECT 52 52 public: 53 TextAnnotation _OMC(QString annotation, Component_OMC*pParent);53 TextAnnotation(QString annotation, Component *pParent); 54 54 void parseShapeAnnotation(QString annotation); 55 55 QRectF boundingRect() const; … … 58 58 void checkNameString(); 59 59 private: 60 Component _OMC*mpComponent;60 Component *mpComponent; 61 61 QString mTextString; 62 62 qreal mFontSize; … … 66 66 }; 67 67 68 69 class TextAnnotation : public ShapeAnnotation70 {71 Q_OBJECT72 private:73 QString mTextString;74 qreal mFontSize;75 qreal mCalculatedFontSize;76 QString mFontName;77 int mFontWeight;78 bool mFontItalic;79 bool mFontUnderLine;80 //double mDefaultFontSize;81 Qt::Alignment mHorizontalAlignment;82 QRectF mDrawingRect;83 qreal mLetterSpacing;84 public:85 TextAnnotation(QString shape, Component *pParent);86 TextAnnotation(GraphicsView *graphicsView, QGraphicsItem *pParent = 0);87 TextAnnotation(QString shape, GraphicsView *graphicsView, QGraphicsItem *pParent = 0);88 89 QRectF boundingRect() const;90 QString getTextString();91 QPainterPath shape() const;92 QString getShapeAnnotation();93 QRectF getDrawingRect();94 void setLetterSpacing(qreal letterSpacing);95 void setLetterSpacingOnFont(QFont *font, qreal letterSpacing);96 qreal getLetterSpacing();97 98 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);99 void checkNameString();100 void checkParameterString();101 bool updateParameterString(IconParameters *pParamter);102 void setTextString(QString text);103 void setFontName(QString fontName);104 QString getFontName();105 void setFontSize(double fontSize);106 double getFontSize();107 void setItalic(bool italic);108 bool getItalic();109 void setWeight(int bold);110 bool getWeight();111 void setUnderLine(bool underLine);112 bool getUnderLine();113 void setAlignment(Qt::Alignment alignment);114 QString getAlignment();115 void drawRectangleCornerItems();116 void updateEndPoint(QPointF point);117 void addPoint(QPointF point);118 void updateAnnotation();119 void parseShapeAnnotation(QString shape, OMCProxy *omc);120 121 Component *mpComponent;122 signals:123 void extentChanged();124 public slots:125 void updatePoint(int index, QPointF point);126 void calculateFontSize();127 };128 129 class TextWidget : public QDialog130 {131 Q_OBJECT132 public:133 TextWidget(TextAnnotation *pTextShape, MainWindow *parent);134 MainWindow *mpMainWindow;135 void setUpForm();136 void show();137 private:138 Label *mpHeading;139 QFrame *mHorizontalLine;140 Label *mpTextLabel;141 QLineEdit *mpTextBox;142 Label *mpFontLabel;143 QFontComboBox *mpFontFamilyComboBox;144 Label *mpFontSizeLabel;145 QComboBox *mpFontSizeComboBox;146 Label *mpAlignmentLabel;147 QComboBox *mpAlignmentComboBox;148 QGroupBox *mpStylesGroup;149 QCheckBox *mpCursive;150 QCheckBox *mpBold;151 QCheckBox *mpUnderline;152 QPushButton *mpEditButton;153 QPushButton *mpCancelButton;154 QDialogButtonBox *mpButtonBox;155 156 TextAnnotation *mpTextAnnotation;157 public slots:158 void edit();159 };160 161 68 #endif // TEXTANNOTATION_H
Note: See TracChangeset
for help on using the changeset viewer.