-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use QTextLayout for resultsdisassemblypage
This patch replaces the usage of QTextDocument in the sourcecode and disassembly view. QTextDocument is way to overkill for that job. This patch also includes an highlighter based on ansi codes, which can be used instead of KSyntaxHighlighting for objdump (if supported).
- Loading branch information
Showing
16 changed files
with
608 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
SPDX-FileCopyrightText: Lieven Hey <lieven.hey@kdab.com> | ||
SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com | ||
SPDX-License-Identifier: GPL-2.0-or-later | ||
*/ | ||
|
||
#include "formattingutils.h" | ||
|
||
QString utils::removeAnsi(const QString& stringWithAnsi) | ||
{ | ||
const static QChar escapeChar = QLatin1Char('\u001B'); | ||
if (!stringWithAnsi.contains(escapeChar)) { | ||
return stringWithAnsi; | ||
} | ||
|
||
QString ansiFreeString = stringWithAnsi; | ||
while (ansiFreeString.contains(escapeChar)) { | ||
const auto escapeStart = ansiFreeString.indexOf(escapeChar); | ||
const auto escapeEnd = ansiFreeString.indexOf(QLatin1Char('m'), escapeStart); | ||
ansiFreeString.remove(escapeStart, escapeEnd - escapeStart + 1); | ||
} | ||
return ansiFreeString; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
SPDX-FileCopyrightText: Lieven Hey <lieven.hey@kdab.com> | ||
SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com | ||
SPDX-License-Identifier: GPL-2.0-or-later | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <QString> | ||
|
||
namespace utils { | ||
QString removeAnsi(const QString& stringWithAnsi); | ||
} |
Oops, something went wrong.