File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1270,9 +1270,9 @@ void Fhex::on_menu_open_text_viewer_click() {
12701270 newWindow->setWindowTitle (" Fhex - Text Viewer" );
12711271 QTextEdit *textEdit = new QTextEdit (newWindow);
12721272 textEdit->setStyleSheet (" QTextEdit { background-color: #17120f; color: #ebe5e1; font-size: 16px; }" );
1273- textEdit-> setText ( QByteArray::fromHex ( this ->qhex ->selectedData (). replace ( " 00 " , " 0a " ). toUtf8 ()) );
1274- if (textEdit-> toPlainText () == " " )
1275- textEdit->setText (this -> qhex -> data ());
1273+ pair<qint64,qint64> offsets = this ->qhex ->selectedOffsets ( );
1274+ string content = this -> hexEditor -> getCurrentDataAsString (offsets. first , offsets. second - offsets. first );
1275+ textEdit->setText (content. c_str ());
12761276 newWindow->setMinimumWidth (this ->width ());
12771277 newWindow->setMinimumHeight (this ->height ());
12781278 newWindow->setCentralWidget (textEdit);
You can’t perform that action at this time.
0 commit comments