Fixed barcode scanner issue on Windows with czech keyboard.
This commit is contained in:
+9
-1
@@ -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
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user