QCompleter



  • I use the following to complete words:

    #include "dialog.h"
    #include "ui_dialog.h"

    Dialog::Dialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog)
    {
    ui->setupUi(this);

    //use the string list
    
    QStringList wordlist;
    //wordlist <<"book" << "bread" <<"beam" << "brick";
    
    
    StringCompleter = new QCompleter(wordlist,this);
    StringCompleter->setCaseSensitivity (Qt::CaseInsensitive);
    ui->lineEdit->setCompleter (StringCompleter);
    

    }

    Dialog::~Dialog()
    {
    delete ui;
    }
    This only provides options for the first word entered into lineEdit. How can I provide options for more than 1 word? Thank you for your help.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.