MRichTextEdit Class Reference

A simple rich-text editor. More...

#include <mrichtextedit.h>

Public Slots

void setText (const QString &text)
 

Signals

void editorFinished ()
 
void saveText (QString revText)
 

Public Member Functions

QTextDocument * document ()
 
QFont getDefFont (void)
 
QString getDefFontSize (void)
 
int getDefFontSizeNum (void)
 
 MRichTextEdit (QWidget *parent=nullptr, QString textIn=QString())
 
void setDefFont (QString f)
 
void setDefFontSize (int fs)
 
void setMaxWidth (double w)
 
void setTextCursor (const QTextCursor &cursor)
 
QTextCursor textCursor () const
 
QString toHtml () const
 
QString toPlainText () const
 

Protected Types

enum  ParagraphItems {
  ParagraphStandard = 0 , ParagraphHeading1 , ParagraphHeading2 , ParagraphHeading3 ,
  ParagraphHeading4 , ParagraphMonospace
}
 

Protected Slots

void decreaseIndentation ()
 
void increaseIndentation ()
 
void insertImage ()
 
void listBullet (bool checked)
 
void listOrdered (bool checked)
 
void onExit (void)
 
void onSave (void)
 
void onSelectionChanged ()
 
void setHtml (const QString &text)
 
void setPlainText (const QString &text)
 
void slotClipboardDataChanged ()
 
void slotCurrentCharFormatChanged (const QTextCharFormat &format)
 
void slotCursorPositionChanged ()
 
void textBgColor ()
 
void textBold ()
 
void textFgColor ()
 
void textItalic ()
 
void textLink (bool checked)
 
void textRemoveAllFormat ()
 
void textRemoveFormat ()
 
void textSize (const QString &p)
 
void textSource ()
 
void textStrikeout ()
 
void textStyle (int index)
 
void textUnderline ()
 

Protected Member Functions

void addFontSize (QString fs)
 
void bgColorChanged (const QColor &c)
 
void fgColorChanged (const QColor &c)
 
void focusInEvent (QFocusEvent *event)
 
void fontChanged (const QFont &f)
 
bool hasMultipleSizes (void)
 
void indent (int delta)
 
void keyPressEvent (QKeyEvent *event)
 
void list (bool checked, QTextListFormat::Style style)
 
void mergeFormatOnWordOrSelection (const QTextCharFormat &format)
 
- Protected Member Functions inherited from Ui_MRichTextEdit
void retranslateUi (QWidget *MRichTextEdit)
 
void setupUi (QWidget *MRichTextEdit)
 

Protected Attributes

QString m_defFont
 
int m_defFontSize
 
int m_fontsize_h1
 
int m_fontsize_h2
 
int m_fontsize_h3
 
int m_fontsize_h4
 
QPointer< QTextList > m_lastBlockList
 
QStringList m_paragraphItems
 
- Protected Attributes inherited from Ui_MRichTextEdit
QToolButtonf_bgcolor
 
QToolButtonf_bold
 
QToolButtonf_copy
 
QToolButtonf_cut
 
QToolButtonf_exit
 
QToolButtonf_fgcolor
 
QComboBoxf_fontsize
 
QToolButtonf_image
 
QToolButtonf_indent_dec
 
QToolButtonf_indent_inc
 
QToolButtonf_italic
 
QToolButtonf_link
 
QToolButtonf_list_bullet
 
QToolButtonf_list_ordered
 
QToolButtonf_menu
 
QComboBoxf_paragraph
 
QToolButtonf_paste
 
QToolButtonf_redo
 
QToolButtonf_save
 
QToolButtonf_strikeout
 
MTextEditf_textedit
 
QWidgetf_toolbar
 
QToolButtonf_underline
 
QToolButtonf_undo
 
QHBoxLayout * horizontalLayout
 
QSpacerItem * horizontalSpacer
 
QFrameline
 
QFrameline_2
 
QFrameline_3
 
QFrameline_4
 
QFrameline_5
 
QFrameline_6
 
QFrameline_7
 
QVBoxLayout * verticalLayout
 

Detailed Description

A simple rich-text editor.

Member Enumeration Documentation

◆ ParagraphItems

Enumerator
ParagraphStandard 
ParagraphHeading1 
ParagraphHeading2 
ParagraphHeading3 
ParagraphHeading4 
ParagraphMonospace 

Constructor & Destructor Documentation

◆ MRichTextEdit()

MRichTextEdit::MRichTextEdit ( QWidget parent = nullptr,
QString  textIn = QString() 
)

