summaryrefslogtreecommitdiff
blob: ae87b047507fd00724193c28d4d0468e760d0d6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 90ebe8e37b8699ef26c10fb2928cf673cad04a06 Mon Sep 17 00:00:00 2001
From: Laurent Montel <montel@kde.org>
Date: Wed, 18 Sep 2019 06:41:34 +0200
Subject: Make it compiles without deprecated method

---
 klineal.cpp | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/klineal.cpp b/klineal.cpp
index 8b5d3c3..0f9bc48 100644
--- a/klineal.cpp
+++ b/klineal.cpp
@@ -705,7 +705,7 @@ void KLineal::mouseReleaseEvent( QMouseEvent *inEvent )
 
 void KLineal::wheelEvent( QWheelEvent *e )
 {
-  int numDegrees = e->delta() / 8;
+  int numDegrees = e->angleDelta().y() / 8;
   int numSteps = numDegrees / 15;
 
   // changing offset
@@ -756,8 +756,7 @@ void KLineal::drawScale( QPainter &painter )
       }
 
       if ( digit % 100 == 0 && digit != 0 ) {
-        QString units;
-        units.sprintf( "%d", digit );
+        QString units = QStringLiteral("%1").arg(digit);
         drawScaleText( painter, x, units );
       }
 
@@ -771,9 +770,8 @@ void KLineal::drawScale( QPainter &painter )
       int x = (int)( i * step );
 
       if ( i % 10 == 0 && i != 0 && i != 100 ) {
-        QString units;
         int value = mLeftToRight ? i : ( 100 - i );
-        units.sprintf( "%d%%", value );
+        const QString units = QString::asprintf( "%d%%", value );
         drawScaleText( painter, x, units );
         len = MEDIUM2_TICK_SIZE;
       } else {
-- 
cgit v1.1