1
0
Fork 0

GUI: fixed a bug in QHexEdit

This commit is contained in:
Mr. eXoDia 2014-07-05 16:34:16 +02:00
parent afdb87a884
commit 7631be5a66
1 changed files with 7 additions and 2 deletions

View File

@ -618,6 +618,8 @@ void QHexEditPrivate::keyPressEvent(QKeyEvent *event)
for (int idx = getSelectionBegin(); idx < getSelectionEnd(); idx++)
{
QString byte = _xData.data().mid(idx, 1).toHex();
if(!byte.length())
break;
QString mask = _xMask.data().mid(idx, 1).toHex();
if(mask[0] == '1')
result += "?";
@ -630,8 +632,11 @@ void QHexEditPrivate::keyPressEvent(QKeyEvent *event)
result += " ";
}
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(result.toUpper().trimmed());
QApplication::beep();
if(result.length())
{
clipboard->setText(result.toUpper().trimmed());
QApplication::beep();
}
}
// Switch between insert/overwrite mode