summarylogtreecommitdiffstats
path: root/qt5.patch
blob: 565ed403e830e108c31f4cf5772aabbae8d85896 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
diff -urN tutka-1.1.3.orig/src/conversion.cpp tutka-1.1.3/src/conversion.cpp
--- tutka-1.1.3.orig/src/conversion.cpp	2019-08-05 21:00:43.000000000 +0200
+++ tutka-1.1.3/src/conversion.cpp	2021-11-18 19:34:12.734312150 +0100
@@ -521,7 +521,7 @@
     mmd->expdata->exp_smp = (struct InstrExt *)calloc(mmd->expdata->s_ext_entries, sizeof(struct InstrExt));
     mmd->expdata->iinfo = (struct MMDInstrInfo *)calloc(mmd->expdata->i_ext_entries, sizeof(struct MMDInstrInfo));
     for (int instrument = 0; instrument < mmd->song->numsamples; instrument++) {
-        strncpy((char *)mmd->expdata->iinfo[instrument].name, song->instrument(instrument)->name().toLatin1().constData(), 40);
+        strncpy((char *)mmd->expdata->iinfo[instrument].name, song->instrument(instrument)->name().toLatin1().constData(), 39);
         mmd->expdata->iinfo[instrument].name[39] = 0;
         mmd->expdata->exp_smp[instrument].hold = song->instrument(instrument)->hold();
         mmd->song->sample[instrument].midich = song->instrument(instrument)->midiChannel() + 1;
@@ -550,7 +550,7 @@
             dumps[message]->data = (unsigned char *)calloc(dumps[message]->length, sizeof(unsigned char));
             memcpy(dumps[message]->data, song->message(message)->data().constData(), dumps[message]->length);
             if (!song->message(message)->name().isNull()) {
-                strncpy((char *)dumps[message]->name, song->message(message)->name().toLatin1().constData(), 20);
+                strncpy((char *)dumps[message]->name, song->message(message)->name().toLatin1().constData(), 19);
                 dumps[message]->name[19] = 0;
                 dumps[message]->ext_len = strlen((const char *)dumps[message]->name);
             }
diff -urN tutka-1.1.3.orig/src/mainwindow.cpp tutka-1.1.3/src/mainwindow.cpp
--- tutka-1.1.3.orig/src/mainwindow.cpp	2019-08-05 21:00:43.000000000 +0200
+++ tutka-1.1.3/src/mainwindow.cpp	2021-11-18 19:33:35.674310454 +0100
@@ -31,6 +31,7 @@
 #include <QTimer>
 #include <QScrollBar>
 #include <QDesktopWidget>
+#include <QScreen>
 #include "instrumentpropertiesdialog.h"
 #include "preferencesdialog.h"
 #include "trackvolumesdialog.h"
@@ -212,7 +213,7 @@
     connect(playingSequenceListDialog, SIGNAL(playingSequenceSelected(int)), player, SLOT(setPlayseq(int)));
     connect(sectionListDialog, SIGNAL(sectionSelected(int)), player, SLOT(setSection(int)));
 
-    setGeometryFromString(this, settings.value("Windows/mainWindowGeometry", rectToString(qApp->desktop()->availableGeometry())).toString());
+    setGeometryFromString(this, settings.value("Windows/mainWindowGeometry", rectToString(QGuiApplication::primaryScreen()->availableGeometry())).toString());
     setGeometryFromString(instrumentPropertiesDialog, settings.value("Windows/instrumentPropertiesDialogGeometry").toString());
     setGeometryFromString(openDialog, settings.value("Windows/openDialogGeometry").toString());
     setGeometryFromString(preferencesDialog, settings.value("Windows/preferencesDialogGeometry").toString());
@@ -294,9 +295,9 @@
 
 void MainWindow::wheelEvent(QWheelEvent *event)
 {
-    if (event->delta() > 0) {
+    if (event->angleDelta().y() > 0) {
         player->setLine(player->line() - 4);
-    } else if (event->delta() < 0) {
+    } else if (event->angleDelta().y() < 0) {
         player->setLine(player->line() + 4);
     }
 }
@@ -1016,7 +1017,7 @@
         if (rect.isValid()) {
             widget->setGeometry(rect);
         } else {
-            QRect mainRect = qApp->desktop()->availableGeometry();
+            QRect mainRect = QGuiApplication::primaryScreen()->availableGeometry();
             QRect widgetRect = widget->geometry();
             widget->setGeometry(mainRect.x() + (mainRect.width() - widgetRect.width()) / 2, mainRect.y() + (mainRect.height() - widgetRect.height()) / 2, widgetRect.width(), widgetRect.height());
         }
diff -urN tutka-1.1.3.orig/src/tracker.cpp tutka-1.1.3/src/tracker.cpp
--- tutka-1.1.3.orig/src/tracker.cpp	2019-08-05 21:00:43.000000000 +0200
+++ tutka-1.1.3/src/tracker.cpp	2021-11-18 19:33:35.674310454 +0100
@@ -75,7 +75,6 @@
     translucentWhenNotFocused(false)
 {
     font.setStyleHint(QFont::TypeWriter);
-    font.setStyleStrategy(QFont::ForceIntegerMetrics);
     calculateFontSize();
     initColors();
 
@@ -721,7 +720,7 @@
 void Tracker::calculateFontSize()
 {
     QFontMetrics metrics(font);
-    fontWidth = metrics.width('0');
+    fontWidth = metrics.horizontalAdvance('0');
     fontHeight = metrics.ascent() + 1;
     fontAscent = metrics.ascent();
 }