|
|
@ -92,12 +92,13 @@ void ReceiptSaveForm::on_lineEdit_textChanged(const QString &text)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QSortFilterProxyModel proxy;
|
|
|
|
QSortFilterProxyModel proxy;
|
|
|
|
proxy.setSourceModel(m_voucherModel);
|
|
|
|
proxy.setSourceModel(m_voucherModel);
|
|
|
|
proxy.setFilterKeyColumn(0);
|
|
|
|
proxy.setFilterKeyColumn(3);
|
|
|
|
|
|
|
|
proxy.setFilterCaseSensitivity(Qt::CaseInsensitive);
|
|
|
|
proxy.setFilterFixedString(text);
|
|
|
|
proxy.setFilterFixedString(text);
|
|
|
|
|
|
|
|
|
|
|
|
QModelIndex matchingIndex = proxy.mapToSource(proxy.index(0,0));
|
|
|
|
QModelIndex matchingIndex = proxy.mapToSource(proxy.index(0,0));
|
|
|
|
if(matchingIndex.isValid()){
|
|
|
|
if(matchingIndex.isValid()){
|
|
|
|
ui->tabVouchers->scrollTo(matchingIndex,QAbstractItemView::EnsureVisible);
|
|
|
|
ui->tabVouchers->scrollTo(matchingIndex, QAbstractItemView::EnsureVisible);
|
|
|
|
ui->tabVouchers->setCurrentIndex(matchingIndex);
|
|
|
|
ui->tabVouchers->setCurrentIndex(matchingIndex);
|
|
|
|
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
|
|
|
|
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|