src/InventorySuppliers.cpp

changeset 9
85656dc48131
parent 8
ac4e363c09a7
child 10
8aa2bd9ba9e8
--- a/src/InventorySuppliers.cpp	Sun Feb 13 17:24:55 2022 +0100
+++ b/src/InventorySuppliers.cpp	Sun Feb 13 20:24:33 2022 +0100
@@ -62,7 +62,9 @@
 	/* Add the Edit button */
 	QWidget* pWidget = new QWidget();
 	QPushButton* btn_edit = new QPushButton();
+	btn_edit->setObjectName(QString("%1").arg(query.value(0).toString()));	/* Send record with the button */
 	btn_edit->setText(tr("Edit"));
+	connect(btn_edit, SIGNAL(clicked()), this, SLOT(on_editButton_clicked()));
 	QHBoxLayout* pLayout = new QHBoxLayout(pWidget);
 	pLayout->addWidget(btn_edit);
 	pLayout->setAlignment(Qt::AlignCenter);
@@ -75,6 +77,7 @@
     setWindowTitle( QString("BMSapp - %1 - Inventory Suppliers").arg(VERSIONSTRING) );
 }
 
+
 InventorySuppliers::~InventorySuppliers()
 {
     qDebug() << Q_FUNC_INFO;
@@ -82,13 +85,25 @@
 }
 
 
+void InventorySuppliers::on_editButton_clicked()
+{
+    QPushButton *pb = qobject_cast<QPushButton *>(QObject::sender());
+    int recno = pb->objectName().toInt();
+    qDebug() << Q_FUNC_INFO << recno;
+
+    // Call editor with recno
+}
+
+
 void InventorySuppliers::on_insertButton_clicked()
 {
     qDebug() << Q_FUNC_INFO;
+
+    // Call editor with -1
 }
 
 
-void InventorySuppliers::on_changeButton_clicked()
+void InventorySuppliers::on_quitButton_clicked()
 {
     qDebug() << Q_FUNC_INFO;
     emit firstWindow();

mercurial