src/InventorySuppliers.cpp

Tue, 15 Feb 2022 23:00:45 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Tue, 15 Feb 2022 23:00:45 +0100
changeset 12
66e10898a2a9
parent 11
c9cdc15d3caf
child 19
c94edc758a5b
permissions
-rw-r--r--

Suppliers table refresh works after edit.

6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /**
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 * InventorySuppliers.cpp is part of bmsapp.
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * bmsapp is free software: you can redistribute it and/or modify
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * the Free Software Foundation, either version 3 of the License, or
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 * (at your option) any later version.
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 *
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * bmsapp is distributed in the hope that it will be useful,
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 * GNU General Public License for more details.
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 *
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 */
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 #include "InventorySuppliers.h"
10
8aa2bd9ba9e8 Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents: 9
diff changeset
18 #include "EditSupplier.h"
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 #include "../ui/ui_InventorySuppliers.h"
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 #include "config.h"
10
8aa2bd9ba9e8 Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents: 9
diff changeset
21 #include "bmsapp.h"
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22
10
8aa2bd9ba9e8 Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents: 9
diff changeset
23
8aa2bd9ba9e8 Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents: 9
diff changeset
24
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25 InventorySuppliers::InventorySuppliers(QWidget *parent) : QDialog(parent), ui(new Ui::InventorySuppliers)
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
26 {
12
66e10898a2a9 Suppliers table refresh works after edit.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
27 qDebug() << "InventorySuppliers start";
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28
7
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
29 ui->setupUi(this);
11
c9cdc15d3caf The Supplier editor saves changes and inserts new suppliers. It sends a signal to InventorySuppliers when done (always for now). Refresh the table still doesn't work. Added a missing iconn in the Inventory menus dropdown.
Michiel Broek <mbroek@mbse.eu>
parents: 10
diff changeset
30 emit refreshTable();
7
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
31
10
8aa2bd9ba9e8 Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents: 9
diff changeset
32 setWindowTitle( QString("BMSapp - %1 - Inventory Suppliers").arg(VERSIONSTRING) );
8aa2bd9ba9e8 Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents: 9
diff changeset
33 }
8aa2bd9ba9e8 Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents: 9
diff changeset
34
8aa2bd9ba9e8 Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents: 9
diff changeset
35
11
c9cdc15d3caf The Supplier editor saves changes and inserts new suppliers. It sends a signal to InventorySuppliers when done (always for now). Refresh the table still doesn't work. Added a missing iconn in the Inventory menus dropdown.
Michiel Broek <mbroek@mbse.eu>
parents: 10
diff changeset
36 void InventorySuppliers::refreshTable()
10
8aa2bd9ba9e8 Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents: 9
diff changeset
37 {
11
c9cdc15d3caf The Supplier editor saves changes and inserts new suppliers. It sends a signal to InventorySuppliers when done (always for now). Refresh the table still doesn't work. Added a missing iconn in the Inventory menus dropdown.
Michiel Broek <mbroek@mbse.eu>
parents: 10
diff changeset
38 qDebug() << "slot" << Q_FUNC_INFO;
c9cdc15d3caf The Supplier editor saves changes and inserts new suppliers. It sends a signal to InventorySuppliers when done (always for now). Refresh the table still doesn't work. Added a missing iconn in the Inventory menus dropdown.
Michiel Broek <mbroek@mbse.eu>
parents: 10
diff changeset
39
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
40 QSqlQuery query("SELECT * FROM inventory_suppliers ORDER BY name");
7
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
41 const QStringList labels({tr("Record"), tr("Name"), tr("Address"), tr("City"), tr("Country"), tr("Phone"), tr("Edit")});
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
42
7
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
43 ui->tableSuppliers->setColumnCount(7);
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
44 ui->tableSuppliers->setColumnWidth(0, 50); /* Record */
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
45 ui->tableSuppliers->setColumnWidth(1, 250); /* Name */
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
46 ui->tableSuppliers->setColumnWidth(2, 250); /* Address */
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
47 ui->tableSuppliers->setColumnWidth(3, 200); /* City */
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
48 ui->tableSuppliers->setColumnWidth(4, 120); /* Country */
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
49 ui->tableSuppliers->setColumnWidth(5, 120); /* Phone */
8
ac4e363c09a7 The table screen is more or less complete.
Michiel Broek <mbroek@mbse.eu>
parents: 7
diff changeset
50 ui->tableSuppliers->setColumnWidth(6, 90); /* Edit button */
7
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
51 ui->tableSuppliers->setRowCount(query.size());
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
52 ui->tableSuppliers->setHorizontalHeaderLabels(labels);
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
53 ui->tableSuppliers->verticalHeader()->hide();
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
54 ui->tableSuppliers->setFixedSize(1280, 640); /* Even if this is too large, it works */
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
55
12
66e10898a2a9 Suppliers table refresh works after edit.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
56 // qDebug() << query.record().count() << query.size();
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
57 query.first();
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
58 for (int ridx = 0 ; ridx < query.size() ; ridx++ ) {
7
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
59 for (int cidx = 0 ; cidx < 4; cidx++) {
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60 QTableWidgetItem* item = new QTableWidgetItem(query.value(cidx).toString());
7
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
61 ui->tableSuppliers->setItem(ridx, cidx, item );
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
62 }
12
66e10898a2a9 Suppliers table refresh works after edit.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
63 // qDebug() << ridx << "record:" << query.value(0).toString() << " name:" << query.value(1).toString();
7
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
64 QTableWidgetItem* item = new QTableWidgetItem(query.value(5).toString());
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
65 ui->tableSuppliers->setItem(ridx, 4, item );
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
66 item = new QTableWidgetItem(query.value(8).toString());
51fbea52551e The suppliers table now shows on the right screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
67 ui->tableSuppliers->setItem(ridx, 5, item );
8
ac4e363c09a7 The table screen is more or less complete.
Michiel Broek <mbroek@mbse.eu>
parents: 7
diff changeset
68 /* Add the Edit button */
ac4e363c09a7 The table screen is more or less complete.
Michiel Broek <mbroek@mbse.eu>
parents: 7
diff changeset
69 QWidget* pWidget = new QWidget();
ac4e363c09a7 The table screen is more or less complete.
Michiel Broek <mbroek@mbse.eu>
parents: 7
diff changeset
70 QPushButton* btn_edit = new QPushButton();
9
85656dc48131 The Edit buttons include the record number in the database. Ready to build the modal supplier edit/insert/delete screen.
Michiel Broek <mbroek@mbse.eu>
parents: 8
diff changeset
71 btn_edit->setObjectName(QString("%1").arg(query.value(0).toString())); /* Send record with the button */
8
ac4e363c09a7 The table screen is more or less complete.
Michiel Broek <mbroek@mbse.eu>
parents: 7
diff changeset
72 btn_edit->setText(tr("Edit"));
9
85656dc48131 The Edit buttons include the record number in the database. Ready to build the modal supplier edit/insert/delete screen.
Michiel Broek <mbroek@mbse.eu>
parents: 8
diff changeset
73 connect(btn_edit, SIGNAL(clicked()), this, SLOT(on_editButton_clicked()));
8
ac4e363c09a7 The table screen is more or less complete.
Michiel Broek <mbroek@mbse.eu>
parents: 7
diff changeset
74 QHBoxLayout* pLayout = new QHBoxLayout(pWidget);
ac4e363c09a7 The table screen is more or less complete.
Michiel Broek <mbroek@mbse.eu>
parents: 7
diff changeset
75 pLayout->addWidget(btn_edit);
ac4e363c09a7 The table screen is more or less complete.
Michiel Broek <mbroek@mbse.eu>
parents: 7
diff changeset
76 pLayout->setAlignment(Qt::AlignCenter);
ac4e363c09a7 The table screen is more or less complete.
Michiel Broek <mbroek@mbse.eu>
parents: 7
diff changeset
77 pLayout->setContentsMargins(0, 0, 0, 0);
ac4e363c09a7 The table screen is more or less complete.
Michiel Broek <mbroek@mbse.eu>
parents: 7
diff changeset
78 pWidget->setLayout(pLayout);
ac4e363c09a7 The table screen is more or less complete.
Michiel Broek <mbroek@mbse.eu>
parents: 7
diff changeset
79 ui->tableSuppliers->setCellWidget(ridx, 6, pWidget);
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
80 query.next();
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
81 }
12
66e10898a2a9 Suppliers table refresh works after edit.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
82 // qDebug() << "table ready";
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
83
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
84 setWindowTitle( QString("BMSapp - %1 - Inventory Suppliers").arg(VERSIONSTRING) );
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
85 }
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
86
9
85656dc48131 The Edit buttons include the record number in the database. Ready to build the modal supplier edit/insert/delete screen.
Michiel Broek <mbroek@mbse.eu>
parents: 8
diff changeset
87
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
88 InventorySuppliers::~InventorySuppliers()
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89 {
12
66e10898a2a9 Suppliers table refresh works after edit.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
90 qDebug() << "InventorySuppliers done";
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
91 delete ui;
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
92 }
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
93
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
94
11
c9cdc15d3caf The Supplier editor saves changes and inserts new suppliers. It sends a signal to InventorySuppliers when done (always for now). Refresh the table still doesn't work. Added a missing iconn in the Inventory menus dropdown.
Michiel Broek <mbroek@mbse.eu>
parents: 10
diff changeset
95 void InventorySuppliers::edit(int recno)
10
8aa2bd9ba9e8 Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents: 9
diff changeset
96 {
12
66e10898a2a9 Suppliers table refresh works after edit.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
97 qDebug() << "InventorySuppliers edit:" << recno;
10
8aa2bd9ba9e8 Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents: 9
diff changeset
98
8aa2bd9ba9e8 Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents: 9
diff changeset
99 EditSupplier dialog(recno, this);
11
c9cdc15d3caf The Supplier editor saves changes and inserts new suppliers. It sends a signal to InventorySuppliers when done (always for now). Refresh the table still doesn't work. Added a missing iconn in the Inventory menus dropdown.
Michiel Broek <mbroek@mbse.eu>
parents: 10
diff changeset
100 /* Signal from editor if a refresh is needed */
c9cdc15d3caf The Supplier editor saves changes and inserts new suppliers. It sends a signal to InventorySuppliers when done (always for now). Refresh the table still doesn't work. Added a missing iconn in the Inventory menus dropdown.
Michiel Broek <mbroek@mbse.eu>
parents: 10
diff changeset
101 connect(&dialog, SIGNAL(entry_changed()), this, SLOT(refreshTable()));
c9cdc15d3caf The Supplier editor saves changes and inserts new suppliers. It sends a signal to InventorySuppliers when done (always for now). Refresh the table still doesn't work. Added a missing iconn in the Inventory menus dropdown.
Michiel Broek <mbroek@mbse.eu>
parents: 10
diff changeset
102 dialog.setModal(true);
c9cdc15d3caf The Supplier editor saves changes and inserts new suppliers. It sends a signal to InventorySuppliers when done (always for now). Refresh the table still doesn't work. Added a missing iconn in the Inventory menus dropdown.
Michiel Broek <mbroek@mbse.eu>
parents: 10
diff changeset
103 dialog.exec();
10
8aa2bd9ba9e8 Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents: 9
diff changeset
104 }
8aa2bd9ba9e8 Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents: 9
diff changeset
105
8aa2bd9ba9e8 Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents: 9
diff changeset
106
9
85656dc48131 The Edit buttons include the record number in the database. Ready to build the modal supplier edit/insert/delete screen.
Michiel Broek <mbroek@mbse.eu>
parents: 8
diff changeset
107 void InventorySuppliers::on_editButton_clicked()
85656dc48131 The Edit buttons include the record number in the database. Ready to build the modal supplier edit/insert/delete screen.
Michiel Broek <mbroek@mbse.eu>
parents: 8
diff changeset
108 {
85656dc48131 The Edit buttons include the record number in the database. Ready to build the modal supplier edit/insert/delete screen.
Michiel Broek <mbroek@mbse.eu>
parents: 8
diff changeset
109 QPushButton *pb = qobject_cast<QPushButton *>(QObject::sender());
85656dc48131 The Edit buttons include the record number in the database. Ready to build the modal supplier edit/insert/delete screen.
Michiel Broek <mbroek@mbse.eu>
parents: 8
diff changeset
110 int recno = pb->objectName().toInt();
85656dc48131 The Edit buttons include the record number in the database. Ready to build the modal supplier edit/insert/delete screen.
Michiel Broek <mbroek@mbse.eu>
parents: 8
diff changeset
111 qDebug() << Q_FUNC_INFO << recno;
10
8aa2bd9ba9e8 Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents: 9
diff changeset
112 edit(recno);
9
85656dc48131 The Edit buttons include the record number in the database. Ready to build the modal supplier edit/insert/delete screen.
Michiel Broek <mbroek@mbse.eu>
parents: 8
diff changeset
113 }
85656dc48131 The Edit buttons include the record number in the database. Ready to build the modal supplier edit/insert/delete screen.
Michiel Broek <mbroek@mbse.eu>
parents: 8
diff changeset
114
85656dc48131 The Edit buttons include the record number in the database. Ready to build the modal supplier edit/insert/delete screen.
Michiel Broek <mbroek@mbse.eu>
parents: 8
diff changeset
115
8
ac4e363c09a7 The table screen is more or less complete.
Michiel Broek <mbroek@mbse.eu>
parents: 7
diff changeset
116 void InventorySuppliers::on_insertButton_clicked()
ac4e363c09a7 The table screen is more or less complete.
Michiel Broek <mbroek@mbse.eu>
parents: 7
diff changeset
117 {
ac4e363c09a7 The table screen is more or less complete.
Michiel Broek <mbroek@mbse.eu>
parents: 7
diff changeset
118 qDebug() << Q_FUNC_INFO;
10
8aa2bd9ba9e8 Added the EditSupplier popup window. It is now ready to validate the form data.
Michiel Broek <mbroek@mbse.eu>
parents: 9
diff changeset
119 edit(-1);
8
ac4e363c09a7 The table screen is more or less complete.
Michiel Broek <mbroek@mbse.eu>
parents: 7
diff changeset
120 }
ac4e363c09a7 The table screen is more or less complete.
Michiel Broek <mbroek@mbse.eu>
parents: 7
diff changeset
121
ac4e363c09a7 The table screen is more or less complete.
Michiel Broek <mbroek@mbse.eu>
parents: 7
diff changeset
122
9
85656dc48131 The Edit buttons include the record number in the database. Ready to build the modal supplier edit/insert/delete screen.
Michiel Broek <mbroek@mbse.eu>
parents: 8
diff changeset
123 void InventorySuppliers::on_quitButton_clicked()
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
124 {
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
125 emit firstWindow();
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
126 }
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
127

mercurial