Package: lomiri-ui-toolkit / 1.3.5010+dfsg-1

0002-fix-tests-on-qt-5.15.5.patch Patch series | download
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
From c087cacc295666aa79e77c3ca339979df22f6a36 Mon Sep 17 00:00:00 2001
From: Sergey Chupligin <neochapay@gmail.com>
Date: Wed, 20 Jul 2022 18:19:22 +0300
Subject: [PATCH] Fix build warnings and build failure on Debian

---
 apicheck/apicheck.cpp                         |  8 ++-
 src/LomiriGestures/touchregistry.cpp          | 21 ++++++-
 src/LomiriMetrics/logger.cpp                  | 56 ++++++++++++++++---
 .../adapters/alarmsadapter_organizer.cpp      |  4 ++
 src/LomiriToolkit/exclusivegroup.cpp          |  4 ++
 src/LomiriToolkit/i18n.cpp                    |  4 ++
 src/LomiriToolkit/lomirithemeiconprovider.cpp |  4 ++
 src/LomiriToolkit/lomiritoolkitmodule.cpp     | 43 ++++++++++++++
 src/LomiriToolkit/mousetouchadaptor_x11.cpp   |  4 ++
 src/LomiriToolkit/ucarguments.cpp             | 33 +++++++++--
 src/LomiriToolkit/ucqquickimageextension.cpp  | 21 ++++++-
 src/LomiriToolkit/ucstatesaver.cpp            |  4 ++
 src/LomiriToolkit/uctheme.cpp                 | 16 ++++++
 .../PerformanceMetrics/plugin/upmplugin.cpp   |  4 ++
 tests/api/Extinct/Animals/plugin/plugin.cpp   |  4 ++
 tests/unit/arguments/tst_arguments.cpp        |  5 ++
 .../tst_qquick_image_extension.cpp            | 49 +++++++++++++---
 tests/unit/statesaver/tst_statesaver.cpp      | 12 ++++
 .../unit/touchregistry/tst_TouchRegistry.cpp  | 50 +++++++++++++++++
 19 files changed, 321 insertions(+), 25 deletions(-)

--- a/apicheck/apicheck.cpp
+++ b/apicheck/apicheck.cpp
@@ -877,7 +877,11 @@
         QString pluginImportVersion;
         QStringList pathList((QString(getenv("QML2_IMPORT_PATH"))
                               + ":" + QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath))
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
                              .split(':', QString::SkipEmptyParts));
+#else
+                             .split(':', Qt::SkipEmptyParts));
+#endif
 
         QFile qmlDirFile;
         QString pluginModulePath;
@@ -964,7 +968,7 @@
         Q_FOREACH(const QString& version, importVersions) {
             // First letter must be uppercase
             QString pluginAlias(QString("A%1.%2").arg(pluginImportUri).arg(version).replace(".", "_"));
-            code += QString("import %1 %2 as %3\n").arg(pluginImportUri).arg(version).arg(pluginAlias);
+            code += QString("import %1 %2 as %3\n").arg(pluginImportUri).arg(version).arg(pluginAlias).toUtf8();
         }
         code += "QtObject { }\n";
         if (verbose)
@@ -986,7 +990,7 @@
                     // First letter must be uppercase
                     QString pluginAlias(QString("A%1.%2").arg(pluginImportUri).replace(".", "_"));
                     // 1.0 should work if 0.1 didn't and qmldir didn't specify
-                    code += QString("import %1 1.0 as %3\n").arg(pluginImportUri).arg(pluginAlias);
+                    code += QString("import %1 1.0 as %3\n").arg(pluginImportUri).arg(pluginAlias).toUtf8();
                     c.setData(code, QUrl::fromLocalFile(qmlDirFile.fileName()));
                     std::cerr << "Re-creating QML component for " << qPrintable(pluginImportUri) << std::endl;
                     c.create();
