Issue #1461: Binary cell dump not visible - with no scrollbars

QHexEdit widget was being set disabled instead of read-only, according to
comments, because there wasn't any setReadOnly in qhexedit. At least in
the current version, the method actually exists, so it is now used.

This allows the user to move the scroll and select text in the binary mode
of the 'Edit Database Cell' dock.
This commit is contained in:
mgrojo
2018-07-08 01:41:15 +02:00
parent 6b78b13871
commit 8f1f55bf3d

View File

@@ -785,8 +785,7 @@ void EditDialog::setReadOnly(bool ro)
ui->editorText->setReadOnly(ro);
sciEdit->setReadOnly(ro);
// We disable the entire hex editor here instead of setting it to read only because it doesn't have a setReadOnly() method
ui->editorBinary->setEnabled(!ro);
hexEdit->setReadOnly(ro);
// This makes the caret being visible for selection, although the editor is read-only.
Qt::TextInteractionFlags textFlags = ro? Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard : Qt::TextEditorInteraction;