foto Petr Bravenec

Petr Bravenec
Twitter: @BravenecPetr
+420 777 566 384

Qt toolkit has built-in html editor - class QTextEdit. The problem is that the editor has no controls which allows you to format the text. For the reason our colleague Jiří Procházka created simple editor, class MRichTextEdit, which we can use in our application Deko the CRM.

Editor is freely available (except icons, Jiří relies on the environment support), you can download it here:

Basic features

  • Accepts html or plain text
  • Undo, Redo
  • Cut, copy a paste
  • Html links
  • Standard html formats (h1, h2...)
  • Text formats: bold, italics, underline, stroke, font size
  • Unnumbered or numbered lists
  • Text background color
  • Images embedded in html document

Another free software for Qt


Usage is very simple, all screen shots were created using a few lines in a C++ application:

    QDialog *dialog = new QDialog(this);
    MRichTextEdit *rte = new MRichTextEdit(dialog);
    QGridLayout *gl = new QGridLayout(dialog);
    dialog-<setWindowTitle(tr("Rich text editor"));
    dialog-<setMinimumWidth (400);

Editor accepts plain text or html:

  • void setText(const QString& text) - recognizes simple text or html

Returns test in different formats:

  • QString toPlainText()
  • - returns plain text without html formatting
  • QString toHtml()
  • - returns complete html document
  • QTextDocument *document()
  • - return Qt class QTextDocument

Screen shots

Hobrasoft s.r.o. | Contact