1
0
Fork 0

GUI: fixed a small bug in the registersview

This commit is contained in:
Mr. eXoDia 2014-06-21 00:51:41 +02:00
parent 958ae10886
commit 4ef1fc9e40
1 changed files with 11 additions and 2 deletions

View File

@ -237,7 +237,8 @@ RegistersView::~RegistersView()
bool RegistersView::identifyRegister(const int line, const int offset, REGISTER_NAME *clickedReg)
{
// we start by an unknown register id
*clickedReg = UNKNOWN;
if(clickedReg)
*clickedReg = UNKNOWN;
bool found_flag = false;
QMap<REGISTER_NAME,Register_Position>::const_iterator it = mRegisterPlaces.begin();
// iterate all registers that being displayed
@ -249,7 +250,8 @@ bool RegistersView::identifyRegister(const int line, const int offset, REGISTER_
)
{
// we found a matching register in the viewport
*clickedReg = (REGISTER_NAME)it.key();
if(clickedReg)
*clickedReg = (REGISTER_NAME)it.key();
found_flag = true;
break;
@ -284,6 +286,13 @@ void RegistersView::mouseDoubleClickEvent(QMouseEvent* event)
Q_UNUSED(event);
if(!DbgIsDebugging())
return;
// get mouse position
const int y = (event->y()-3)/(double)mRowHeight;
const int x = event->x()/(double)mCharWidth;
// do we find a corresponding register?
if(!identifyRegister(y,x,0))
return;
// is current register general purposes register ?
if(mGPR.contains(mSelected))
{