From 2b65bbcea2bfb958b4c753bea3c40277610077ef Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Thu, 12 Jun 2014 18:53:53 +0200 Subject: [PATCH] EditDialog: Fix text editor when NULL chars are typed in hex editor When using the hex editor widget of the Edit Dialog to insert a NULL character and then changing to the text editor without saving and reopening the window first lead to the text being truncated at the NULL character. --- src/EditDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EditDialog.cpp b/src/EditDialog.cpp index 08befa2e..045f14c4 100644 --- a/src/EditDialog.cpp +++ b/src/EditDialog.cpp @@ -139,7 +139,7 @@ void EditDialog::editTextChanged() void EditDialog::hexDataChanged() { // Update the text editor accordingly - ui->editorText->setPlainText(hexEdit->data()); + ui->editorText->setPlainText(QString::fromUtf8(hexEdit->data().constData(), hexEdit->data().size())); } void EditDialog::checkDataType()