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 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

    raven-worxR 1 Reply Last reply
    0
    • A arnitdo

      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-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on 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
      2
      • raven-worxR raven-worx

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

        A Offline
        A Offline
        arnitdo
        wrote on last edited by
        #3

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

        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