[skip ci] make font fixed for Qt below than 5.2
This commit is contained in:
parent
af86e70f4b
commit
23245a3324
1 changed files with 5 additions and 0 deletions
|
@ -70,6 +70,11 @@ JsonEditorDialog::JsonEditorDialog(SnapmaticPicture *picture, QWidget *parent) :
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050200
|
#if QT_VERSION >= 0x050200
|
||||||
ui->txtJSON->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
|
ui->txtJSON->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
|
||||||
|
#else
|
||||||
|
QFont jsonFont = ui->txtJSON->font();
|
||||||
|
jsonFont.setStyleHint(QFont::Monospace);
|
||||||
|
jsonFont.setFixedPitch(true);
|
||||||
|
ui->txtJSON->setFont(jsonFont);
|
||||||
#endif
|
#endif
|
||||||
QFontMetrics fontMetrics(ui->txtJSON->font());
|
QFontMetrics fontMetrics(ui->txtJSON->font());
|
||||||
ui->txtJSON->setTabStopWidth(fontMetrics.width(" "));
|
ui->txtJSON->setTabStopWidth(fontMetrics.width(" "));
|
||||||
|
|
Loading…
Reference in a new issue