summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp
diff options
context:
space:
mode:
authorTilka <tilkax@gmail.com>2020-06-14 12:10:33 +0100
committerGitHub <noreply@github.com>2020-06-14 12:10:33 +0100
commitcb54fc754383a7e16dc3c2fe83d921d90d6d6c9a (patch)
tree85fbc755273ec64ff1b881893bbcd45ddefd10b4 /Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp
parentd9e05559c9d213c12d1b1fd27832e01565883dd3 (diff)
parent87330ae524dfabf323ff66aed599ea65deeb6950 (diff)
Merge pull request #8857 from JosJuice/qt-bounding-box-width
DolphinQt: Use QFontMetrics::boundingRect instead of QFontMetrics::width
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp')
-rw-r--r--Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp
index 64aab73740..1b0224f0c4 100644
--- a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp
@@ -31,7 +31,6 @@
#include "Core/PowerPC/PowerPC.h"
#include "DolphinQt/Debugger/PatchInstructionDialog.h"
#include "DolphinQt/Host.h"
-#include "DolphinQt/QtUtils/FontMetricsHelper.h"
#include "DolphinQt/Resources.h"
#include "DolphinQt/Settings.h"
@@ -201,7 +200,7 @@ void CodeViewWidget::FontBasedSizing()
horizontalHeader()->setMinimumSectionSize(rowh + 5);
setColumnWidth(CODE_VIEW_COLUMN_BREAKPOINT, rowh + 5);
setColumnWidth(CODE_VIEW_COLUMN_ADDRESS,
- FontMetricsWidth(fm, QStringLiteral("80000000")) + extra_text_width);
+ fm.boundingRect(QStringLiteral("80000000")).width() + extra_text_width);
// The longest instruction is technically 'ps_merge00' (0x10000420u), but those instructions are
// very rare and would needlessly increase the column size, so let's go with 'rlwinm.' instead.
@@ -213,11 +212,11 @@ void CodeViewWidget::FontBasedSizing()
const std::string ins = (split == std::string::npos ? disas : disas.substr(0, split));
const std::string param = (split == std::string::npos ? "" : disas.substr(split + 1));
setColumnWidth(CODE_VIEW_COLUMN_INSTRUCTION,
- FontMetricsWidth(fm, QString::fromStdString(ins)) + extra_text_width);
+ fm.boundingRect(QString::fromStdString(ins)).width() + extra_text_width);
setColumnWidth(CODE_VIEW_COLUMN_PARAMETERS,
- FontMetricsWidth(fm, QString::fromStdString(param)) + extra_text_width);
+ fm.boundingRect(QString::fromStdString(param)).width() + extra_text_width);
setColumnWidth(CODE_VIEW_COLUMN_DESCRIPTION,
- FontMetricsWidth(fm, QStringLiteral("0")) * 25 + extra_text_width);
+ fm.boundingRect(QChar(u'0')).width() * 25 + extra_text_width);
Update();
}