summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2021-10-17 19:20:09 +0200
committerStanislaw Halik <sthalik@misaki.pl>2021-10-17 19:21:54 +0200
commit63a43fb7903b26f3d8bde5e32b38af9621994ff9 (patch)
tree07576073616da1323bbb4854620d96d7fdc39d23
parent53f16e314c38700439b5cf58b285b1ea27c4ed53 (diff)
opentrack, spline-widget: drop old Qt workarounds
-rw-r--r--gui/init.cpp2
-rw-r--r--spline/spline-widget.cpp12
2 files changed, 0 insertions, 14 deletions
diff --git a/gui/init.cpp b/gui/init.cpp
index 2b7b01ad..a67bb75a 100644
--- a/gui/init.cpp
+++ b/gui/init.cpp
@@ -296,9 +296,7 @@ int otr_main(int argc, char** argv, std::function<std::unique_ptr<QWidget>()> co
#endif
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
-#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
-#endif
QApplication app(argc, argv);
diff --git a/spline/spline-widget.cpp b/spline/spline-widget.cpp
index 9df9b3be..514bbf7b 100644
--- a/spline/spline-widget.cpp
+++ b/spline/spline-widget.cpp
@@ -80,10 +80,6 @@ bool spline_widget::is_preview_only() const
return preview_only;
}
-#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
-# define OTR_OBSOLETE_QT_WORKAROUND
-#endif
-
void spline_widget::drawBackground()
{
QPainter painter(&background_img);
@@ -114,11 +110,7 @@ void spline_widget::drawBackground()
const double maxx = config->max_input();
const double maxy = config->max_output();
-#ifndef OTR_OBSOLETE_QT_WORKAROUND
double space_width = metrics.horizontalAdvance(' ');
-#else
- double space_width = metrics.averageCharWidth();
-#endif
painter.setPen(palette().text().color());
@@ -153,11 +145,7 @@ void spline_widget::drawBackground()
const QString text = QString::number(i);
QRectF rect = metrics.boundingRect(text);
-#ifndef OTR_OBSOLETE_QT_WORKAROUND
double advance = metrics.horizontalAdvance(text);
-#else
- double advance = rect.right();
-#endif
painter.drawText(QPointF(x - advance/2 - rect.left(),
pixel_bounds.bottom() + metrics.lineSpacing()),