Choreonoid  1.8
TextEdit.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_BASE_TEXT_EDIT_H
7 #define CNOID_BASE_TEXT_EDIT_H
8 
9 #include <QTextEdit>
10 #include <QPlainTextEdit>
11 #include <QScrollBar>
12 #include <cnoid/Signal>
13 #include "exportdecl.h"
14 
15 namespace cnoid {
16 
17 class CNOID_EXPORT PlainTextEdit : public QPlainTextEdit
18 {
19  Q_OBJECT
20 
21  public:
22  PlainTextEdit(QWidget* parent = 0);
23 
25  return sigCursorPositionChanged_;
26  }
27 
28 private Q_SLOTS:
29  void onCursorPositionChanged();
30 
31 private:
32  Signal<void()> sigCursorPositionChanged_;
33 };
34 
35 class CNOID_EXPORT TextEdit : public QTextEdit
36 {
37  Q_OBJECT
38 
39  public:
40  TextEdit(QWidget* parent = 0);
41  int getScrollPos();
42  void setScrollPos(int pos);
43  int maxScrollPos();
44  int scrollSingleStep();
45 
46  SignalProxy<void(const QTextCharFormat& f)> sigCurrentCharFormatChanged() {
47  return sigCurrentCharFormatChanged_;
48  }
50  return sigCursorPositionChanged_;
51  }
52  SignalProxy<void(int)> sigScroll() {
53  return sigScroll_;
54  }
55 
56 private Q_SLOTS:
57  void onCurrentCharFormatChanged(const QTextCharFormat& f);
58  void onCursorPositionChanged();
59  void onScroll(int value);
60 
61 private:
62  QScrollBar *vScrollBar;
63  Signal<void(const QTextCharFormat& f)> sigCurrentCharFormatChanged_;
64  Signal<void()> sigCursorPositionChanged_;
65  Signal<void(int)> sigScroll_;
66 };
67 
68 }
69 
70 #endif
cnoid::PlainTextEdit::sigCursorPositionChanged
SignalProxy< void()> sigCursorPositionChanged()
Definition: TextEdit.h:24
cnoid::TextEdit::sigCurrentCharFormatChanged
SignalProxy< void(const QTextCharFormat &f)> sigCurrentCharFormatChanged()
Definition: TextEdit.h:46
cnoid::TextEdit
Definition: TextEdit.h:35
cnoid::TextEdit::sigScroll
SignalProxy< void(int)> sigScroll()
Definition: TextEdit.h:52
cnoid::PlainTextEdit
Definition: TextEdit.h:17
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::Signal
Definition: Signal.h:165
cnoid::SignalProxy
Definition: Signal.h:470
cnoid::TextEdit::sigCursorPositionChanged
SignalProxy< void()> sigCursorPositionChanged()
Definition: TextEdit.h:49