From ebfe3702f97c46ac972485401442a6e20da6065d Mon Sep 17 00:00:00 2001 From: mjbudd77 Date: Thu, 15 Oct 2020 22:22:44 -0400 Subject: [PATCH] Qt RAM search input validation in work. --- src/drivers/Qt/ConsoleDebugger.cpp | 2 ++ src/drivers/Qt/RamSearch.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/drivers/Qt/ConsoleDebugger.cpp b/src/drivers/Qt/ConsoleDebugger.cpp index cce01c85..fecb09ce 100644 --- a/src/drivers/Qt/ConsoleDebugger.cpp +++ b/src/drivers/Qt/ConsoleDebugger.cpp @@ -343,6 +343,7 @@ ConsoleDebugger::ConsoleDebugger(QWidget *parent) cpuCycExdVal->setInputMask( ">9000000000000000;" ); cpuCycExdVal->setAlignment(Qt::AlignLeft); cpuCycExdVal->setMaximumWidth( 18 * fontCharWidth ); + cpuCycExdVal->setCursorPosition(0); connect( cpuCycExdVal, SIGNAL(textEdited(const QString &)), this, SLOT(cpuCycleThresChanged(const QString &))); instrExdVal->setFont( font ); @@ -350,6 +351,7 @@ ConsoleDebugger::ConsoleDebugger(QWidget *parent) instrExdVal->setInputMask( ">9000000000000000;" ); instrExdVal->setAlignment(Qt::AlignLeft); instrExdVal->setMaximumWidth( 18 * fontCharWidth ); + instrExdVal->setCursorPosition(0); connect( instrExdVal, SIGNAL(textEdited(const QString &)), this, SLOT(instructionsThresChanged(const QString &))); brkCpuCycExd->setChecked( break_on_cycles ); diff --git a/src/drivers/Qt/RamSearch.cpp b/src/drivers/Qt/RamSearch.cpp index 3f24bfc9..8a633f79 100644 --- a/src/drivers/Qt/RamSearch.cpp +++ b/src/drivers/Qt/RamSearch.cpp @@ -220,6 +220,14 @@ RamSearchDialog_t::RamSearchDialog_t(QWidget *parent) diffByEdit->setEnabled( cmpOp == 'd' ); moduloEdit->setEnabled( cmpOp == '%' ); + diffByEdit->setMaxLength( 16 ); + //diffByEdit->setInputMask( ">H000000000000000;" ); + diffByEdit->setCursorPosition(0); + + moduloEdit->setMaxLength( 16 ); + //moduloEdit->setInputMask( ">H000000000000000;" ); + moduloEdit->setCursorPosition(0); + vbox->addWidget( lt_btn ); vbox->addWidget( gt_btn ); vbox->addWidget( le_btn ); @@ -900,6 +908,8 @@ void QRamSearchView::paintEvent(QPaintEvent *event) lineOffset = vbar->value(); + vbar->setMaximum( maxLineOffset ); + if ( lineOffset > maxLineOffset ) { lineOffset = maxLineOffset;