From c0ea2d4c1413b522a4f55b6f6abbf1a97d32d4d6 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Mon, 13 Aug 2018 23:43:46 +0200 Subject: [PATCH] Style: double instead of qreal --- src/blackgui/guiapplication.cpp | 10 +++++----- src/blackgui/guiapplication.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/blackgui/guiapplication.cpp b/src/blackgui/guiapplication.cpp index 856606970..18b88e10b 100644 --- a/src/blackgui/guiapplication.cpp +++ b/src/blackgui/guiapplication.cpp @@ -260,7 +260,7 @@ namespace BlackGui CApplication::exit(retcode); } - void CGuiApplication::highDpiScreenSupport(qreal scaleFactor) + void CGuiApplication::highDpiScreenSupport(double scaleFactor) { if (scaleFactor < 0) { @@ -318,8 +318,8 @@ namespace BlackGui { // setMinimumSizeInCharacters sets m_minHeightChars/m_minWidthChars QSize cs = mw->size(); - if (m_minWidthChars > 0) { cs.setWidth(fontMetricEstSize.width()); } - if (m_minHeightChars > 0) { cs.setHeight(fontMetricEstSize.height()); } + if (m_minWidthChars > 0) { cs.setWidth(qRound(fontMetricEstSize.width())); } + if (m_minHeightChars > 0) { cs.setHeight(qRound(fontMetricEstSize.height())); } mw->resize(cs); } } @@ -381,7 +381,7 @@ namespace BlackGui return html; } - qreal CGuiApplication::parseScaleFactor(int argc, char *argv[]) + double CGuiApplication::parseScaleFactor(int argc, char *argv[]) { for (int i = 1; i < argc; ++i) { @@ -390,7 +390,7 @@ namespace BlackGui if (i + 1 >= argc) { return -1.0; } // no value const QString factor(argv[i + 1]); bool ok; - qreal f = factor.toFloat(&ok); + const double f = factor.toDouble(&ok); return ok ? f : -1.0; } } diff --git a/src/blackgui/guiapplication.h b/src/blackgui/guiapplication.h index 428815b69..b1aa74b30 100644 --- a/src/blackgui/guiapplication.h +++ b/src/blackgui/guiapplication.h @@ -236,13 +236,13 @@ namespace BlackGui //! Support for high DPI screens //! \note Needs to be at the beginning of main - static void highDpiScreenSupport(qreal scaleFactor = -1); + static void highDpiScreenSupport(double scaleFactor = -1); //! Uses the high DPI support? static bool isUsingHighDpiScreenSupport(); //! Parse scale factor if any - static qreal parseScaleFactor(int argc, char *argv[]); + static double parseScaleFactor(int argc, char *argv[]); signals: //! Style sheet changed