Skip to content

Commit dc8ba36

Browse files
committed
Modify monospaced font
1 parent 691b7d8 commit dc8ba36

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

App/Main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ int main(int argc, char *argv[])
9494
#endif
9595

9696
#ifdef RABBITCOMMON
97-
if(pUpdater)
98-
delete pUpdater;
9997
RabbitCommon::CTools::Instance()->Clean();
10098
#endif
10199
#if defined (_DEBUG)

App/MainWindow.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,20 @@ CMainWindow::CMainWindow(QWidget *parent) :
128128
InitPinout();
129129

130130
// Add fixed font. See: https://github.com/KangLin/SerialPortAssistant/issues/26
131+
QFont receiverFont = ui->teReceive->font();
131132
QFont fixedFont = QFontDatabase::systemFont(QFontDatabase::FixedFont);
132133
//qDebug(log) << "fixedFont:" << fixedFont;
133134
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
134-
if(QFontDatabase::isFixedPitch(fixedFont.family(), fixedFont.styleName()))
135+
if(!QFontDatabase::isFixedPitch(receiverFont.family(), receiverFont.styleName())
136+
&& QFontDatabase::isFixedPitch(fixedFont.family(), fixedFont.styleName()))
135137
#else
136138
QFontDatabase fd;
137-
if(fd.isFixedPitch(fixedFont.family(), fixedFont.styleName()))
139+
if(!fd.isFixedPitch(receiverFont.family(), receiverFont.styleName())
140+
&& fd.isFixedPitch(fixedFont.family(), fixedFont.styleName()))
138141
#endif
139142
{
140143
ui->teReceive->setFont(fixedFont);
144+
ui->teSend->setFont(fixedFont);
141145
}
142146

143147
#ifdef HAVE_RABBITCOMMON_GUI

0 commit comments

Comments
 (0)