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

closes #288
print
Josef Rokos 8 years ago
parent c6e4e5818a
commit bf67dadaeb

@ -67,7 +67,8 @@ void ReceiptLoadForm::on_lineEdit_textChanged(const QString &text)
{ {
QSortFilterProxyModel proxy; QSortFilterProxyModel proxy;
proxy.setSourceModel(m_voucherModel); proxy.setSourceModel(m_voucherModel);
proxy.setFilterKeyColumn(2); 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));

@ -92,7 +92,8 @@ 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));

@ -311,6 +311,8 @@ void ShopForm::addItem(QSharedPointer<IShopItem> item, int count)
this->m_itemsModel->addRow(m_voucher->items()[m_voucher->items().count() - 1]); this->m_itemsModel->addRow(m_voucher->items()[m_voucher->items().count() - 1]);
connect(m_voucher->items()[m_voucher->items().count() - 1].data(), SIGNAL(countChanged(int)), this, SLOT(onCountChanged(int))); connect(m_voucher->items()[m_voucher->items().count() - 1].data(), SIGNAL(countChanged(int)), this, SLOT(onCountChanged(int)));
onCountChanged(); onCountChanged();
ui->actualReceipt->scrollToBottom();
} }
void ShopForm::on_receiptCombo_currentIndexChanged(int) void ShopForm::on_receiptCombo_currentIndexChanged(int)

Loading…
Cancel
Save