Member Function Documentation

◆ addFontSize()

void MRichTextEdit::addFontSize ( QString  fs)
protected

References Ui_MRichTextEdit::f_fontsize.

Referenced by MRichTextEdit().

◆ bgColorChanged()

void MRichTextEdit::bgColorChanged ( const QColor &  c)
protected

◆ decreaseIndentation

void MRichTextEdit::decreaseIndentation ( )
protectedslot

References indent().

Referenced by MRichTextEdit().

◆ document()

QTextDocument * MRichTextEdit::document ( )

References Ui_MRichTextEdit::f_textedit.

Referenced by femtest.app.test_solver_calculix.TestSolverCalculix::input_file_writing_test(), femtest.app.test_solver_elmer.TestSolverElmer::input_file_writing_test(), femtest.app.test_solver_mystran.TestSolverMystran::input_file_writing_test(), femtest.app.test_ccxtools.TestCcxTools::input_file_writing_test(), femtest.app.test_solver_z88.TestSolverZ88::inputfile_writing_test(), Mod.Show.mTempoVis.TempoVis::restoreCamera(), femtest.app.test_ccxtools.TestCcxTools::result_reading_test(), Mod.Show.mTempoVis.TempoVis::saveCamera(), femtest.app.test_ccxtools.TestCcxTools::tearDown(), femtest.app.test_common.TestFemCommon::tearDown(), femtest.app.test_femimport.TestObjectExistance::tearDown(), femtest.app.test_material.TestMaterialUnits::tearDown(), femtest.app.test_mesh.TestMeshCommon::tearDown(), femtest.app.test_mesh.TestMeshEleTetra10::tearDown(), femtest.app.test_mesh.TestMeshGroups::tearDown(), femtest.app.test_object.TestObjectCreate::tearDown(), femtest.app.test_object.TestObjectType::tearDown(), femtest.app.test_open.TestObjectOpen::tearDown(), femtest.app.test_result.TestResult::tearDown(), femtest.app.test_solver_calculix.TestSolverCalculix::tearDown(), femtest.app.test_solver_elmer.TestSolverElmer::tearDown(), femtest.app.test_solver_mystran.TestSolverMystran::tearDown(), femtest.app.test_solver_z88.TestSolverZ88::tearDown(), femtest.gui.test_open.TestObjectOpen::tearDown(), femtest.app.test_common.TestFemCommon::test_adding_refshaps(), femtest.app.test_ccxtools.TestCcxTools::test_box_frequency(), femtest.app.test_solver_calculix.TestSolverCalculix::test_box_frequency(), femtest.app.test_ccxtools.TestCcxTools::test_box_static(), femtest.app.test_solver_calculix.TestSolverCalculix::test_box_static(), femtest.app.test_solver_elmer.TestSolverElmer::test_box_static_0_mm(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_buckling_flexuralbuckling(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_beam_circle(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_beam_pipe(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_beam_rect(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_ele_hexa20(), femtest.app.test_solver_z88.TestSolverZ88::test_ccx_cantilever_ele_hexa20(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_ele_quad4(), femtest.app.test_solver_mystran.TestSolverMystran::test_ccx_cantilever_ele_quad4(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_ele_quad8(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_ele_seg2(), femtest.app.test_solver_mystran.TestSolverMystran::test_ccx_cantilever_ele_seg2(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_ele_seg3(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_ele_tria3(), femtest.app.test_solver_mystran.TestSolverMystran::test_ccx_cantilever_ele_tria3(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_ele_tria6(), femtest.app.test_solver_z88.TestSolverZ88::test_ccx_cantilever_ele_tria6(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_faceload(), femtest.app.test_solver_mystran.TestSolverMystran::test_ccx_cantilever_faceload(), femtest.app.test_solver_z88.TestSolverZ88::test_ccx_cantilever_faceload(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_nodeload(), femtest.app.test_solver_mystran.TestSolverMystran::test_ccx_cantilever_nodeload(), femtest.app.test_solver_z88.TestSolverZ88::test_ccx_cantilever_nodeload(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_prescribeddisplacement(), femtest.app.test_solver_elmer.TestSolverElmer::test_ccxcantilever_faceload_0_mm(), femtest.app.test_solver_elmer.TestSolverElmer::test_ccxcantilever_faceload_1_si(), femtest.app.test_solver_elmer.TestSolverElmer::test_ccxcantilever_nodeload_0_mm(), femtest.app.test_solver_elmer.TestSolverElmer::test_ccxcantilever_prescribeddisplacement_0_mm(), femtest.app.test_solver_calculix.TestSolverCalculix::test_constraint_centrif(), femtest.app.test_solver_calculix.TestSolverCalculix::test_constraint_contact_shell_shell(), femtest.app.test_solver_calculix.TestSolverCalculix::test_constraint_contact_solid_solid(), femtest.app.test_solver_calculix.TestSolverCalculix::test_constraint_sectionprint(), femtest.app.test_solver_calculix.TestSolverCalculix::test_constraint_selfweight_cantilever(), femtest.app.test_solver_calculix.TestSolverCalculix::test_constraint_tie(), femtest.app.test_solver_calculix.TestSolverCalculix::test_constraint_transform_beam_hinged(), femtest.app.test_solver_calculix.TestSolverCalculix::test_constraint_transform_torque(), femtest.app.test_object.TestObjectType::test_femobjects_derivedfromfem(), femtest.app.test_object.TestObjectType::test_femobjects_derivedfromstd(), femtest.app.test_object.TestObjectType::test_femobjects_isoftype(), femtest.app.test_object.TestObjectCreate::test_femobjects_make(), femtest.app.test_open.TestObjectOpen::test_femobjects_open_de9b3fb438(), femtest.gui.test_open.TestObjectOpen::test_femobjects_open_de9b3fb438(), femtest.app.test_open.TestObjectOpen::test_femobjects_open_head(), femtest.gui.test_open.TestObjectOpen::test_femobjects_open_head(), femtest.app.test_object.TestObjectType::test_femobjects_type(), femtest.app.test_solver_calculix.TestSolverCalculix::test_frequency_beamsimple(), femtest.app.test_solver_calculix.TestSolverCalculix::test_material_multiple_bendingbeam_fiveboxes(), femtest.app.test_solver_calculix.TestSolverCalculix::test_material_multiple_bendingbeam_fivefaces(), femtest.app.test_solver_calculix.TestSolverCalculix::test_material_multiple_tensionrod_twoboxes(), femtest.app.test_solver_calculix.TestSolverCalculix::test_material_nonlinear(), femtest.app.test_solver_mystran.TestSolverMystran::test_mystran_plate(), femtest.app.test_femimport.TestObjectExistance::test_objects_existance(), femtest.app.test_solver_calculix.TestSolverCalculix::test_square_pipe_end_twisted_edgeforces(), femtest.app.test_solver_calculix.TestSolverCalculix::test_square_pipe_end_twisted_nodeforces(), femtest.app.test_solver_calculix.TestSolverCalculix::test_thermomech_bimetall(), femtest.app.test_ccxtools.TestCcxTools::test_thermomech_flow1D(), femtest.app.test_solver_calculix.TestSolverCalculix::test_thermomech_flow1D(), femtest.app.test_ccxtools.TestCcxTools::test_thermomech_spine(), femtest.app.test_solver_calculix.TestSolverCalculix::test_thermomech_spine(), and Mod.Show.TVStack.TVStack::unwindForSaving().

◆ editorFinished

void MRichTextEdit::editorFinished ( )
signal

Referenced by onExit().

◆ fgColorChanged()

void MRichTextEdit::fgColorChanged ( const QColor &  c)
protected

References Ui_MRichTextEdit::f_fgcolor.

Referenced by textFgColor().

◆ focusInEvent()

void MRichTextEdit::focusInEvent ( QFocusEvent *  event)
protected

◆ fontChanged()

◆ getDefFont()

QFont MRichTextEdit::getDefFont ( void  )

References Base::Tools::fromStdString(), and m_defFont.

Referenced by MRichTextEdit().

◆ getDefFontSize()

QString MRichTextEdit::getDefFontSize ( void  )

◆ getDefFontSizeNum()

int MRichTextEdit::getDefFontSizeNum ( void  )

◆ hasMultipleSizes()

bool MRichTextEdit::hasMultipleSizes ( void  )
protected

◆ increaseIndentation

void MRichTextEdit::increaseIndentation ( )
protectedslot

References indent().

Referenced by MRichTextEdit().

◆ indent()

void MRichTextEdit::indent ( int  delta)
protected

◆ insertImage

void MRichTextEdit::insertImage ( )
protectedslot

◆ keyPressEvent()

void MRichTextEdit::keyPressEvent ( QKeyEvent *  event)
protected

References onSave().

◆ list()

void MRichTextEdit::list ( bool  checked,
QTextListFormat::Style  style 
)
protected

References Ui_MRichTextEdit::f_textedit.

Referenced by listBullet(), and listOrdered().

◆ listBullet

void MRichTextEdit::listBullet ( bool  checked)
protectedslot

References Ui_MRichTextEdit::f_list_ordered, and list().

Referenced by MRichTextEdit().

◆ listOrdered

void MRichTextEdit::listOrdered ( bool  checked)
protectedslot

References Ui_MRichTextEdit::f_list_bullet, and list().

Referenced by MRichTextEdit().

◆ mergeFormatOnWordOrSelection()

void MRichTextEdit::mergeFormatOnWordOrSelection ( const QTextCharFormat &  format)
protected

◆ onExit

void MRichTextEdit::onExit ( void  )
protectedslot

References editorFinished().

Referenced by MRichTextEdit().

◆ onSave

void MRichTextEdit::onSave ( void  )
protectedslot

References saveText(), and toHtml().

Referenced by keyPressEvent(), and MRichTextEdit().

◆ onSelectionChanged

void MRichTextEdit::onSelectionChanged ( void  )
protectedslot

◆ saveText

void MRichTextEdit::saveText ( QString  revText)
signal

Referenced by onSave().

◆ setDefFont()

void MRichTextEdit::setDefFont ( QString  f)

References m_defFont.

◆ setDefFontSize()

void MRichTextEdit::setDefFontSize ( int  fs)

◆ setHtml

void MRichTextEdit::setHtml ( const QString &  text)
protectedslot

References Ui_MRichTextEdit::f_textedit.

Referenced by setText().

◆ setMaxWidth()

void MRichTextEdit::setMaxWidth ( double  w)

◆ setPlainText

void MRichTextEdit::setPlainText ( const QString &  text)
protectedslot

References Ui_MRichTextEdit::f_textedit.

Referenced by setText().

◆ setText

void MRichTextEdit::setText ( const QString &  text)
slot

References setHtml(), and setPlainText().

◆ setTextCursor()

void MRichTextEdit::setTextCursor ( const QTextCursor &  cursor)

◆ slotClipboardDataChanged

void MRichTextEdit::slotClipboardDataChanged ( )
protectedslot

References Ui_MRichTextEdit::f_paste.

Referenced by MRichTextEdit().

◆ slotCurrentCharFormatChanged

void MRichTextEdit::slotCurrentCharFormatChanged ( const QTextCharFormat &  format)
protectedslot

Referenced by MRichTextEdit().

◆ slotCursorPositionChanged

void MRichTextEdit::slotCursorPositionChanged ( )
protectedslot

◆ textBgColor

void MRichTextEdit::textBgColor ( )
protectedslot

◆ textBold

void MRichTextEdit::textBold ( )
protectedslot

◆ textCursor()

QTextCursor MRichTextEdit::textCursor ( ) const

◆ textFgColor

void MRichTextEdit::textFgColor ( )
protectedslot

◆ textItalic

void MRichTextEdit::textItalic ( )
protectedslot

◆ textLink

void MRichTextEdit::textLink ( bool  checked)
protectedslot

◆ textRemoveAllFormat

◆ textRemoveFormat

◆ textSize

void MRichTextEdit::textSize ( const QString &  p)
protectedslot

◆ textSource

void MRichTextEdit::textSource ( )
protectedslot

References Ui_MRichTextEdit::f_textedit.

Referenced by MRichTextEdit().

◆ textStrikeout

void MRichTextEdit::textStrikeout ( )
protectedslot

◆ textStyle

◆ textUnderline

void MRichTextEdit::textUnderline ( )
protectedslot

◆ toHtml()

QString MRichTextEdit::toHtml ( ) const

◆ toPlainText()

QString MRichTextEdit::toPlainText ( ) const

Member Data Documentation

◆ m_defFont

QString MRichTextEdit::m_defFont
protected

◆ m_defFontSize

int MRichTextEdit::m_defFontSize
protected

◆ m_fontsize_h1

int MRichTextEdit::m_fontsize_h1
protected

◆ m_fontsize_h2

int MRichTextEdit::m_fontsize_h2
protected

◆ m_fontsize_h3

int MRichTextEdit::m_fontsize_h3
protected

◆ m_fontsize_h4

int MRichTextEdit::m_fontsize_h4
protected

◆ m_lastBlockList

QPointer<QTextList> MRichTextEdit::m_lastBlockList
protected

◆ m_paragraphItems

QStringList MRichTextEdit::m_paragraphItems
protected

Referenced by MRichTextEdit().


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