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. How to update or create new model of QCompleter?
Qt 6.11 is out! See what's new in the release blog

How to update or create new model of QCompleter?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 341 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.
  • V Offline
    V Offline
    vinh
    wrote on last edited by
    #1

    I'm try code:

    completeT = new QCompleter( listString, this );
    	completeT ->setCaseSensitivity( Qt::CaseInsensitive );
    	completeT ->setCompletionMode( QCompleter::PopupCompletion );
    	completeT ->setFilterMode( Qt::MatchContains );
    	ui->txt_lineEdit->setCompleter( completeT );
    

    and I update by code:

    completeT ->setModel( new QStringListModel( listCompleteT, this) );
    

    and I have error:57c37b60-d518-4c98-9463-988fad83af10-image.png

    How to update QStringList in my QCompleter?
    if new QCompleter() that increase memory and optimal?

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

      Hi,

      Update the content of the model you use for the completer. No need to recreate stuff again and again.

      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
      2

      • Login

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