#include "TextEditor.h"
Public Slots | |
void | slotSaveRequested (void) |
Public Slots inherited from ot::PlainTextEdit | |
void | slotTextChanged (void) |
Signals | |
void | saveRequested (void) |
Public Member Functions | |
TextEditor (QWidget *_parent=(QWidget *) nullptr) | |
virtual | ~TextEditor () |
virtual void | setupFromConfig (const TextEditorCfg &_config, bool _isUpdate) |
Setup the TextEditor. | |
int | lineNumberAreaWidth (void) const |
void | lineNumberAreaPaintEvent (QPaintEvent *_event) |
void | setContentChanged (void) |
void | setContentSaved (void) |
bool | getContentChanged (void) const |
void | setCode (const QString &_text) |
void | setCode (const QStringList &_lines) |
bool | saveToFile (const QString &_fileName) |
QStringList | code (void) const |
void | storeSyntaxHighlighter (SyntaxHighlighter *_highlighter) |
Stores the syntax highlighter. An existing syntax highlighter will be replaced. The TextEditor takes ownership of the highlighter. | |
SyntaxHighlighter * | getSyntaxHighlighter (void) |
Returns the current syntax highlighter. The TextEditor keeps ownership of the highlighter. | |
SyntaxHighlighter * | takeSyntaxHighlighter (void) |
Returns the current syntax highlighter and sets it to 0 internally. The caller takes ownership of the highlighter. | |
void | setTabSpaces (int _spaces) |
int | tabSpaces (void) const |
void | setNewLineWithSamePrefix (bool _enabled) |
bool | newLineWithSamePrefix (void) const |
void | setDuplicateLineShortcutEnabled (bool _enabled) |
bool | isDuplicateLineShortcutEnabled (void) const |
void | setEnableSameTextHighlighting (bool _enabled) |
bool | isSameTextHighlightingEnabled (void) const |
Public Member Functions inherited from ot::PlainTextEdit | |
PlainTextEdit (QWidget *_parent=(QWidget *) nullptr) | |
virtual | ~PlainTextEdit () |
virtual QWidget * | getQWidget (void) override |
Returns a pointer to the root widget of this object. | |
virtual const QWidget * | getQWidget (void) const override |
void | setAutoScrollToBottomEnabled (bool _enabled) |
bool | isAutoScrollToBottomEnabled (void) const |
void | scrollToBottom (void) |
Public Member Functions inherited from ot::QWidgetInterface | |
QWidgetInterface () | |
virtual | ~QWidgetInterface () |
void | setOTWidgetFlags (const WidgetFlags &_flags) |
const WidgetFlags & | otWidgetFlags (void) const |
Protected Member Functions | |
virtual void | keyPressEvent (QKeyEvent *_event) override |
virtual void | resizeEvent (QResizeEvent *_event) override |
virtual void | wheelEvent (QWheelEvent *_event) override |
Protected Member Functions inherited from ot::QWidgetInterface | |
virtual void | otWidgetFlagsChanged (const WidgetFlags &_flags) |
Friends | |
class | TextEditorSearchPopup |
ot::TextEditor::TextEditor | ( | QWidget * | _parent = (QWidget*)nullptr | ) |
|
virtual |
QStringList ot::TextEditor::code | ( | void | ) | const |
bool ot::TextEditor::getContentChanged | ( | void | ) | const |
|
inline |
Returns the current syntax highlighter. The TextEditor keeps ownership of the highlighter.
|
inline |
|
inline |
|
overrideprotectedvirtual |
void ot::TextEditor::lineNumberAreaPaintEvent | ( | QPaintEvent * | _event | ) |
int ot::TextEditor::lineNumberAreaWidth | ( | void | ) | const |
|
inline |
|
overrideprotectedvirtual |
|
signal |
bool ot::TextEditor::saveToFile | ( | const QString & | _fileName | ) |
void ot::TextEditor::setCode | ( | const QString & | _text | ) |
void ot::TextEditor::setCode | ( | const QStringList & | _lines | ) |
void ot::TextEditor::setContentChanged | ( | void | ) |
void ot::TextEditor::setContentSaved | ( | void | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
virtual |
Setup the TextEditor.
_config | The config. |
_isUpdate | If true the text, name and title won't be set. |
|
slot |
void ot::TextEditor::storeSyntaxHighlighter | ( | SyntaxHighlighter * | _highlighter | ) |
Stores the syntax highlighter. An existing syntax highlighter will be replaced. The TextEditor takes ownership of the highlighter.
|
inline |
ot::SyntaxHighlighter * ot::TextEditor::takeSyntaxHighlighter | ( | void | ) |
Returns the current syntax highlighter and sets it to 0 internally. The caller takes ownership of the highlighter.
|
overrideprotectedvirtual |
|
friend |