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. QCompleter with Regular Expresions

QCompleter with Regular Expresions

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.0k Views 2 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.
  • freddy311082F Offline
    freddy311082F Offline
    freddy311082
    wrote on last edited by
    #1

    Hi guys.... I need to use QCompleter with Regular Expression and I don't know why... to be exactly, I have a QLineEdit which I need to have the following behaviour:

    Imagine that I have the folowwing list:
    {"RegComp", "Testing the Qt Completer", "We are Testing Regular Expressions"}

    I need that when I type "Test", the completer give me:
    "Testing the Qt Completer"
    "We are Testing Regular Expressions"
    If I type "Test Reg" the completer give me:
    "We are Testing Regular Expressions"

    How can I do that ?? because the QCompleter doesn't have this behaviour

    regards

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

      Hi,

      Can you show how you setup your QLineEdit + QCompleter ?

      And which version of Qt are you using ?

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

      freddy311082F 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Can you show how you setup your QLineEdit + QCompleter ?

        And which version of Qt are you using ?

        freddy311082F Offline
        freddy311082F Offline
        freddy311082
        wrote on last edited by
        #3

        @SGaist

        Hi SGaist and thanks for always answer me...

        I'm trying to do the same as the example in the assistance for the QCompleter help. The model is a list of strings, but I need to search using regular expressions

        regards

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

          Then completer->setFilterMode(Qt::MatchContains); should get you what you want.

          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

          • Login

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