Fixed barcode scanner issue on Windows with czech keyboard.

This commit is contained in:
2018-05-10 15:06:27 +02:00
parent b8ed333c3a
commit b69637165d
6 changed files with 79 additions and 4 deletions
+9 -1
View File
@@ -541,11 +541,19 @@ void ShopForm::on_btnAddItem_clicked()
void ShopForm::on_commoditySearch_textChanged(const QString &text)
{
QString replacedText = text;
if (ui->numOnly->isChecked())
{
replacedText = Helper::replaceByNumbers(text);
ui->commoditySearch->setText(replacedText);
}
QSortFilterProxyModel proxy;
proxy.setSourceModel(m_commodityModel);
proxy.setFilterKeyColumn(0);
proxy.setFilterCaseSensitivity(Qt::CaseInsensitive);
proxy.setFilterFixedString(text);
proxy.setFilterFixedString(replacedText);
auto moveToIndex = [this](const QModelIndex &matchingIndex) {
ui->commodityTable->scrollTo(matchingIndex,QAbstractItemView::EnsureVisible);
+8 -1
View File
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>975</width>
<width>988</width>
<height>643</height>
</rect>
</property>
@@ -45,6 +45,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="numOnly">
<property name="text">
<string>Replace chars by numbers</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="commoditySearch"/>
</item>