--- a/src/LomiriGestures/touchregistry.cpp
+++ b/src/LomiriGestures/touchregistry.cpp
@@ -164,7 +164,11 @@
 void TouchRegistry::dispatchPointsToItem(const QTouchEvent *event, const QList<int> &touchIds,
         QQuickItem *item)
 {
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     Qt::TouchPointStates touchPointStates = 0;
+#else
+    Qt::TouchPointStates touchPointStates;
+#endif
     QList<QTouchEvent::TouchPoint> touchPoints;
 
     const QList<QTouchEvent::TouchPoint> &allTouchPoints = event->touchPoints();
@@ -176,11 +180,18 @@
         const QTouchEvent::TouchPoint &originalTouchPoint = allTouchPoints[i];
         if (touchIds.contains(originalTouchPoint.id())) {
             QTouchEvent::TouchPoint touchPoint = originalTouchPoint;
-
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+            touchPoint.setRect(windowToCandidateTransform.mapRect(touchPoint.sceneRect()));
+#else
             translateTouchPointFromScreenToWindowCoords(touchPoint);
+#endif
 
             // Set the point's local coordinates to that of the item
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
             touchPoint.setRect(windowToCandidateTransform.mapRect(touchPoint.sceneRect()));
+#else
+            touchPoint.setPos(windowToCandidateTransform.map(touchPoint.scenePos()));
+#endif
             touchPoint.setStartPos(windowToCandidateTransform.map(touchPoint.startScenePos()));
             touchPoint.setLastPos(windowToCandidateTransform.map(touchPoint.lastScenePos()));
             touchPoint.setVelocity(windowToCandidateMatrix.mapVector(touchPoint.velocity()).toVector2D());
@@ -209,11 +220,19 @@
 
 void TouchRegistry::translateTouchPointFromScreenToWindowCoords(QTouchEvent::TouchPoint &touchPoint)
 {
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     touchPoint.setScreenRect(touchPoint.sceneRect());
+#else
+    touchPoint.setScreenPos(touchPoint.scenePos());
+#endif
     touchPoint.setStartScreenPos(touchPoint.startScenePos());
     touchPoint.setLastScreenPos(touchPoint.lastScenePos());
 
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     touchPoint.setSceneRect(touchPoint.rect());
+#else
+    touchPoint.setScenePos(touchPoint.pos());
+#endif
     touchPoint.setStartScenePos(touchPoint.startPos());
     touchPoint.setLastScenePos(touchPoint.lastPos());
 }
--- a/src/LomiriMetrics/logger.cpp
+++ b/src/LomiriMetrics/logger.cpp
@@ -127,7 +127,12 @@
                     << event.process.cpuUsage << ' '
                     << event.process.vszMemory << ' '
                     << event.process.rssMemory << ' '
-                    << event.process.threadCount << '\n' << flush;
+                    << event.process.threadCount << '\n'
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                    << flush;
+#else
+                    << Qt::flush;
+#endif
             } else {
                 m_textStream
                     << (m_flags & Colored ? "\033[33mP\033[00m " : "P ")
@@ -136,7 +141,12 @@
                     << "VSZ" << dimColon << event.process.vszMemory << "kB "
                     << "RSS" << dimColon << event.process.rssMemory << "kB "
                     << "Threads" << dimColon << event.process.threadCount
-                    << '\n' << flush;
+                    << '\n'
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                    << flush;
+#else
+                    << Qt::flush;
+#endif
             }
             break;
         }
@@ -152,7 +162,12 @@
                     << event.frame.syncTime << ' '
                     << event.frame.renderTime << ' '
                     << event.frame.gpuTime << ' '
-                    << event.frame.swapTime << '\n' << flush;
+                    << event.frame.swapTime << '\n'
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                    << flush;
+#else
+                    << Qt::flush;
+#endif
             } else {
                 m_textStream
                     << (m_flags & Colored ? "\033[36mF\033[00m " : "F ")
@@ -163,7 +178,12 @@
                     << "Sync" << dimColon << event.frame.syncTime / 1000000.0f << "ms "
                     << "Render" << dimColon << event.frame.renderTime / 1000000.0f << "ms "
                     << "GPU" << dimColon << event.frame.gpuTime / 1000000.0f << "ms "
-                    << "Swap" << dimColon << event.frame.swapTime / 1000000.0f << "ms\n" << flush;
+                    << "Swap" << dimColon << event.frame.swapTime / 1000000.0f << "ms\n"
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                    << flush;
+#else
+                    << Qt::flush;
+#endif
             }
             break;
 
@@ -175,7 +195,12 @@
                     << event.window.id << ' '
                     << event.window.state << ' '
                     << event.window.width << ' '
-                    << event.window.height << '\n' << flush;
+                    << event.window.height << '\n'
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                    << flush;
+#else
+                    << Qt::flush;
+#endif
             } else {
                 const char* const stateString[] = { "Hidden", "Shown", "Resized" };
                 Q_STATIC_ASSERT(ARRAY_SIZE(stateString) == UMWindowEvent::StateCount);
@@ -185,7 +210,12 @@
                     << "Id" << dimColon << event.window.id << ' '
                     << "State" << dimColon << stateString[event.window.state] << ' '
                     << "Size" << dimColon << event.window.width << 'x' << event.window.height
-                    << '\n' << flush;
+                    << '\n'
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                    << flush;
+#else
+                    << Qt::flush;
+#endif
             }
             break;
         }
