![]() |
Home · Modules · Classes · Namespaces · Functions |
The QxtLookupLineEdit class is a QLineEdit to select from data provided by a QAbstractItemModel. QxtLookupLineEdit uses QxtFilterDialog to make it easy for the user, to select data from a large dataset. More...
#include <QxtLookupLineEdit>
Inherits QLineEdit.
The QxtLookupLineEdit class is a QLineEdit to select from data provided by a QAbstractItemModel. QxtLookupLineEdit uses QxtFilterDialog to make it easy for the user, to select data from a large dataset.
QSqlQueryModel *model = new QSqlQueryModel(parent); model->setQuery("Select employeeNr,name,forename,hometown,phone from employees;",dbConnection); QxtLookupLineEdit* edit = new QxtLookupLineEdit(parent); edit->setSourceModel(model); //we want to search by name not by nr so use the name column edit->setLookupColumn(1); //we need the employeeNr in the lineEdit , so choose col 0 as dataColumn edit->setDataColumn(0); //we want to seek the Display Role edit->setLookupRole(Qt::DisplayRole); //if the user presses * in the lineEdit open the popup edit->setPopupTrigger(QKeySequence("*"));
returns the model column index QxtLookupLineEdit will use to get data from the model after the user has chosen the dataset in the popup
See also setDataColumn().
returns the column the lineEdit is looking
See also setLookupColumn(const int column).
returns the role the lineEdit is looking
See also setLookupRole(const int role).
returns the trigger that opens the popup
See also setPopupTrigger and (const QKeySequence &trigger).
set the model column index QxtLookupLineEdit will use to get data from the model after the user has chosen the dataset in the popup
See also dataColumn().
sets the column wherethe popup dialog searches
See also lookupColumn().
sets the model role the popup should use
See also lookupRole().
Sets the popup trigger that makes QxtLookupLineEdit open the popup dialog
See also popupTrigger().
sets the sourceModel used in the popup dialog
See also sourceModel().
returns the sourceModel
See also setSourceModel(QAbstractItemModel *model).
Copyright © 2007-2010 Qxt Foundation |
Qxt 0.6.1 |