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
|
protected |
Constructor & Destructor Documentation
◆ MRichTextEdit()
MRichTextEdit::MRichTextEdit | ( | QWidget * | parent = 0 , |
QString | textIn = QString() |
||
) |
References addFontSize(), bgColorChanged(), draftgeoutils.intersections::connect(), draftfunctions.cut::cut(), decreaseIndentation(), fontChanged(), getDefFont(), getDefFontSize(), getDefFontSizeNum(), increaseIndentation(), insertImage(), TechDrawGui::PreferencesGui::labelFontSizePX(), listBullet(), listOrdered(), m_defFont, m_defFontSize, m_fontsize_h1, m_fontsize_h2, m_fontsize_h3, m_fontsize_h4, m_lastBlockList, m_paragraphItems, onExit(), onSave(), onSelectionChanged(), setDefFontSize(), slotClipboardDataChanged(), slotCurrentCharFormatChanged(), slotCursorPositionChanged(), textBgColor(), textBold(), textFgColor(), textItalic(), textLink(), textRemoveAllFormat(), textRemoveFormat(), textSize(), textSource(), textStrikeout(), textStyle(), and textUnderline().
Member Function Documentation
◆ addFontSize()
|
protected |
Referenced by MRichTextEdit().
◆ bgColorChanged()
|
protected |
Referenced by MRichTextEdit(), and textBgColor().
◆ 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
|
signal |
Referenced by onExit().
◆ fgColorChanged()
|
protected |
Referenced by textFgColor().
◆ focusInEvent()
|
protected |
◆ fontChanged()
|
protected |
References m_fontsize_h1, m_fontsize_h2, m_fontsize_h3, m_fontsize_h4, ParagraphHeading1, ParagraphHeading2, ParagraphHeading3, ParagraphHeading4, ParagraphMonospace, and ParagraphStandard.
Referenced by MRichTextEdit().
◆ getDefFont()
QFont MRichTextEdit::getDefFont | ( | void | ) |
References Base::Tools::fromStdString(), and m_defFont.
Referenced by MRichTextEdit().
◆ getDefFontSize()
QString MRichTextEdit::getDefFontSize | ( | void | ) |
References getDefFontSizeNum().
Referenced by MRichTextEdit(), textRemoveAllFormat(), and textRemoveFormat().
◆ getDefFontSizeNum()
int MRichTextEdit::getDefFontSizeNum | ( | void | ) |
References TechDraw::Preferences::dimFontSizeMM().
Referenced by getDefFontSize(), MRichTextEdit(), and TechDrawGui::TaskRichAnno::setUiPrimary().
◆ hasMultipleSizes()
|
protected |
Referenced by onSelectionChanged().
◆ increaseIndentation
|
protectedslot |
References indent().
Referenced by MRichTextEdit().
◆ indent()
|
protected |
Referenced by decreaseIndentation(), and increaseIndentation().
◆ insertImage
|
protectedslot |
Referenced by MRichTextEdit().
◆ list()
|
protected |
Referenced by listBullet(), and listOrdered().
◆ listBullet
|
protectedslot |
References list().
Referenced by MRichTextEdit().
◆ listOrdered
|
protectedslot |
References list().
Referenced by MRichTextEdit().
◆ mergeFormatOnWordOrSelection()
|
protected |
Referenced by textBold(), textItalic(), textLink(), textRemoveFormat(), textSize(), textStrikeout(), and textUnderline().
◆ onExit
|
protectedslot |
References editorFinished().
Referenced by MRichTextEdit().
◆ onSave
|
protectedslot |
References saveText(), and toHtml().
Referenced by MRichTextEdit().
◆ onSelectionChanged
|
protectedslot |
References hasMultipleSizes().
Referenced by MRichTextEdit().
◆ saveText
|
signal |
Referenced by onSave().
◆ setDefFont()
void MRichTextEdit::setDefFont | ( | QString | f | ) |
References m_defFont.
◆ setDefFontSize()
void MRichTextEdit::setDefFontSize | ( | int | fs | ) |
References m_defFontSize, m_fontsize_h1, m_fontsize_h2, m_fontsize_h3, m_fontsize_h4, and textSize().
Referenced by MRichTextEdit().
◆ setHtml
|
protectedslot |
Referenced by setText().
◆ setMaxWidth()
void MRichTextEdit::setMaxWidth | ( | double | w | ) |
◆ setPlainText
|
protectedslot |
Referenced by setText().
◆ setText
|
slot |
References setHtml(), and setPlainText().
◆ setTextCursor()
void MRichTextEdit::setTextCursor | ( | const QTextCursor & | cursor | ) |
◆ slotClipboardDataChanged
|
protectedslot |
Referenced by MRichTextEdit().
◆ slotCurrentCharFormatChanged
|
protectedslot |
Referenced by MRichTextEdit().
◆ slotCursorPositionChanged
|
protectedslot |
References m_lastBlockList.
Referenced by MRichTextEdit().
◆ textBgColor
|
protectedslot |
References bgColorChanged().
Referenced by MRichTextEdit().
◆ textBold
|
protectedslot |
References mergeFormatOnWordOrSelection().
Referenced by MRichTextEdit().
◆ textCursor()
QTextCursor MRichTextEdit::textCursor | ( | ) | const |
◆ textFgColor
|
protectedslot |
References fgColorChanged().
Referenced by MRichTextEdit().
◆ textItalic
|
protectedslot |
References mergeFormatOnWordOrSelection().
Referenced by MRichTextEdit().
◆ textLink
|
protectedslot |
References draftfunctions.svgtext::getText(), and mergeFormatOnWordOrSelection().
Referenced by MRichTextEdit().
◆ textRemoveAllFormat
|
protectedslot |
References getDefFontSize().
Referenced by MRichTextEdit().
◆ textRemoveFormat
|
protectedslot |
References getDefFontSize(), m_defFontSize, and mergeFormatOnWordOrSelection().
Referenced by MRichTextEdit().
◆ textSize
|
protectedslot |
References mergeFormatOnWordOrSelection().
Referenced by MRichTextEdit(), and setDefFontSize().
◆ textSource
|
protectedslot |
Referenced by MRichTextEdit().
◆ textStrikeout
|
protectedslot |
References mergeFormatOnWordOrSelection().
Referenced by MRichTextEdit().
◆ textStyle
|
protectedslot |
References m_fontsize_h1, m_fontsize_h2, m_fontsize_h3, m_fontsize_h4, ParagraphHeading1, ParagraphHeading2, ParagraphHeading3, ParagraphHeading4, and ParagraphMonospace.
Referenced by 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
|
protected |
Referenced by getDefFont(), MRichTextEdit(), and setDefFont().
◆ m_defFontSize
|
protected |
Referenced by MRichTextEdit(), setDefFontSize(), and textRemoveFormat().
◆ m_fontsize_h1
|
protected |
Referenced by fontChanged(), MRichTextEdit(), setDefFontSize(), and textStyle().
◆ m_fontsize_h2
|
protected |
Referenced by fontChanged(), MRichTextEdit(), setDefFontSize(), and textStyle().
◆ m_fontsize_h3
|
protected |
Referenced by fontChanged(), MRichTextEdit(), setDefFontSize(), and textStyle().
◆ m_fontsize_h4
|
protected |
Referenced by fontChanged(), MRichTextEdit(), setDefFontSize(), and textStyle().
◆ m_lastBlockList
|
protected |
Referenced by MRichTextEdit(), and slotCursorPositionChanged().
◆ 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