diff -rupN --no-dereference qwt-6.2.0/qwtfunctions.pri qwt-6.2.0-new/qwtfunctions.pri
--- qwt-6.2.0/qwtfunctions.pri	2021-07-18 13:19:33.644367625 +0200
+++ qwt-6.2.0-new/qwtfunctions.pri	2022-11-29 15:38:14.943070118 +0100
@@ -12,7 +12,12 @@
 defineReplace(qwtLibraryTarget) {
 
     unset(LIBRARY_NAME)
+
+    greaterThan(QT_MAJOR_VERSION, 4) {
+    LIBRARY_NAME = $${1}-qt$${QT_MAJOR_VERSION}
+    } else {
     LIBRARY_NAME = $$1
+    }
 
     mac:contains(QWT_CONFIG, QwtFramework) {
 
@@ -36,7 +41,11 @@ defineReplace(qwtLibraryTarget) {
 defineTest(qwtAddLibrary) {
 
     LIB_PATH = $$1
+    greaterThan(QT_MAJOR_VERSION, 4) {
+    LIB_NAME = $${2}-qt$${QT_MAJOR_VERSION}
+    } else {
     LIB_NAME = $$2
+    }
 
     mac:contains(QWT_CONFIG, QwtFramework) {
 
diff -rupN qwt-6.2.0/src/src.pro qwt-6.2.0-new/src/src.pro
--- qwt-6.2.0/src/src.pro	2022-11-29 15:38:15.365070601 +0100
+++ qwt-6.2.0-new/src/src.pro	2022-11-29 15:45:42.295600411 +0100
@@ -31,7 +31,11 @@ contains(QWT_CONFIG, QwtDll) {
     
             # we increase the SONAME for every minor number
 
-            QWT_SONAME=libqwt.so.$${VER_MAJ}.$${VER_MIN}
+            greaterThan(QT_MAJOR_VERSION, 4) {
+                QWT_SONAME=libqwt-qt$${QT_MAJOR_VERSION}.so.$${VER_MAJ}.$${VER_MIN}
+            } else {
+                QWT_SONAME=libqwt.so.$${VER_MAJ}.$${VER_MIN}
+            }
             QMAKE_LFLAGS *= $${QMAKE_LFLAGS_SONAME}$${QWT_SONAME}
             QMAKE_LFLAGS_SONAME=
         }
