#include "TextEditorView.h"
Public Member Functions | |
TextEditorView () | |
virtual | ~TextEditorView () |
virtual QWidget * | getViewWidget (void) override |
Returns the widget that is set to this widget view. | |
virtual void | setupFromConfig (const TextEditorCfg &_config, bool _isUpdate) override |
Setup the TextEditor. | |
![]() | |
TextEditor (QWidget *_parent=(QWidget *) nullptr) | |
virtual | ~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) |
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 |
![]() | |
PlainTextEdit (QWidget *_parent=(QWidget *) nullptr) | |
virtual | ~PlainTextEdit () |
virtual QWidget * | getQWidget (void) override |
Returns a pointer to the root widget of this object. | |
void | setAutoScrollToBottomEnabled (bool _enabled) |
bool | isAutoScrollToBottomEnabled (void) const |
void | scrollToBottom (void) |
![]() | |
QWidgetInterface () | |
virtual | ~QWidgetInterface () |
void | setOTWidgetFlags (const WidgetFlags &_flags) |
const WidgetFlags & | otWidgetFlags (void) const |
virtual void | otWidgetFlagsChanged (const WidgetFlags &_flags) |
void | centerOnParent (const QWidget *const _parentWidget) |
Centers this widget on the parent. If no parent is provided the widget will center on the screen. | |
QPoint | calculateCenterOnParentPos (const QWidget *const _parentWidget) |
Calculates the top left corner of this widget centered on the parent widget. If no parent is provided the widget will center on the screen. | |
![]() | |
WidgetView (WidgetViewBase::ViewType _viewType) | |
virtual | ~WidgetView () |
virtual void | setViewWidgetFocus (void) |
Sets the input focus to the view widget. Custom widget views with nested widgets can override this method to set the focus to the correct widget. By default the root widget (widget returned by WidgetView::getViewWidget()) will get the focus set. | |
void | setViewData (const WidgetViewBase &_data) |
WidgetViewBase & | getViewData (void) |
const WidgetViewBase & | getViewData (void) const |
ads::CDockWidget * | getViewDockWidget (void) const |
Returns the dock widget that belongs to this widget view. | |
QAction * | getViewToggleAction (void) const |
Returns the dock widget toggle visibility action. Returns 0 if no widget view is set. | |
void | setViewIsPermanent (bool _permanent=true) |
Permanent views wont be removed from the widget view manager when calling remove view. | |
bool | getViewIsPermanent (void) const |
Permanent views wont be removed from the widget view manager when calling remove view. | |
void | setViewContentModified (bool _isModified) |
Set the view modified state. Modified views will change the title to display an unsaved change. | |
bool | getViewContentModified (void) const |
QString | getCurrentViewTitle (void) const |
Returns the widget view title that is currently displayed. | |
void | setAsCurrentViewTab (void) |
bool | isCurrentViewTab (void) const |
Protected Member Functions | |
virtual void | contentSaved (void) override |
virtual void | contentChanged (void) override |
![]() | |
virtual void | keyPressEvent (QKeyEvent *_event) override |
virtual void | resizeEvent (QResizeEvent *_event) override |
virtual void | wheelEvent (QWheelEvent *_event) override |
![]() | |
void | addWidgetToDock (QWidget *_widget) |
Call this function as soon as the widget for this view is created to add it to the dock. | |
Additional Inherited Members | |
![]() | |
enum | InsertFlag { NoInsertFlags = 0 << 0 , KeepCurrentFocus = 1 << 0 } |
typedef ot::Flags< InsertFlag > | InsertFlags |
![]() | |
void | slotTextChanged (void) |
![]() | |
void | saveRequested (void) |
![]() | |
static std::string | createStoredViewName (const WidgetViewBase &_view) |
static std::string | createStoredViewName (const std::string &_entityName, WidgetViewBase::ViewType _viewType) |
Creates the name that should be used in the view management logic. The resulted name has the following syntax: <entityName>$<viewTypeString> | |
![]() | |
WidgetFlags | m_widgetFlags |
ot::TextEditorView::TextEditorView | ( | ) |
|
virtual |
|
overrideprotectedvirtual |
Reimplemented from ot::TextEditor.
|
overrideprotectedvirtual |
Reimplemented from ot::TextEditor.
|
overridevirtual |
Returns the widget that is set to this widget view.
Implements ot::WidgetView.
|
overridevirtual |
Setup the TextEditor.
_config | The config. |
_isUpdate | If true the text, name and title won't be set. |
Reimplemented from ot::TextEditor.