Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-29393

In QTextEdit deleting all text resets font with AcceptRichText set to false

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.0.0
    • GUI: Text handling
    • None
    • Windows 7 Pro x64 with Qt 5.0.0 x86, precompiled package downloaded from qt-project.org

    Description

      I have a very simple app with QTextEdit with AcceptRichText=false and font family and size set to specific values. Now, if I type any text, then delete it either by performing select all and pasting some text (can be even copied from the same QTextEdit), or simply deleting selected text and typing something new, font family and size get reset to what I think are default values for QTextEdit.

      Natural behaviour would be to preserve font family and size.

      EDIT: Found out this has to do with me using QTextEdit::setFontFamily() and QTextEdit::setFontPointSize(), which seem to set font only at the cursor position, instead of QTextEdit::setFont(). Using the latter fixes the problem.
      Still, described QTextEdit behaviour is inconsistent - text edit set not to accept rich text shouldn't ever display rich text, e.g. two font families at a time.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            krzysztof Krzysztof Bogacki
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes