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

QTextDocument documentation does not explain restrictions on newline search

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: P4: Low
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 5.6.0 RC
    • Component/s: Documentation
    • Labels:
      None
    • Environment:

      Qt documentation

      Description

      The documentation page for QRegExp says at multiple points that newline (\n) and return (\r) are recognized and are found as part of whitespace (\s). This is misleading because QTextDocument::find cannot match a regexp across a block boundary (see this forum post:http://developer.nokia.forums.com/viewthread/6665). Hence you cannot get a match to any \n in a QPlainTextEdit at all, either as \n or as \s; and you cannot get a match to any pattern when the target spans two or more lines. For instance, the example in QRegExp of searching for <i>-markup can only work when the open and closing markup are both on a single line. In a QTextEdit, you cannot get a match that spans paragraphs. This restriction is unrelated to the use of minimal or regexp2 syntax.

        Attachments

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

          Activity

            People

            Assignee:
            kavindra Kavindra Palaraja (Inactive)
            Reporter:
            dcortesi David Cortesi
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 4 hours
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Gerrit Reviews

                  There are no open Gerrit changes