mirror of
https://github.com/zoriya/ComSquare.git
synced 2025-12-19 13:45:11 +00:00
Creating a custom dialog for the goto
This commit is contained in:
@@ -105,22 +105,17 @@ namespace ComSquare::Debugger
|
||||
|
||||
void MemoryViewer::gotoAddr()
|
||||
{
|
||||
QInputDialog dialog(this, Qt::WindowFlags());
|
||||
dialog.setWindowTitle("Go to:");
|
||||
dialog.setLabelText("Address");
|
||||
dialog.setIntRange(0, 0xFFFFFF);
|
||||
dialog.setIntValue(0);
|
||||
dialog.setIntStep(1);
|
||||
dialog.setWindowModality(Qt::WindowModal);
|
||||
QSpinBox *spinbox = dialog.findChild<QSpinBox*>();
|
||||
spinbox->setDisplayIntegerBase(16);
|
||||
QFont font = spinbox->font();
|
||||
QDialog dialog(this);
|
||||
Ui::GotoDialog dialogUI;
|
||||
dialogUI.setupUi(&dialog);
|
||||
QFont font = dialogUI.spinBox->font();
|
||||
font.setCapitalization(QFont::AllUppercase);
|
||||
spinbox->setFont(font);
|
||||
dialogUI.spinBox->setFont(font);
|
||||
dialogUI.spinBox->selectAll();
|
||||
|
||||
if (dialog.exec() != QDialog::Accepted)
|
||||
return;
|
||||
long value = std::strtol(spinbox->text().toStdString().c_str(), nullptr, 16);
|
||||
long value = std::strtol(dialogUI.spinBox->text().toStdString().c_str() + 1, nullptr, 16);
|
||||
QModelIndex index = this->_ui.tableView->model()->index(value >> 4, value & 0x0000000F);
|
||||
this->_ui.tableView->scrollTo(index);
|
||||
this->_ui.tableView->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect);
|
||||
|
||||
Reference in New Issue
Block a user