60 item = new QTableWidgetItem(query.value(8).toString()); |
60 item = new QTableWidgetItem(query.value(8).toString()); |
61 ui->tableSuppliers->setItem(ridx, 5, item ); |
61 ui->tableSuppliers->setItem(ridx, 5, item ); |
62 /* Add the Edit button */ |
62 /* Add the Edit button */ |
63 QWidget* pWidget = new QWidget(); |
63 QWidget* pWidget = new QWidget(); |
64 QPushButton* btn_edit = new QPushButton(); |
64 QPushButton* btn_edit = new QPushButton(); |
|
65 btn_edit->setObjectName(QString("%1").arg(query.value(0).toString())); /* Send record with the button */ |
65 btn_edit->setText(tr("Edit")); |
66 btn_edit->setText(tr("Edit")); |
|
67 connect(btn_edit, SIGNAL(clicked()), this, SLOT(on_editButton_clicked())); |
66 QHBoxLayout* pLayout = new QHBoxLayout(pWidget); |
68 QHBoxLayout* pLayout = new QHBoxLayout(pWidget); |
67 pLayout->addWidget(btn_edit); |
69 pLayout->addWidget(btn_edit); |
68 pLayout->setAlignment(Qt::AlignCenter); |
70 pLayout->setAlignment(Qt::AlignCenter); |
69 pLayout->setContentsMargins(0, 0, 0, 0); |
71 pLayout->setContentsMargins(0, 0, 0, 0); |
70 pWidget->setLayout(pLayout); |
72 pWidget->setLayout(pLayout); |
73 } |
75 } |
74 |
76 |
75 setWindowTitle( QString("BMSapp - %1 - Inventory Suppliers").arg(VERSIONSTRING) ); |
77 setWindowTitle( QString("BMSapp - %1 - Inventory Suppliers").arg(VERSIONSTRING) ); |
76 } |
78 } |
77 |
79 |
|
80 |
78 InventorySuppliers::~InventorySuppliers() |
81 InventorySuppliers::~InventorySuppliers() |
79 { |
82 { |
80 qDebug() << Q_FUNC_INFO; |
83 qDebug() << Q_FUNC_INFO; |
81 delete ui; |
84 delete ui; |
82 } |
85 } |
83 |
86 |
84 |
87 |
|
88 void InventorySuppliers::on_editButton_clicked() |
|
89 { |
|
90 QPushButton *pb = qobject_cast<QPushButton *>(QObject::sender()); |
|
91 int recno = pb->objectName().toInt(); |
|
92 qDebug() << Q_FUNC_INFO << recno; |
|
93 |
|
94 // Call editor with recno |
|
95 } |
|
96 |
|
97 |
85 void InventorySuppliers::on_insertButton_clicked() |
98 void InventorySuppliers::on_insertButton_clicked() |
86 { |
99 { |
87 qDebug() << Q_FUNC_INFO; |
100 qDebug() << Q_FUNC_INFO; |
|
101 |
|
102 // Call editor with -1 |
88 } |
103 } |
89 |
104 |
90 |
105 |
91 void InventorySuppliers::on_changeButton_clicked() |
106 void InventorySuppliers::on_quitButton_clicked() |
92 { |
107 { |
93 qDebug() << Q_FUNC_INFO; |
108 qDebug() << Q_FUNC_INFO; |
94 emit firstWindow(); |
109 emit firstWindow(); |
95 } |
110 } |
96 |
111 |