void EmsInfoView::locationInfoWidgetDoubleClicked(int row, int column) { qDebug() << "Double click"; Q_UNUSED(column) if (ui.locationIdInfoTableWidget->rowCount() <= row) { return; } QString num = ui.locationIdInfoTableWidget->item(row,0)->text().split("x")[1]; bool ok = false; int locid = num.toInt(&ok,16); if (!ok) { qDebug() << "Numeric conversion failed for:" << num; return; } DataType type = DATA_UNDEFINED; if (ui.locationIdInfoTableWidget->item(row,2)->text() == "2D Table") { type = DATA_TABLE_2D; } else if (ui.locationIdInfoTableWidget->item(row,2)->text() == "3D Table") { type = DATA_TABLE_3D; } else if (ui.locationIdInfoTableWidget->item(row,2)->text() == "Lookup Table") { type = DATA_TABLE_LOOKUP; } else if (ui.locationIdInfoTableWidget->item(row,2)->text() == "Configuration") { type = DATA_CONFIG; } /*if (ui.locationIdInfoTableWidget->item(row,9)->text().toLower() == "true" && ui.locationIdInfoTableWidget->item(row,10)->text().toLower() == "true") { if (QMessageBox::question(0,"Ram or flash?","Do you wish to open the RAM? (If not, flash will be opened)",QMessageBox::Yes,QMessageBox::No) == QMessageBox::Yes) { //Is Ram emit displayLocationId(locid,true,type); } else { //is flash emit displayLocationId(locid,false,type); } } else if (ui.locationIdInfoTableWidget->item(row,9)->text().toLower() == "true") { //Is Ram emit displayLocationId(locid,true,type); } else if (ui.locationIdInfoTableWidget->item(row,10)->text().toLower() == "true") { //is flash emit displayLocationId(locid,false,type); }*/ displayLocationId(locid,true,type); }
void EmsInfoView::hexViewClicked() { if (ui.locationIdInfoTableWidget->selectedItems().size() == 0) { return; } int row = ui.locationIdInfoTableWidget->selectedItems()[0]->row(); QString num = ui.locationIdInfoTableWidget->item(row,0)->text().split("x")[1]; bool ok = false; int locid = num.toInt(&ok,16); if (!ok) { qDebug() << "Numeric conversion failed for:" << num; return; } displayLocationId(locid,true,1); //0 for normal view, 1 for hex view }