@@ -196,14 +226,24 @@
                     << "G "
                     << event.timeStamp << ' '
                     << event.generic.id << ' '
-                    << event.generic.string << '\n' << flush;
+                    << event.generic.string << '\n'
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                    << flush;
+#else
+                    << Qt::flush;
+#endif
             } else {
                 m_textStream
                     << (m_flags & Colored ? "\033[32mG\033[00m " : "G ")
                     << dim << timeString << reset << ' '
                     << "Id" << dimColon << event.generic.id << ' '
                     << "String" << dimColon << '"' << event.generic.string << '"'
-                    << '\n' << flush;
+                    << '\n'
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                    << flush;
+#else
+                    << Qt::flush;
+#endif
             }
             break;
         }
--- a/src/LomiriToolkit/adapters/alarmsadapter_organizer.cpp
+++ b/src/LomiriToolkit/adapters/alarmsadapter_organizer.cpp
@@ -339,7 +339,11 @@
 
 UCAlarm::DaysOfWeek AlarmDataAdapter::daysFromSet(const QSet<Qt::DayOfWeek> &set)
 {
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     UCAlarm::DaysOfWeek days = 0;
+#else
+    UCAlarm::DaysOfWeek days;
+#endif
     QSetIterator<Qt::DayOfWeek> i(set);
     while (i.hasNext()) {
         int day = static_cast<int>(i.next());
--- a/src/LomiriToolkit/exclusivegroup.cpp
+++ b/src/LomiriToolkit/exclusivegroup.cpp
@@ -71,7 +71,11 @@
 
     int index = m_signalMapper->metaObject()->indexOfMethod("map()");
     m_updateCurrentMethod = m_signalMapper->metaObject()->method(index);
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     connect(m_signalMapper, static_cast<void(QSignalMapper::*)(QObject *)>(&QSignalMapper::mapped), this, [this](QObject *object) {
+#else
+    connect(m_signalMapper, static_cast<void(QSignalMapper::*)(QObject *)>(&QSignalMapper::mappedObject), this, [this](QObject *object) {
+#endif
         if (isChecked(object)) {
             setCurrent(object);
         }
--- a/src/LomiriToolkit/i18n.cpp
+++ b/src/LomiriToolkit/i18n.cpp
@@ -359,7 +359,11 @@
                https://qt-project.org/doc/qt-5-snapshot/qdatetime.html#fromString-2 */
                 : dtr(lomiriUiToolkit, QStringLiteral("ddd d MMM'\u2003'HH:mm")));
     }
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     return datetime.toString(Qt::DefaultLocaleShortDate);
+#else
+    return datetime.toString(QLocale().dateFormat(QLocale::ShortFormat));
+#endif
 }
 
 UT_NAMESPACE_END
--- a/src/LomiriToolkit/lomirithemeiconprovider.cpp
+++ b/src/LomiriToolkit/lomirithemeiconprovider.cpp
@@ -299,7 +299,11 @@
     // The hicolor theme will be searched last as per
     // https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
     QSet<QString> alreadySearchedThemes;
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     const QStringList names = id.split(QLatin1Char(','), QString::SkipEmptyParts);
+#else
+    const QStringList names = id.split(QLatin1Char(','), Qt::SkipEmptyParts);
+#endif
     QImage image = getTheme()->findBestIcon(names, size, requestedSize, &alreadySearchedThemes);
 
     if (image.isNull()) {
--- a/src/LomiriToolkit/lomiritoolkitmodule.cpp
+++ b/src/LomiriToolkit/lomiritoolkitmodule.cpp
@@ -22,6 +22,9 @@
 #include <unistd.h>
 
 #include <stdexcept>
+#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
+#include <qqml.h>
+#endif
 
 #include <QtCore/QPointer>
 #include <QtQml/QQmlContext>
@@ -229,7 +232,11 @@
     qmlRegisterExtendedType<
         QQuickImageBase, UCQQuickImageExtension>(uri, major, minor, "QQuickImageBase");
     qmlRegisterUncreatableType<UCUnits>(uri, major, minor, "UCUnits", notInstantiatable);
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     if (uri == QLatin1String("Ubuntu.Components")) {
+#else
+    if (QLatin1String(uri) == QLatin1String("Ubuntu.Components")) {
+#endif
         // FIXME/DEPRECATED: Ubuntu.* is exported for backwards compatibility only
         qmlRegisterType<UCLomiriShape>(uri, major, minor, "UbuntuShape");
     } else {
@@ -248,11 +255,19 @@
     }
     qmlRegisterType<UCArguments>(uri, major, minor, "Arguments");
     qmlRegisterType<UCArgument>(uri, major, minor, "Argument");
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     qmlRegisterType<QQmlPropertyMap>();
+#else
+    qmlRegisterAnonymousType<QQmlPropertyMap>(uri, major);
+#endif
     qmlRegisterType<UCAlarm>(uri, major, minor, "Alarm");
     qmlRegisterType<UCAlarmModel>(uri, major, minor, "AlarmModel");
     qmlRegisterType<UCStateSaver>(uri, major, minor, "StateSaver");
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     qmlRegisterType<UCStateSaverAttached>();
+#else
+    qmlRegisterAnonymousType<UCStateSaverAttached>(uri, major);
+#endif
     qmlRegisterSimpleSingletonType<UCUriHandler>(uri, major, minor, "UriHandler");
     qmlRegisterType<UCMouse>(uri, major, minor, "Mouse");
     qmlRegisterType<UCInverseMouse>(uri, major, minor, "InverseMouse");
@@ -334,7 +349,11 @@
         QString::fromLocal8Bit(qgetenv("UC_METRICS_LOGGING_FILTER"));
     if (!metricsLoggingFilter.isNull()) {
         QStringList filterList =
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
             metricsLoggingFilter.split(QStringLiteral(","), QString::SkipEmptyParts);
+#else
+            metricsLoggingFilter.split(QStringLiteral(","), Qt::SkipEmptyParts);
+#endif
         UMApplicationMonitor::LoggingFilters filter = 0;
         const int size = filterList.size();
         for (int i = 0; i < size; ++i) {
@@ -403,14 +422,22 @@
 
     // register 1.2 only API
     qmlRegisterType<UCListItem>(uri, 1, 2, "ListItem");
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     qmlRegisterType<UCListItemDivider>();
+#else
+    qmlRegisterAnonymousType<UCListItemDivider>(uri, 1);
+#endif
     qmlRegisterUncreatableType<UCSwipeEvent>(
         uri, 1, 2, "SwipeEvent", QStringLiteral("This is an event object."));
     qmlRegisterUncreatableType<UCDragEvent>(
         uri, 1, 2, "ListItemDrag", QStringLiteral("This is an event object"));
     qmlRegisterType<UCListItemActions>(uri, 1, 2, "ListItemActions");
     qmlRegisterUncreatableType<UCViewItemsAttached>(uri, 1, 2, "ViewItems", notInstantiatable);
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     if (uri == QLatin1String("Ubuntu.Components")) {
+#else
+    if (QLatin1String(uri) == QLatin1String("Ubuntu.Components")) {
+#endif
         // FIXME/DEPRECATED: Ubuntu.* is exported for backwards compatibility only
         qmlRegisterType<UCLomiriShape, 1>(uri, 1, 2, "UbuntuShape");
         qmlRegisterType<UCLomiriShapeOverlay>(uri, 1, 2, "UbuntuShapeOverlay");
@@ -423,14 +450,22 @@
 
     // register 1.3 API
     qmlRegisterType<UCListItem, 1>(uri, 1, 3, "ListItem");
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     qmlRegisterType<UCListItemExpansion>();
+#else
+    qmlRegisterAnonymousType<UCListItemExpansion>(uri, 1);
+#endif
     qmlRegisterType<UCTheme>(uri, 1, 3, "ThemeSettings");
     qmlRegisterType<UCStyledItemBase, 2>(uri, 1, 3, "StyledItem");
     qmlRegisterType<UCStyledItemBase, 2>(uri, 1, 3, "StyledItem");
     qmlRegisterCustomType<UCStyleHints>(uri, 1, 3, "StyleHints", new UCStyleHintsParser);
     qmlRegisterType<UCAction, 1>(uri, 1, 3, "Action");
     qmlRegisterType<UCSlotsLayout>(uri, 1, 3, "SlotsLayout");
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     if (uri == QLatin1String("Ubuntu.Components")) {
+#else
+    if (QLatin1String(uri) == QLatin1String("Ubuntu.Components")) {
+#endif
         // FIXME/DEPRECATED: Ubuntu.* is exported for backwards compatibility only
         qmlRegisterType<UCLomiriShape, 2>(uri, 1, 3, "UbuntuShape");
         qmlRegisterSimpleSingletonType<UT_PREPEND_NAMESPACE(UCNamespaceV13)>(uri, 1, 3, "Ubuntu");
@@ -441,7 +476,11 @@
     qmlRegisterType<UCProportionalShape>(uri, 1, 3, "ProportionalShape");
     qmlRegisterType<LiveTimer>(uri, 1, 3, "LiveTimer");
     qmlRegisterType<UCAbstractButton>(uri, 1, 3, "AbstractButton");
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     qmlRegisterType<UCMargins>();
+#else
+    qmlRegisterAnonymousType<UCMargins>(uri, 1);
+#endif
     qmlRegisterUncreatableType<UCSlotsAttached>(uri, 1, 3, "SlotsAttached", notInstantiatable);
     qmlRegisterUncreatableType<UCSlotsLayoutPadding>(
         uri, 1, 3, "SlotsLayoutPadding", notInstantiatable);
@@ -458,7 +497,11 @@
     qmlRegisterType<ExclusiveGroup>(uri, 1, 3, "ExclusiveGroup");
 
 #   ifdef LOMIRI_UITK_WANT_UBUNTU_COMPAT
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     if (uri == QLatin1String("Ubuntu.Components")) {
+#else
+    if (QLatin1String(uri) == QLatin1String("Ubuntu.Components")) {
+#endif
         DeprecationPrinter::instance()->printDeprecation(
             DeprecationPrinter::COMPONENTS);
     }
--- a/src/LomiriToolkit/mousetouchadaptor_x11.cpp
+++ b/src/LomiriToolkit/mousetouchadaptor_x11.cpp
@@ -73,7 +73,11 @@
 {
     switch (detail) {
         case 1: return Qt::LeftButton;
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
         case 2: return Qt::MidButton;
+#else
+        case 2: return Qt::MiddleButton;
+#endif
         case 3: return Qt::RightButton;
         // Button values 4-7 are Wheel events
         default: return Qt::NoButton;
--- a/src/LomiriToolkit/ucarguments.cpp
+++ b/src/LomiriToolkit/ucarguments.cpp
@@ -208,15 +208,36 @@
     }
 
     // display what each argument is used for
-    usageStream << endl;
-    usageStream << i18n->tr("Options:") << endl;
+    usageStream
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+            << endl;
+#else
+            << Qt::endl;
+#endif
+    usageStream << i18n->tr("Options:")
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                << endl;
+#else
+                << Qt::endl;
+#endif
 
     Q_FOREACH (UCArgument* argument, m_arguments) {
-        usageStream << indentation << argument->usage() << endl;
+        usageStream << indentation << argument->usage()
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                    << endl;
+#else
+                    << Qt::endl;
+#endif
     }
 
     if (m_defaultArgument != NULL) {
-        usageStream << endl << m_defaultArgument->help();
+        usageStream
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+               << endl
+#else
+               << Qt::endl
+#endif
+               << m_defaultArgument->help();
     }
 
     return usage;
@@ -446,7 +467,11 @@
         if (rawArgument.startsWith('-')) {
             // it starts with a '-' therefore it is a named argument
             // remove all prepended '-'
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
             rawArgument = rawArgument.split('-', QString::SkipEmptyParts).join('-');
+#else
+            rawArgument = rawArgument.split('-', Qt::SkipEmptyParts).join('-');
+#endif
             // string after the '=' sign is a value for the argument
             values = rawArgument.split(QStringLiteral("="));
             name = values.takeAt(0);
--- a/src/LomiriToolkit/ucqquickimageextension.cpp
+++ b/src/LomiriToolkit/ucqquickimageextension.cpp
@@ -227,11 +227,26 @@
         while (!sciStream.atEnd()) {
             QString line = sciStream.readLine();
             if (line.startsWith(QStringLiteral("border"))) {
-                output << scaledBorder(line, scaleFactor) << endl;
+                output << scaledBorder(line, scaleFactor)
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                       << endl;
+#else
+                       << Qt::endl;
+#endif
             } else if (line.startsWith(QStringLiteral("source"))) {
-                output << scaledSource(line, sciFilePath, scaleFactor) << endl;
+                output << scaledSource(line, sciFilePath, scaleFactor)
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                                 << endl;
+#else
+                                 << Qt::endl;
+#endif
             } else {
-                output << line << endl;
+                output << line
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                                 << endl;
+#else
+                                 << Qt::endl;
+#endif
             }
         }
         return true;
--- a/src/LomiriToolkit/ucstatesaver.cpp
+++ b/src/LomiriToolkit/ucstatesaver.cpp
@@ -325,7 +325,11 @@
 }
 void UCStateSaverAttached::setProperties(const QString &list)
 {
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     QStringList propertyList = list.split(',', QString::SkipEmptyParts);
+#else
+    QStringList propertyList = list.split(',', Qt::SkipEmptyParts);
+#endif
     for (int i = 0; i < propertyList.count(); i++) {
         propertyList[i] = propertyList.at(i).trimmed();
     }
--- a/src/LomiriToolkit/uctheme.cpp
+++ b/src/LomiriToolkit/uctheme.cpp
@@ -168,13 +168,21 @@
 QStringList themeSearchPath()
 {
     QString envPath = QLatin1String(getenv("LOMIRI_UI_TOOLKIT_THEMES_PATH"));
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     QStringList pathList = envPath.split(':', QString::SkipEmptyParts);
+#else
+    QStringList pathList = envPath.split(':', Qt::SkipEmptyParts);
+#endif
     if (pathList.isEmpty()) {
         // get the default path list from generic data location, which contains
         // XDG_DATA_DIRS
         QString xdgDirs = QLatin1String(getenv("XDG_DATA_DIRS"));
         if (!xdgDirs.isEmpty()) {
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
             pathList << xdgDirs.split(':', QString::SkipEmptyParts);
+#else
+            pathList << xdgDirs.split(':', Qt::SkipEmptyParts);
+#endif
         }
         // ~/.local/share
         pathList << QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
@@ -183,9 +191,17 @@
     // append QML import path(s); we must explicitly support env override here
     const QString qml2ImportPath = QString::fromLocal8Bit(getenv("QML2_IMPORT_PATH"));
     if (!qml2ImportPath.isEmpty()) {
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
         pathList << qml2ImportPath.split(':', QString::SkipEmptyParts);
+#else
+        pathList << qml2ImportPath.split(':', Qt::SkipEmptyParts);
+#endif
     }
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     pathList << QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath).split(':', QString::SkipEmptyParts);
+#else
+    pathList << QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath).split(':', Qt::SkipEmptyParts);
+#endif
     // fix folders
     QStringList result;
     Q_FOREACH(const QString &path, pathList) {
--- a/src/imports/PerformanceMetrics/plugin/upmplugin.cpp
+++ b/src/imports/PerformanceMetrics/plugin/upmplugin.cpp
@@ -32,7 +32,11 @@
     qmlRegisterType<UPMRenderingTimes>(uri, major, minor, "RenderingTimes");
     qmlRegisterType<UPMCpuUsage>(uri, major, minor, "CpuUsage");
     qmlRegisterType<UPMTextureFromImage>(uri, major, minor, "TextureFromImage");
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     qmlRegisterType<UPMGraphModel>();
+#else
+    qmlRegisterAnonymousType<UPMGraphModel>(uri, major);
+#endif
 }
 
 void LomiriPerformanceMetricsPlugin::registerTypes(const char *uri)
--- a/tests/api/Extinct/Animals/plugin/plugin.cpp
+++ b/tests/api/Extinct/Animals/plugin/plugin.cpp
@@ -52,7 +52,11 @@
 {
     Q_ASSERT(uri == QLatin1String("Extinct.Animals"));
 
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     qmlRegisterType<EATarpan>();
+#else
+    qmlRegisterAnonymousType<EATarpan>(uri, 1);
+#endif
     qmlRegisterType<EASmilodon>(uri, 1, 0, "Smilodon");
     qmlRegisterType<EASmilodon>(uri, 0, 1, "ScimitarCat");
 
--- a/tests/unit/arguments/tst_arguments.cpp
+++ b/tests/unit/arguments/tst_arguments.cpp
@@ -58,7 +58,12 @@
 
     void setCommandLine(QString commandLine) {
         clearCommandLine();
+
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
         QStringList arguments = QString(commandLine).split(' ', QString::SkipEmptyParts);
+#else
+        QStringList arguments = QString(commandLine).split(' ', Qt::SkipEmptyParts);
+#endif
 
         Q_FOREACH (QString argument, arguments) {
             QByteArray text = argument.toLocal8Bit();
--- a/tests/unit/qquick_image_extension/tst_qquick_image_extension.cpp
+++ b/tests/unit/qquick_image_extension/tst_qquick_image_extension.cpp
@@ -102,13 +102,48 @@
 
         QString expected;
         QTextStream expectedStream(&expected);
-        expectedStream << "source: \"image://scaling/1/data/borderInName.png\"" << endl;
-        expectedStream << "border.left: 9" << endl;
-        expectedStream << "border.right: 2" << endl;
-        expectedStream << "border.top: 9" << endl;
-        expectedStream << "border.bottom: 0" << endl;
-        expectedStream << "horizontalTileMode: Stretch" << endl;
-        expectedStream << "verticalTileMode: Stretch" << endl;
+        expectedStream << "source: \"image://scaling/1/data/borderInName.png\""
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                       << endl;
+#else
+                       << Qt::endl;
+#endif
+        expectedStream << "border.left: 9"
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                       << endl;
+#else
+                       << Qt::endl;
+#endif
+        expectedStream << "border.right: 2"
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                       << endl;
+#else
+                       << Qt::endl;
+#endif
+        expectedStream << "border.top: 9"
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                         << endl;
+#else
+                         << Qt::endl;
+#endif
+        expectedStream << "border.bottom: 0"
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                         << endl;
+#else
+                         << Qt::endl;
+#endif
+        expectedStream << "horizontalTileMode: Stretch"
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                       << endl;
+#else
+                       << Qt::endl;
+#endif
+        expectedStream << "verticalTileMode: Stretch"
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+                       << endl;
+#else
+                       << Qt::endl;
+#endif
 
         QCOMPARE(result, expected);
     }
--- a/tests/unit/statesaver/tst_statesaver.cpp
+++ b/tests/unit/statesaver/tst_statesaver.cpp
@@ -614,15 +614,27 @@
         QTest::qWait(1000);
 
         // make sure we are not killing the parent
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
         QVERIFY(testApp.pid() != QCoreApplication::applicationPid());
+#else
+        QVERIFY(testApp.processId() != QCoreApplication::applicationPid());
+#endif
         // skip tests if the application PID is zero => the child app PID seems to be zero as well
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
         if (!testApp.pid()) {
+#else
+        if (!testApp.processId()) {
+#endif
             // kill child process
             testApp.close();
             QSKIP("This test requires valid PID");
         }
         // send SIGINT
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
         ::kill(testApp.pid(), SIGINT);
+#else
+        ::kill(testApp.processId(), SIGINT);
+#endif
         testApp.waitForFinished();
 
         QString fileName = stateFile("SimpleApp");
--- a/tests/unit/touchregistry/tst_TouchRegistry.cpp
+++ b/tests/unit/touchregistry/tst_TouchRegistry.cpp
@@ -200,7 +200,11 @@
         QList<QTouchEvent::TouchPoint> touchPoints;
         touchPoints.append(QTouchEvent::TouchPoint(0));
         touchPoints[0].setState(Qt::TouchPointPressed);
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
         touchPoints[0].setRect(QRect(10, 10, 0, 0));
+#else
+        touchPoints[0].setPos(QPoint(10, 10));
+#endif
         QTouchEvent touchEvent(QEvent::TouchBegin,
                                0 /* device */,
                                Qt::NoModifier,
@@ -215,10 +219,18 @@
         QList<QTouchEvent::TouchPoint> touchPoints;
         touchPoints.append(QTouchEvent::TouchPoint(0));
         touchPoints[0].setState(Qt::TouchPointMoved);
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
         touchPoints[0].setRect(QRect(11, 11, 0, 0));
+#else
+        touchPoints[0].setPos(QPoint(11, 11));
+#endif
         touchPoints.append(QTouchEvent::TouchPoint(1));
         touchPoints[1].setState(Qt::TouchPointPressed);
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
         touchPoints[1].setRect(QRect(20, 20, 0, 0));
+#else
+        touchPoints[1].setPos(QPoint(20, 20));
+#endif
         QTouchEvent touchEvent(QEvent::TouchUpdate,
                                0 /* device */,
                                Qt::NoModifier,
@@ -233,8 +245,13 @@
     QCOMPARE(candidate0.unownedTouchEvents[0].touchPoints.count(), 1);
     QCOMPARE(candidate0.unownedTouchEvents[0].touchPoints[0].id(), 0);
     // Check that the points local coordinates have been mapped to candidate0's coordinate system.
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     QCOMPARE(candidate0.unownedTouchEvents[0].touchPoints[0].rect().x(), 11 - candidate0.x());
     QCOMPARE(candidate0.unownedTouchEvents[0].touchPoints[0].rect().y(), 11 - candidate0.y());
+#else
+    QCOMPARE(candidate0.unownedTouchEvents[0].touchPoints[0].pos().x(), 11 - candidate0.x());
+    QCOMPARE(candidate0.unownedTouchEvents[0].touchPoints[0].pos().y(), 11 - candidate0.y());
+#endif
 
     touchRegistry->addCandidateOwnerForTouch(1, &candidate1);
 
@@ -242,10 +259,18 @@
         QList<QTouchEvent::TouchPoint> touchPoints;
         touchPoints.append(QTouchEvent::TouchPoint(0));
         touchPoints[0].setState(Qt::TouchPointMoved);
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
         touchPoints[0].setRect(QRect(12, 12, 0, 0));
+#else
+        touchPoints[0].setPos(QPoint(12, 12));
+#endif
         touchPoints.append(QTouchEvent::TouchPoint(1));
         touchPoints[1].setState(Qt::TouchPointMoved);
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
         touchPoints[1].setRect(QRect(21, 21, 0, 0));
+#else
+        touchPoints[1].setPos(QPoint(21, 21));
+#endif
         QTouchEvent touchEvent(QEvent::TouchUpdate,
                                0 /* device */,
                                Qt::NoModifier,
@@ -280,7 +305,11 @@
         QList<QTouchEvent::TouchPoint> touchPoints;
         touchPoints.append(QTouchEvent::TouchPoint(0));
         touchPoints[0].setState(Qt::TouchPointPressed);
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
         touchPoints[0].setRect(QRect(10, 10, 0, 0));
+#else
+        touchPoints[0].setPos(QPoint(10, 10));
+#endif
         QTouchEvent touchEvent(QEvent::TouchBegin,
                                0 /* device */,
                                Qt::NoModifier,
@@ -295,10 +324,18 @@
         QList<QTouchEvent::TouchPoint> touchPoints;
         touchPoints.append(QTouchEvent::TouchPoint(0));
         touchPoints[0].setState(Qt::TouchPointMoved);
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
         touchPoints[0].setRect(QRect(11, 11, 0, 0));
+#else
+        touchPoints[0].setPos(QPoint(11, 11));
+#endif
         touchPoints.append(QTouchEvent::TouchPoint(1));
         touchPoints[1].setState(Qt::TouchPointPressed);
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
         touchPoints[1].setRect(QRect(20, 20, 0, 0));
+#else
+        touchPoints[1].setPos(QPoint(20, 20));
+#endif
         QTouchEvent touchEvent(QEvent::TouchUpdate,
                                0 /* device */,
                                Qt::NoModifier,
@@ -313,17 +350,30 @@
     QCOMPARE(watcher.unownedTouchEvents[0].touchPoints.count(), 1);
     QCOMPARE(watcher.unownedTouchEvents[0].touchPoints[0].id(), 0);
     // Check that the points local coordinates have been mapped to watcher's coordinate system.
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
     QCOMPARE(watcher.unownedTouchEvents[0].touchPoints[0].rect().x(), 11 - watcher.x());
     QCOMPARE(watcher.unownedTouchEvents[0].touchPoints[0].rect().y(), 11 - watcher.y());
+#else
+    QCOMPARE(watcher.unownedTouchEvents[0].touchPoints[0].pos().x(), 11 - watcher.x());
+    QCOMPARE(watcher.unownedTouchEvents[0].touchPoints[0].pos().y(), 11 - watcher.y());
+#endif
 
     {
         QList<QTouchEvent::TouchPoint> touchPoints;
         touchPoints.append(QTouchEvent::TouchPoint(0));
         touchPoints[0].setState(Qt::TouchPointMoved);
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
         touchPoints[0].setRect(QRect(12, 12, 0, 0));
+#else
+        touchPoints[0].setPos(QPoint(12, 12));
+#endif
         touchPoints.append(QTouchEvent::TouchPoint(1));
         touchPoints[1].setState(Qt::TouchPointMoved);
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
         touchPoints[1].setRect(QRect(21, 21, 0, 0));
+#else
+        touchPoints[1].setPos(QPoint(21, 21));
+#endif
         QTouchEvent touchEvent(QEvent::TouchUpdate,
                                0 /* device */,
                                Qt::NoModifier,