tilde~
Puredata Qt-based GUI
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
UIText.h
Go to the documentation of this file.
1 // (c) 2017 Alex Nadzharov
2 // License: GPL3
3 
4 #ifndef cmo_text_H
5 #define cmo_text_H
6 
7 #include <QPlainTextEdit>
8 
9 #include "Port.h"
10 #include "UIObject.h"
11 
12 #include <QGraphicsView>
13 
14 #include "PropertyList.h"
15 #include <QStyleOptionGraphicsItem>
16 #include "Preferences.h"
17 
18 namespace tilde {
19 
22 class UIText : public UIObject {
23  Q_OBJECT
24 
25 private:
26  bool _clicked;
27  QPlainTextEdit* _editor;
28 
29  QStringList getEditorData();
30 
31 public:
32  explicit UIText();
33 
34  static UIObject* createObj(QString data);
35  virtual void paint(QPainter* p, const QStyleOptionGraphicsItem* option, QWidget*);
36 
37  // ------------------
38 
39  void initProperties();
40 
41  // ------------------
42 
43  void objectPressEvent(QGraphicsSceneMouseEvent* ev);
44  void autoResize();
45 
46  // ---------------------------
47 
48  virtual void fromQString(QString objData);
49 
50  bool eventFilter(QObject*, QEvent* event);
51 
52  virtual void sync();
53 
54 signals:
55 
56 private slots:
57  void editorDone();
58  void editorChanged();
59 
60  void textPropertyChanged();
61  void colorPropertyChanged();
62 
63  virtual void propertyFontSize();
64 
65  void propertyAutoResize();
66 };
67 }
68 #endif // cmo_text_H
bool eventFilter(QObject *, QEvent *event)
Definition: UIText.cpp:216
static UIObject * createObj(QString data)
Definition: UIText.cpp:75
UIText()
Definition: UIText.cpp:11
void objectPressEvent(QGraphicsSceneMouseEvent *ev)
Definition: UIText.cpp:141
void autoResize()
custom resize event
Definition: UIText.cpp:154
virtual void fromQString(QString objData)
template
Definition: UIText.cpp:189
virtual void paint(QPainter *p, const QStyleOptionGraphicsItem *option, QWidget *)
UIObject properties
Definition: UIText.cpp:84
void initProperties()
Definition: UIText.cpp:117
gui object: comment box (ui.text)
Definition: UIText.h:22
Definition: UIObject.h:44
virtual void sync()
Definition: UIText.cpp:236
Definition: g_canvas.h:89