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=0, 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 list (bool checked, QTextListFormat::Style style)
 
void mergeFormatOnWordOrSelection (const QTextCharFormat &format)
 

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
 

Detailed Description

A simple rich-text editor.

Member Enumeration Documentation

◆ ParagraphItems

Enumerator
ParagraphStandard 
ParagraphHeading1 
ParagraphHeading2 
ParagraphHeading3 
ParagraphHeading4 
ParagraphMonospace 

Constructor & Destructor Documentation

◆ MRichTextEdit()

Member Function Documentation

◆ addFontSize()

void MRichTextEdit::addFontSize ( QString  fs)
protected

Referenced by MRichTextEdit().

◆ bgColorChanged()

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

Referenced by MRichTextEdit(), and textBgColor().

◆ decreaseIndentation

void MRichTextEdit::decreaseIndentation ( )
protectedslot

References indent().

Referenced by MRichTextEdit().

◆ document()

QTextDocument* MRichTextEdit::document ( )

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_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_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_ccxcantilever_faceload(), femtest.app.test_solver_z88.TestSolverZ88::test_ccxcantilever_faceload(), 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_calculix.TestSolverCalculix::test_ccxcantilever_hexa20(), femtest.app.test_solver_z88.TestSolverZ88::test_ccxcantilever_hexa20(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccxcantilever_nodeload(), femtest.app.test_solver_z88.TestSolverZ88::test_ccxcantilever_nodeload(), femtest.app.test_solver_elmer.TestSolverElmer::test_ccxcantilever_nodeload_0_mm(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccxcantilever_prescribeddisplacement(), femtest.app.test_solver_elmer.TestSolverElmer::test_ccxcantilever_prescribeddisplacement_0_mm(), 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_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_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_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(), Mod.Show.TVStack.TVStack::unwindForSaving(), and femsolver.calculix.writer.FemInputWriterCcx::write_footer().

◆ editorFinished

void MRichTextEdit::editorFinished ( )
signal

Referenced by onExit().

◆ fgColorChanged()

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

Referenced by textFgColor().

◆ focusInEvent()

void MRichTextEdit::focusInEvent ( QFocusEvent *  event)
protected

◆ fontChanged()

void MRichTextEdit::fontChanged ( const QFont &  f)
protected

◆ 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

Referenced by onSelectionChanged().

◆ increaseIndentation

void MRichTextEdit::increaseIndentation ( )
protectedslot

References indent().

Referenced by MRichTextEdit().

◆ indent()

void MRichTextEdit::indent ( int  delta)
protected

◆ insertImage

void MRichTextEdit::insertImage ( )
protectedslot

Referenced by MRichTextEdit().

◆ list()

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

Referenced by listBullet(), and listOrdered().

◆ listBullet

void MRichTextEdit::listBullet ( bool  checked)
protectedslot

References list().

Referenced by MRichTextEdit().

◆ listOrdered

void MRichTextEdit::listOrdered ( bool  checked)
protectedslot

References 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 MRichTextEdit().

◆ onSelectionChanged

void MRichTextEdit::onSelectionChanged ( void  )
protectedslot

References hasMultipleSizes().

Referenced by MRichTextEdit().

◆ 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

Referenced by setText().

◆ setMaxWidth()

void MRichTextEdit::setMaxWidth ( double  w)

◆ setPlainText

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

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

Referenced by MRichTextEdit().

◆ slotCurrentCharFormatChanged

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

Referenced by MRichTextEdit().

◆ slotCursorPositionChanged

void MRichTextEdit::slotCursorPositionChanged ( )
protectedslot

References m_lastBlockList.

Referenced by MRichTextEdit().

◆ textBgColor

void MRichTextEdit::textBgColor ( )
protectedslot

References bgColorChanged().

Referenced by MRichTextEdit().

◆ textBold

void MRichTextEdit::textBold ( )
protectedslot

References mergeFormatOnWordOrSelection().

Referenced by MRichTextEdit().

◆ textCursor()

QTextCursor MRichTextEdit::textCursor ( ) const

◆ textFgColor

void MRichTextEdit::textFgColor ( )
protectedslot

References fgColorChanged().

Referenced by MRichTextEdit().

◆ textItalic

void MRichTextEdit::textItalic ( )
protectedslot

References mergeFormatOnWordOrSelection().

Referenced by MRichTextEdit().

◆ textLink

void MRichTextEdit::textLink ( bool  checked)
protectedslot

◆ textRemoveAllFormat

void MRichTextEdit::textRemoveAllFormat ( )
protectedslot

References getDefFontSize().

Referenced by MRichTextEdit().

◆ textRemoveFormat

void MRichTextEdit::textRemoveFormat ( )
protectedslot

◆ textSize

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

◆ textSource

void MRichTextEdit::textSource ( )
protectedslot

Referenced by MRichTextEdit().

◆ textStrikeout

void MRichTextEdit::textStrikeout ( )
protectedslot

References mergeFormatOnWordOrSelection().

Referenced by MRichTextEdit().

◆ textStyle

void MRichTextEdit::textStyle ( int  index)
protectedslot

◆ textUnderline

void MRichTextEdit::textUnderline ( )
protectedslot

References mergeFormatOnWordOrSelection().

Referenced by MRichTextEdit().

◆ toHtml()

QString MRichTextEdit::toHtml ( ) const

Referenced by onSave().

◆ 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:
  • Sources/FreeCAD/src/Mod/TechDraw/Gui/mrichtextedit.h
  • Sources/FreeCAD/src/Mod/TechDraw/Gui/mrichtextedit.cpp