diff options
author | Daniel Jones <admin@danieljon.es> | 2019-04-11 10:51:31 +0930 |
---|---|---|
committer | Daniel Jones <admin@danieljon.es> | 2019-04-11 10:51:31 +0930 |
commit | a140c3d8d118a27d685ce06f7d296d27602c5043 (patch) | |
tree | 820ef6c80641b90fb51cdd446e60217a2efc813c /productinventory.cpp | |
parent | 0069dd59b4284d17ca67224dbc77cdd06dd40b5c (diff) | |
download | productinventory-a140c3d8d118a27d685ce06f7d296d27602c5043.tar.gz productinventory-a140c3d8d118a27d685ce06f7d296d27602c5043.zip |
many fixes, tweaks and things added, mainly checkbox related
Diffstat (limited to 'productinventory.cpp')
-rw-r--r-- | productinventory.cpp | 54 |
1 files changed, 48 insertions, 6 deletions
diff --git a/productinventory.cpp b/productinventory.cpp index 5842a81..7ba3482 100644 --- a/productinventory.cpp +++ b/productinventory.cpp @@ -48,9 +48,6 @@ ProductInventory::ProductInventory(QWidget *parent) : headerLabels.append(QString("Images")); headerLabels.append(QString("Date added")); createTable("Connect to the database to populate the tables"); - - categoryLayout = new QGridLayout; - ui->filterCategoryScrollArea->setLayout(categoryLayout); } /*! @@ -59,7 +56,6 @@ ProductInventory::ProductInventory(QWidget *parent) : ProductInventory::~ProductInventory() { clearTables(); - delete categoryLayout; delete ui; } @@ -187,7 +183,7 @@ ProductInventory::addItemToTable(QTableWidget *table, QList<QString> *values) void ProductInventory::clearTables() { - qDebug() << "clearing table and deleting items"; + qDebug() << "clearing tables and deleting items"; ui->tableWidget->setRowCount(0); // automagically deletes items QList<QTableWidget *>::iterator i; for (i = tables.begin(); i != tables.end(); i++) @@ -224,7 +220,7 @@ ProductInventory::createTable(QString category) QTableWidget *table = new QTableWidget; if (table == nullptr) return -1; - table->setMinimumHeight(100); + table->setMinimumHeight(200); table->setColumnCount(headerLabels.size()); table->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); table->setHorizontalHeaderLabels(headerLabels); @@ -253,3 +249,49 @@ ProductInventory::resizeRows() (*i)->resizeRowsToContents(); } } + +void +ProductInventory::on_selectAllButton_clicked() +{ + QList<QCheckBox *>::iterator c; + for (c = checkboxes.begin(); c != checkboxes.end(); c++) + { + (*c)->setChecked(true); + } +} + +void +ProductInventory::on_unselectAllButton_clicked() +{ + QList<QCheckBox *>::iterator c; + for (c = checkboxes.begin(); c != checkboxes.end(); c++) + { + (*c)->setChecked(false); + } + +} + +void +ProductInventory::on_filterSortAlphabeticalCheckBox_clicked() +{ + ui->filterSortReverseAlphabeticalCheckBox->setChecked(false); +} + +void +ProductInventory::on_filterSortReverseAlphabeticalCheckBox_clicked() +{ + + ui->filterSortAlphabeticalCheckBox->setChecked(false); +} + +void +ProductInventory::on_newestFirstCheckBox_clicked() +{ + ui->oldestFirstCheckBox->setChecked(false); +} + +void +ProductInventory::on_oldestFirstCheckBox_clicked() +{ + ui->newestFirstCheckBox->setChecked(false); +} |