QElectroTech  0.70
Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
TextEditor Class Reference

#include <texteditor.h>

Public Member Functions

 TextEditor (QETElementEditor *editor, PartText *text=nullptr, QWidget *parent=nullptr)
 TextEditor::TextEditor Default constructor. More...
 
 ~TextEditor () override
 TextEditor::~TextEditor. More...
 
void updateForm () override
 TextEditor::updateForm Update the gui. More...
 
bool setPart (CustomElementPart *part) override
 TextEditor::setPart Set the current text to edit. Set to nullptr to clear the current text. More...
 
CustomElementPartcurrentPart () const override
 TextEditor::currentPart. More...
 
- Public Member Functions inherited from ElementItemEditor
 ElementItemEditor (QETElementEditor *, QWidget *=nullptr)
 
 ~ElementItemEditor () override
 
virtual QETElementEditorelementEditor () const
 
virtual ElementSceneelementScene () const
 
virtual QUndoStack & undoStack () const
 
virtual QString elementTypeName () const
 
virtual void setElementTypeName (const QString &)
 
virtual void detach ()
 
virtual bool setParts (QList< CustomElementPart *>)
 

Private Slots

void on_m_font_pb_clicked ()
 TextEditor::on_m_font_pb_clicked. More...
 
void on_m_color_pb_changed (const QColor &newColor)
 TextEditor::on_m_color_pb_changed. More...
 

Private Member Functions

void setUpEditConnection ()
 TextEditor::setUpEditConnection Setup the connection between the widgets of this editor and the undo command use to apply the change to the edited text. More...
 

Private Attributes

Ui::TextEditor * ui
 
QPointer< PartTextm_text
 
QList< QMetaObject::Connection > m_edit_connection
 
QList< QMetaObject::Connection > m_change_connection
 

Detailed Description

Definition at line 32 of file texteditor.h.

Constructor & Destructor Documentation

◆ TextEditor()

TextEditor::TextEditor ( QETElementEditor editor,
PartText text = nullptr,
QWidget *  parent = nullptr 
)
explicit

TextEditor::TextEditor Default constructor.

Parameters
editor: the element editor who use this editor
text: the text to edit
parent: the parent widget

Definition at line 30 of file texteditor.cpp.

References setPart(), setUpEditConnection(), ui, and updateForm().

◆ ~TextEditor()

TextEditor::~TextEditor ( )
override

TextEditor::~TextEditor.

Definition at line 46 of file texteditor.cpp.

References ui.

Member Function Documentation

◆ currentPart()

CustomElementPart * TextEditor::currentPart ( ) const
overridevirtual

TextEditor::currentPart.

Returns
The current part

Implements ElementItemEditor.

Definition at line 120 of file texteditor.cpp.

References m_text.

◆ on_m_color_pb_changed

void TextEditor::on_m_color_pb_changed ( const QColor &  newColor)
privateslot

TextEditor::on_m_color_pb_changed.

Parameters
newColor

Definition at line 216 of file texteditor.cpp.

References m_text, QET::Icons::tr, and ElementItemEditor::undoStack().

◆ on_m_font_pb_clicked

void TextEditor::on_m_font_pb_clicked ( )
privateslot

◆ setPart()

bool TextEditor::setPart ( CustomElementPart part)
overridevirtual

TextEditor::setPart Set the current text to edit. Set to nullptr to clear the current text.

Parameters
part: part to edit
Returns
: return if is a partext or nullptr, else return false

Implements ElementItemEditor.

Definition at line 83 of file texteditor.cpp.

References PartText::colorChanged(), PartText::fontChanged(), m_change_connection, m_text, PartText::plainTextChanged(), and updateForm().

Referenced by TextEditor().

◆ setUpEditConnection()

void TextEditor::setUpEditConnection ( )
private

TextEditor::setUpEditConnection Setup the connection between the widgets of this editor and the undo command use to apply the change to the edited text.

Definition at line 129 of file texteditor.cpp.

References m_edit_connection, and ui.

Referenced by TextEditor(), and updateForm().

◆ updateForm()

void TextEditor::updateForm ( )
overridevirtual

TextEditor::updateForm Update the gui.

Implements ElementItemEditor.

Definition at line 54 of file texteditor.cpp.

References m_edit_connection, m_text, setUpEditConnection(), and ui.

Referenced by setPart(), and TextEditor().

Member Data Documentation

◆ m_change_connection

QList<QMetaObject::Connection> TextEditor::m_change_connection
private

Definition at line 55 of file texteditor.h.

Referenced by setPart().

◆ m_edit_connection

QList<QMetaObject::Connection> TextEditor::m_edit_connection
private

Definition at line 54 of file texteditor.h.

Referenced by setUpEditConnection(), and updateForm().

◆ m_text

QPointer<PartText> TextEditor::m_text
private

◆ ui

Ui::TextEditor* TextEditor::ui
private

The documentation for this class was generated from the following files: