Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTextDocument.find() does not accept QRegularExpression? Say it isn't so...?
Forum Updated to NodeBB v4.3 + New Features

QTextDocument.find() does not accept QRegularExpression? Say it isn't so...?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dcortesi
    wrote on last edited by
    #1

    It appears that in Qt5.3, the find() method of QTextDocument does not have a variant supporting QRegularExpression? It only accepts the old QRegExp?

    I am working on version 2 of a specialized editor based on QPlainTextEdit, and I had expected to provide full PCRE syntax in the Find feature, instead of the very limited regex syntax of QRegExp that I could offer before.

    Please tell me I have misunderstood and the support is actually there? If not, the workarounds are very awkward...

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      No, you didn't misunderstood, however, it's a work in progress.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dcortesi
        wrote on last edited by
        #3

        Thanks for the reply. You wouldn't care to speculate as to what dot-number it would appear? 5-something or later than 5.x?

        My current plan for getting good REs is to bring the document into the Python realm with myEditor.toPlainText() and operate on it with the excellent regex library (https://pypi.python.org/pypi/regex/2014.08.15). This gets me great features but at the performance cost of copying the whole document from the Qt domain to the Python domain, and the complexity of then carrying the position and length of a matched string back as (position, anchor) in a cursor.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          If everything goes well, maybe 5.5 but not before, 5.4 has reached feature freeze.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dcortesi
            wrote on last edited by
            #5

            That's better than I hoped. Perhaps I will go with the old code using QRegExp and hope to upgrade smoothly later...

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved