Added checkbox for select all items from saved receipt.
This commit is contained in:
@@ -221,6 +221,24 @@ public:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setSelectAll(bool select) {
|
||||||
|
if (!m_checkboxSelect) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
beginResetModel();
|
||||||
|
m_selectedRows.clear();
|
||||||
|
|
||||||
|
if (select)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < rowCount(); i++)
|
||||||
|
{
|
||||||
|
m_selectedRows << i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
endResetModel();
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void handleFilter(const QString &filter) override
|
void handleFilter(const QString &filter) override
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -77,3 +77,8 @@ void ReceiptLoadForm::on_lineEdit_textChanged(const QString &text)
|
|||||||
ui->tabVouchers->setCurrentIndex(matchingIndex);
|
ui->tabVouchers->setCurrentIndex(matchingIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReceiptLoadForm::on_selectAllCheck_clicked(bool checked)
|
||||||
|
{
|
||||||
|
m_itemModel->setSelectAll(checked);
|
||||||
|
}
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ public:
|
|||||||
private slots:
|
private slots:
|
||||||
void on_lineEdit_textChanged(const QString &text);
|
void on_lineEdit_textChanged(const QString &text);
|
||||||
|
|
||||||
|
void on_selectAllCheck_clicked(bool checked);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ReceiptLoadForm *ui;
|
Ui::ReceiptLoadForm *ui;
|
||||||
AutoTableModel<Voucher> *m_voucherModel;
|
AutoTableModel<Voucher> *m_voucherModel;
|
||||||
|
|||||||
+15
-1
@@ -50,7 +50,21 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTableView" name="tabItems"/>
|
<widget class="QCheckBox" name="selectAllCheck">
|
||||||
|
<property name="text">
|
||||||
|
<string>Select &all</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QTableView" name="tabItems">
|
||||||
|
<property name="selectionMode">
|
||||||
|
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||||
|
</property>
|
||||||
|
<property name="selectionBehavior">
|
||||||
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
Reference in New Issue
Block a user