// Connect the buttons.
connect(dialogButtonBoxPointer, SIGNAL(rejected()), this, SLOT(close()));
- // Open the request detail dialog when
+ // Open the request detail dialog when a cell is clicked.
connect(tableWidgetPointer, SIGNAL(cellClicked(int, int)), this, SLOT(showRequestDetailDialog(int)));
}
void RequestsDialog::showRequestDetailDialog(int row)
{
- // Get the first table widget item in the row.
- QTableWidgetItem *rowFirstTableWidgetItemPointer = tableWidgetPointer->item(row, 0);
-
- // Get the data variant.
- QVariant dataVariant = rowFirstTableWidgetItemPointer->data(Qt::UserRole);
-
- // Get the request struct byte array from the data variant.
- QByteArray requestStructByteArray = dataVariant.toByteArray();
-
// Instantiate the request details dialog.
- RequestDetailDialog *requestDetailDialogPointer = new RequestDetailDialog(this, requestStructByteArray);
+ RequestDetailDialog *requestDetailDialogPointer = new RequestDetailDialog(this, tableWidgetPointer, row);
// Show the dialog.
requestDetailDialogPointer->show();