Shop - improved commodity search with bar code scanner.
This commit is contained in:
+7
-2
@@ -541,12 +541,14 @@ void ShopForm::on_btnAddItem_clicked()
|
||||
|
||||
void ShopForm::on_commoditySearch_textChanged(const QString &text)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
QString replacedText = text;
|
||||
|
||||
if (ui->numOnly->isChecked())
|
||||
if (i == 1)
|
||||
{
|
||||
replacedText = Helper::replaceByNumbers(text);
|
||||
ui->commoditySearch->setText(replacedText);
|
||||
//ui->commoditySearch->setText(replacedText);
|
||||
}
|
||||
|
||||
QSortFilterProxyModel proxy;
|
||||
@@ -564,6 +566,7 @@ void ShopForm::on_commoditySearch_textChanged(const QString &text)
|
||||
if(matchingIndex.isValid()) {
|
||||
moveToIndex(matchingIndex);
|
||||
m_itemFound = true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -574,12 +577,14 @@ void ShopForm::on_commoditySearch_textChanged(const QString &text)
|
||||
{
|
||||
moveToIndex(matchingIndex);
|
||||
m_itemFound = true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_itemFound = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ShopForm::on_lblEetState_linkActivated(const QString &)
|
||||
|
||||
@@ -45,13 +45,6 @@
|
||||
</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