Skip to content

Commit 42a2b85

Browse files
committed
qt: replaced unprintable characters with dots
1 parent ca54218 commit 42a2b85

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

qt/buffer_table_model.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ int BufferTableModel::columnCount(const QModelIndex & /*parent*/) const
2525
QVariant BufferTableModel::data(const QModelIndex &index, int role) const
2626
{
2727
QString hexString;
28+
QChar decodedChar;
2829
uint32_t start, end;
2930

3031
if (role == Qt::DisplayRole)
@@ -50,7 +51,12 @@ QVariant BufferTableModel::data(const QModelIndex &index, int role) const
5051
end = start + ROW_DATA_SIZE;
5152

5253
for (uint32_t i = start; i < end && i < bufSize; i++)
53-
hexString.append(QString("%1 ").arg(QChar(buf[i])));
54+
{
55+
decodedChar = QChar(buf[i]);
56+
if (!decodedChar.isPrint())
57+
decodedChar = QChar('.');
58+
hexString.append(decodedChar);
59+
}
5460
return hexString;
5561
}
5662
}

0 commit comments

Comments
 (0)