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. Is there a way to have a multi-line text input widget with autocomplete?

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

Scheduled Pinned Locked Moved Solved General and Desktop
qcompleterqtexteditautocomplete
3 Posts 2 Posters 1.4k Views
  • 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 Offline
    A Offline
    arnitdo
    wrote on 29 Jan 2022, 15:06 last edited by
    #1

    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

    R 1 Reply Last reply 29 Jan 2022, 16:30
    0
    • A arnitdo
      29 Jan 2022, 15:06

      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

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 29 Jan 2022, 16:30 last edited by
      #2

      @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 29 Jan 2022, 16:58
      2
      • R raven-worx
        29 Jan 2022, 16:30

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

        A Offline
        A Offline
        arnitdo
        wrote on 29 Jan 2022, 16:58 last edited by
        #3

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

        1 Reply Last reply
        0

        2/3

        29 Jan 2022, 16:30

        • Login

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