From 90d31dadcac60f8734b6e3848f77d53d2f5af019 Mon Sep 17 00:00:00 2001 From: mjbudd77 Date: Thu, 18 Feb 2021 21:48:57 -0500 Subject: [PATCH] Added logic to Qt hex editor to set minimum line width to full line length at construction. Part of #322. --- src/drivers/Qt/HexEditor.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/drivers/Qt/HexEditor.cpp b/src/drivers/Qt/HexEditor.cpp index 13c3983b..0e8b619e 100644 --- a/src/drivers/Qt/HexEditor.cpp +++ b/src/drivers/Qt/HexEditor.cpp @@ -1085,11 +1085,11 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent) vbar->setMinimum(0); vbar->setMaximum( 0x10000 / 16 ); - editor->setScrollBars( hbar, vbar ); - - //connect( vbar, SIGNAL(sliderMoved(int)), this, SLOT(vbarMoved(int)) ); - connect( hbar, SIGNAL(valueChanged(int)), this, SLOT(hbarChanged(int)) ); - connect( vbar, SIGNAL(valueChanged(int)), this, SLOT(vbarChanged(int)) ); + editor->setScrollBars( hbar, vbar ); + + //connect( vbar, SIGNAL(sliderMoved(int)), this, SLOT(vbarMoved(int)) ); + connect( hbar, SIGNAL(valueChanged(int)), this, SLOT(hbarChanged(int)) ); + connect( vbar, SIGNAL(valueChanged(int)), this, SLOT(vbarChanged(int)) ); findDialog = NULL; @@ -1097,9 +1097,10 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent) periodicTimer = new QTimer( this ); - connect( periodicTimer, &QTimer::timeout, this, &HexEditorDialog_t::updatePeriodic ); + connect( periodicTimer, &QTimer::timeout, this, &HexEditorDialog_t::updatePeriodic ); periodicTimer->start( 100 ); // 10hz + //periodicTimer->start( 16 ); // 10hz // Lock the mutex before adding a new window to the list, // we want to be sure that the emulator is not iterating the list @@ -1509,6 +1510,8 @@ QHexEdit::QHexEdit(QWidget *parent) calcFontData(); + setMinimumWidth( pxLineWidth ); + memAccessFunc = getRAM; viewMode = MODE_NES_RAM; lineOffset = 0;