Commit dbdc3ab2 authored by Hugo Hörnquist's avatar Hugo Hörnquist

Fix quick-filter default setting

parent 00d0ed5e
......@@ -267,6 +267,8 @@ MainWindow::MainWindow(QWidget *parent) :
ui->inventoryCheckView->hideColumn(1);
ui->inventoryCheckView->hideColumn(2);
ui->quickInventoryCheckBox->setChecked(true);
// --------------------------------------------------
setMoneyDiffLabels();
......@@ -879,14 +881,15 @@ void MainWindow::on_productListSearch_textChanged(const QString &arg1)
setProductFilter();
}
/*
* Note that the hidden rows can still contain data that WILL be
* submitted.
* TODO Possibly have some form of warning when it comes to that.
*/
void MainWindow::on_quickInventoryCheckBox_toggled(bool checked)
{
QSqlRelationalTableModel* model = (QSqlRelationalTableModel*) ui->inventoryCheckView->model();
// This repopulates
model->setFilter(
checked
? "sale_status in (0, 1)"
: "sale_status = 0 or expected != 0");
qDebug() << "Checkbox toggled" << checked;
((QSqlRelationalTableModel*) ui->inventoryCheckView->model())
->setFilter( checked
? "sale_status = 0 or expected != 0"
: "sale_status in (0, 1)");
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment