Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Is there a way to have a multi-line text input widget with autocomplete?

    General and Desktop
    qcompleter qtextedit autocomplete
    2
    3
    347
    Loading More Posts
    • 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.
    • A
      arnitdo last edited by

      Using (for reference)

      • Qt 5.15.2
      • C++11
      • CMake
      • Windows 10

      I'm currently using QCompleter to provide autocomplete suggestions in my project. Only QLineEdit (i.e single line) supports QCompleter as the completer. The user input will span multiple lines, and I will be requiring QTextEdit or a similar multi-line text input widget for the task. Is there a way to have QCompleter work with QTextEdit?

      One solution I've thought of is creating multiple QLineEdit widgets, and setting the completer for each widget, which does not seem very efficient or smart. Any help is appreciated.

      TIA, arnitdo

      raven-worx 1 Reply Last reply Reply Quote 0
      • raven-worx
        raven-worx Moderators @arnitdo last edited by

        @arnitdo
        https://doc.qt.io/qt-5/qtwidgets-tools-customcompleter-example.html

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        A 1 Reply Last reply Reply Quote 2
        • A
          arnitdo @raven-worx last edited by

          @raven-worx Thanks a lot for the quick response! I'll look into it.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post