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) |
A simple rich-text editor.
|
protected |
MRichTextEdit::MRichTextEdit | ( | QWidget * | parent = nullptr , |
QString | textIn = QString() |
||
) |
References addFontSize(), bgColorChanged(), draftgeoutils.intersections::connect(), draftfunctions.cut::cut(), decreaseIndentation(), Ui_MRichTextEdit::f_bgcolor, Ui_MRichTextEdit::f_bold, Ui_MRichTextEdit::f_copy, Ui_MRichTextEdit::f_cut, Ui_MRichTextEdit::f_exit, Ui_MRichTextEdit::f_fgcolor, Ui_MRichTextEdit::f_fontsize, Ui_MRichTextEdit::f_image, Ui_MRichTextEdit::f_indent_dec, Ui_MRichTextEdit::f_indent_inc, Ui_MRichTextEdit::f_italic, Ui_MRichTextEdit::f_link, Ui_MRichTextEdit::f_list_bullet, Ui_MRichTextEdit::f_list_ordered, Ui_MRichTextEdit::f_menu, Ui_MRichTextEdit::f_paragraph, Ui_MRichTextEdit::f_paste, Ui_MRichTextEdit::f_redo, Ui_MRichTextEdit::f_save, Ui_MRichTextEdit::f_strikeout, Ui_MRichTextEdit::f_textedit, Ui_MRichTextEdit::f_underline, Ui_MRichTextEdit::f_undo, 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(), Ui_MRichTextEdit::setupUi(), slotClipboardDataChanged(), slotCurrentCharFormatChanged(), slotCursorPositionChanged(), textBgColor(), textBold(), textFgColor(), textItalic(), textLink(), textRemoveAllFormat(), textRemoveFormat(), textSize(), textSource(), textStrikeout(), textStyle(), and textUnderline().
|
protected |
References Ui_MRichTextEdit::f_fontsize.
Referenced by MRichTextEdit().
|
protected |
References Ui_MRichTextEdit::f_bgcolor.
Referenced by MRichTextEdit(), and textBgColor().
|
protectedslot |
References indent().
Referenced by MRichTextEdit().
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().
|
signal |
Referenced by onExit().
|
protected |
References Ui_MRichTextEdit::f_fgcolor.
Referenced by textFgColor().
|
protected |
References Ui_MRichTextEdit::f_textedit.
|
protected |
References Ui_MRichTextEdit::f_bold, Ui_MRichTextEdit::f_fontsize, Ui_MRichTextEdit::f_italic, Ui_MRichTextEdit::f_list_bullet, Ui_MRichTextEdit::f_list_ordered, Ui_MRichTextEdit::f_paragraph, Ui_MRichTextEdit::f_strikeout, Ui_MRichTextEdit::f_textedit, Ui_MRichTextEdit::f_underline, m_fontsize_h1, m_fontsize_h2, m_fontsize_h3, m_fontsize_h4, ParagraphHeading1, ParagraphHeading2, ParagraphHeading3, ParagraphHeading4, ParagraphMonospace, and ParagraphStandard.
Referenced by MRichTextEdit().
QFont MRichTextEdit::getDefFont | ( | void | ) |
References Base::Tools::fromStdString(), and m_defFont.
Referenced by MRichTextEdit().
QString MRichTextEdit::getDefFontSize | ( | void | ) |
References getDefFontSizeNum().
Referenced by MRichTextEdit(), textRemoveAllFormat(), and textRemoveFormat().
int MRichTextEdit::getDefFontSizeNum | ( | void | ) |
References TechDraw::Preferences::dimFontSizeMM().
Referenced by getDefFontSize(), MRichTextEdit(), and TechDrawGui::TaskRichAnno::setUiPrimary().
|
protected |
References Ui_MRichTextEdit::f_textedit.
Referenced by onSelectionChanged().
|
protectedslot |
References indent().
Referenced by MRichTextEdit().
|
protected |
References Ui_MRichTextEdit::f_textedit.
Referenced by decreaseIndentation(), and increaseIndentation().
|
protectedslot |
References MTextEdit::dropImage(), and Ui_MRichTextEdit::f_textedit.
Referenced by MRichTextEdit().
|
protected |
References onSave().
|
protected |
References Ui_MRichTextEdit::f_textedit.
Referenced by listBullet(), and listOrdered().
|
protectedslot |
References Ui_MRichTextEdit::f_list_ordered, and list().
Referenced by MRichTextEdit().
|
protectedslot |
References Ui_MRichTextEdit::f_list_bullet, and list().
Referenced by MRichTextEdit().
|
protected |
References Ui_MRichTextEdit::f_textedit.
Referenced by textBold(), textItalic(), textLink(), textRemoveFormat(), textSize(), textStrikeout(), and textUnderline().
|
protectedslot |
References editorFinished().
Referenced by MRichTextEdit().
|
protectedslot |
References saveText(), and toHtml().
Referenced by keyPressEvent(), and MRichTextEdit().
|
protectedslot |
References Ui_MRichTextEdit::f_fontsize, Ui_MRichTextEdit::f_textedit, and hasMultipleSizes().
Referenced by MRichTextEdit().
|
signal |
Referenced by onSave().
void MRichTextEdit::setDefFont | ( | QString | f | ) |
References m_defFont.
void MRichTextEdit::setDefFontSize | ( | int | fs | ) |
References Ui_MRichTextEdit::f_fontsize, m_defFontSize, m_fontsize_h1, m_fontsize_h2, m_fontsize_h3, m_fontsize_h4, and textSize().
Referenced by MRichTextEdit().
|
protectedslot |
References Ui_MRichTextEdit::f_textedit.
Referenced by setText().
void MRichTextEdit::setMaxWidth | ( | double | w | ) |
|
protectedslot |
References Ui_MRichTextEdit::f_textedit.
Referenced by setText().
|
slot |
References setHtml(), and setPlainText().
void MRichTextEdit::setTextCursor | ( | const QTextCursor & | cursor | ) |
References Ui_MRichTextEdit::f_textedit.
|
protectedslot |
References Ui_MRichTextEdit::f_paste.
Referenced by MRichTextEdit().
|
protectedslot |
Referenced by MRichTextEdit().
|
protectedslot |
References Ui_MRichTextEdit::f_fontsize, Ui_MRichTextEdit::f_list_bullet, Ui_MRichTextEdit::f_list_ordered, Ui_MRichTextEdit::f_textedit, and m_lastBlockList.
Referenced by MRichTextEdit().
|
protectedslot |
References bgColorChanged(), Gui::DialogOptions::dontUseNativeColorDialog(), and Ui_MRichTextEdit::f_textedit.
Referenced by MRichTextEdit().
|
protectedslot |
References Ui_MRichTextEdit::f_bold, and mergeFormatOnWordOrSelection().
Referenced by MRichTextEdit().
QTextCursor MRichTextEdit::textCursor | ( | ) | const |
References Ui_MRichTextEdit::f_textedit.
|
protectedslot |
References Gui::DialogOptions::dontUseNativeColorDialog(), Ui_MRichTextEdit::f_textedit, and fgColorChanged().
Referenced by MRichTextEdit().
|
protectedslot |
References Ui_MRichTextEdit::f_italic, and mergeFormatOnWordOrSelection().
Referenced by MRichTextEdit().
|
protectedslot |
References Ui_MRichTextEdit::f_textedit, draftfunctions.svgtext::getText(), and mergeFormatOnWordOrSelection().
Referenced by MRichTextEdit().
|
protectedslot |
|
protectedslot |
|
protectedslot |
References mergeFormatOnWordOrSelection().
Referenced by MRichTextEdit(), and setDefFontSize().
|
protectedslot |
References Ui_MRichTextEdit::f_textedit.
Referenced by MRichTextEdit().
|
protectedslot |
References Ui_MRichTextEdit::f_strikeout, and mergeFormatOnWordOrSelection().
Referenced by MRichTextEdit().
|
protectedslot |
References Ui_MRichTextEdit::f_textedit, m_fontsize_h1, m_fontsize_h2, m_fontsize_h3, m_fontsize_h4, ParagraphHeading1, ParagraphHeading2, ParagraphHeading3, ParagraphHeading4, and ParagraphMonospace.
Referenced by MRichTextEdit().
|
protectedslot |
References Ui_MRichTextEdit::f_underline, and mergeFormatOnWordOrSelection().
Referenced by MRichTextEdit().
QString MRichTextEdit::toHtml | ( | ) | const |
References Ui_MRichTextEdit::f_textedit.
Referenced by TechDrawGui::QGIRichAnno::mouseDoubleClickEvent(), and onSave().
QString MRichTextEdit::toPlainText | ( | ) | const |
References Ui_MRichTextEdit::f_textedit.
|
protected |
Referenced by getDefFont(), MRichTextEdit(), and setDefFont().
|
protected |
Referenced by MRichTextEdit(), setDefFontSize(), and textRemoveFormat().
|
protected |
Referenced by fontChanged(), MRichTextEdit(), setDefFontSize(), and textStyle().
|
protected |
Referenced by fontChanged(), MRichTextEdit(), setDefFontSize(), and textStyle().
|
protected |
Referenced by fontChanged(), MRichTextEdit(), setDefFontSize(), and textStyle().
|
protected |
Referenced by fontChanged(), MRichTextEdit(), setDefFontSize(), and textStyle().
|
protected |
Referenced by MRichTextEdit(), and slotCursorPositionChanged().
|
protected |
Referenced by MRichTextEdit().