Commit ef04f982 authored by Calvin Buckley's avatar Calvin Buckley 🤔 Committed by Albert Astals Cid

Use fixed font for source and instruction views

Code is traditionally viewed in fixed font, so the proportional font
used by default can be confusing.
parent 6c8fc813
......@@ -22,6 +22,7 @@
#include "instritem.h"
#include <QFontDatabase>
#include <QPixmap>
#include <QPainter>
#include <QPolygon>
......@@ -87,6 +88,12 @@ InstrItem::InstrItem(InstrView* iv, QTreeWidget* parent,
if (instr && (l = instr->line()))
setText(7, l->name());
QFont font = QFontDatabase::systemFont(QFontDatabase::FixedFont);
setFont(0, font); // #
setFont(4, font); // hex
setFont(5, font); // mnenomic
setFont(6, font); // instruction args
updateGroup();
updateCost();
}
......
......@@ -22,6 +22,7 @@
#include "sourceitem.h"
#include <QFontDatabase>
#include <QPixmap>
#include <QRegExp>
#include <QPainter>
......@@ -65,6 +66,9 @@ SourceItem::SourceItem(SourceView* sv, QTreeWidget* parent,
QString s = src;
setText(4, s.replace( QRegExp(QStringLiteral("\t")), QStringLiteral(" ") ));
QFont font = QFontDatabase::systemFont(QFontDatabase::FixedFont);
setFont(4, font); // the source code line
// to allow text selection after double click
setFlags(flags() | Qt::ItemIsEditable);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment