Voucher item grid now scrolls to bottom on add new item.

closes #288
This commit is contained in:
2017-03-21 14:31:45 +01:00
parent c6e4e5818a
commit bf67dadaeb
3 changed files with 8 additions and 4 deletions
+3 -2
View File
@@ -67,12 +67,13 @@ void ReceiptLoadForm::on_lineEdit_textChanged(const QString &text)
{
QSortFilterProxyModel proxy;
proxy.setSourceModel(m_voucherModel);
proxy.setFilterKeyColumn(2);
proxy.setFilterKeyColumn(3);
proxy.setFilterCaseSensitivity(Qt::CaseInsensitive);
proxy.setFilterFixedString(text);
QModelIndex matchingIndex = proxy.mapToSource(proxy.index(0,0));
if(matchingIndex.isValid()){
ui->tabVouchers->scrollTo(matchingIndex,QAbstractItemView::EnsureVisible);
ui->tabVouchers->scrollTo(matchingIndex, QAbstractItemView::EnsureVisible);
ui->tabVouchers->setCurrentIndex(matchingIndex);
}
}