I am trying to create a autocompleting line edit in Qt but my program is crashing for reasons I cant understand, the code that makes it crash is
model_Customer->setTable("Customer");
model_Customer->select();
model_Product->setTable("Product");
model_Product->select();
Account_completer->setModel(model_Customer);
Product_completer->setModel(model_Product);
Account_completer->setCaseSensitivity(Qt::CaseInsensitive);
Product_completer->setCaseSensitivity(Qt::CaseInsensitive);
AutoComplete();
ui->lineEdit_Invoice_Account->setCompleter(Account_completer);
ui->lineEdit_Invoice_Product->setCompleter(Product_completer);
my .h file is below
QSqlDatabase db;
QSqlTableModel *model_Customer;
QSqlTableModel *model_Product;
QCompleter *Account_completer;
QCompleter *Product_completer;
Thank you
Aucun commentaire:
Enregistrer un commentaire