diff -ur qwt-6.1.6/qwtbuild.pri ../qwt-6.1.6/qwtbuild.pri
--- qwt-6.1.6/qwtbuild.pri	2020-12-28 12:14:02.671245300 +0100
+++ ../qwt-6.1.6/qwtbuild.pri	2022-04-21 20:33:24.455480900 +0200
@@ -29,8 +29,7 @@
     # might need a debug version.
     # Enable debug_and_release + build_all if you want to build both.
 
-    CONFIG           += debug_and_release
-    CONFIG           += build_all
+    CONFIG           += release
 }
 else {
 
diff -ur qwt-6.1.6/qwtconfig.pri ../qwt-6.1.6/qwtconfig.pri
--- qwt-6.1.6/qwtconfig.pri	2020-12-28 12:14:02.675245400 +0100
+++ ../qwt-6.1.6/qwtconfig.pri	2022-04-21 20:34:24.554229200 +0200
@@ -24,13 +24,13 @@
 }
 
 win32 {
-    QWT_INSTALL_PREFIX    = C:/Qwt-$$QWT_VERSION
+    QWT_INSTALL_PREFIX    = $$PWD/../osgeo4w/install
     # QWT_INSTALL_PREFIX = C:/Qwt-$$QWT_VERSION-qt-$$QT_VERSION
 }
 
-QWT_INSTALL_DOCS      = $${QWT_INSTALL_PREFIX}/doc
-QWT_INSTALL_HEADERS   = $${QWT_INSTALL_PREFIX}/include
-QWT_INSTALL_LIBS      = $${QWT_INSTALL_PREFIX}/lib
+QWT_INSTALL_DOCS      = $${QWT_INSTALL_PREFIX}/apps/qwt6/doc
+QWT_INSTALL_HEADERS   = $${QWT_INSTALL_PREFIX}/apps/Qt5/include/qwt6
+QWT_INSTALL_LIBS      = $${QWT_INSTALL_PREFIX}/apps/Qt5/lib
 
 ######################################################################
 # Designer plugin
@@ -42,14 +42,14 @@
 # runtime environment of designer/creator.
 ######################################################################
 
-QWT_INSTALL_PLUGINS   = $${QWT_INSTALL_PREFIX}/plugins/designer
+QWT_INSTALL_PLUGINS   = $${QWT_INSTALL_PREFIX}/apps/Qt5/plugins/designer
 
 # linux distributors often organize the Qt installation
 # their way and QT_INSTALL_PREFIX doesn't offer a good
 # path. Also QT_INSTALL_PREFIX is only one of the default
 # search paths of the designer - not the Qt creator
 
-#QWT_INSTALL_PLUGINS   = $$[QT_INSTALL_PREFIX]/plugins/designer
+#QWT_INSTALL_PLUGINS   = $${QT_INSTALL_PREFIX}/plugins/designer
 
 ######################################################################
 # Features
@@ -63,8 +63,8 @@
 # with every Qt upgrade.
 ######################################################################
 
-QWT_INSTALL_FEATURES  = $${QWT_INSTALL_PREFIX}/features
-# QWT_INSTALL_FEATURES  = $$[QT_INSTALL_PREFIX]/features
+QWT_INSTALL_FEATURES = $${QWT_INSTALL_PREFIX}/apps/Qt5/features
+# QWT_INSTALL_FEATURES  = $${QT_INSTALL_PREFIX}/features
 
 ######################################################################
 # Build the static/shared libraries.
@@ -163,13 +163,3 @@
 
     QWT_CONFIG += QwtFramework
 }
-
-######################################################################
-# Create and install pc files for pkg-config
-# See http://www.freedesktop.org/wiki/Software/pkg-config/
-######################################################################
-
-unix {
-
-    #QWT_CONFIG     += QwtPkgConfig
-}
diff -ur qwt-6.1.6/src/qwt_null_paintdevice.cpp ../qwt-6.1.6/src/qwt_null_paintdevice.cpp
--- qwt-6.1.6/src/qwt_null_paintdevice.cpp	2020-12-28 12:14:02.367238900 +0100
+++ ../qwt-6.1.6/src/qwt_null_paintdevice.cpp	2022-04-21 20:33:24.462482000 +0200
@@ -11,6 +11,7 @@
 #include <qpaintengine.h>
 #include <qpainterpath.h>
 #include <qpixmap.h>
+#include <qpainterpath.h>
 
 class QwtNullPaintDevice::PrivateData
 {
diff -ur qwt-6.1.6/src/qwt_painter.cpp ../qwt-6.1.6/src/qwt_painter.cpp
--- qwt-6.1.6/src/qwt_painter.cpp	2020-12-28 12:14:02.555242800 +0100
+++ ../qwt-6.1.6/src/qwt_painter.cpp	2022-04-21 20:33:24.465482900 +0200
@@ -28,6 +28,7 @@
 #include <qpaintengine.h>
 #include <qapplication.h>
 #include <qdesktopwidget.h>
+#include <qpainterpath.h>
 
 #if QT_VERSION >= 0x050000
 #include <qwindow.h>
diff -ur qwt-6.1.6/src/qwt_painter.h ../qwt-6.1.6/src/qwt_painter.h
--- qwt-6.1.6/src/qwt_painter.h	2020-12-28 12:14:01.119212800 +0100
+++ ../qwt-6.1.6/src/qwt_painter.h	2022-04-21 20:33:24.468485500 +0200
@@ -17,6 +17,7 @@
 #include <qpen.h>
 #include <qline.h>
 #include <qpalette.h>
+#include <qpainterpath.h>
 
 class QPainter;
 class QBrush;
@@ -31,7 +32,6 @@
 class QwtInterval;
 
 class QTextDocument;
-class QPainterPath;
 
 /*!
   \brief A collection of QPainter workarounds
diff -ur qwt-6.1.6/src/qwt_plot_renderer.cpp ../qwt-6.1.6/src/qwt_plot_renderer.cpp
--- qwt-6.1.6/src/qwt_plot_renderer.cpp	2020-12-28 12:14:02.435240300 +0100
+++ ../qwt-6.1.6/src/qwt_plot_renderer.cpp	2022-04-21 20:33:24.470484500 +0200
@@ -35,6 +35,7 @@
 #endif
 #endif
 #endif
+#include <qpainterpath.h>
 
 #ifndef QT_NO_PRINTER
 #define QWT_FORMAT_PDF 1
diff -ur qwt-6.1.6/src/qwt_widget_overlay.cpp ../qwt-6.1.6/src/qwt_widget_overlay.cpp
--- qwt-6.1.6/src/qwt_widget_overlay.cpp	2020-12-28 12:14:02.479241300 +0100
+++ ../qwt-6.1.6/src/qwt_widget_overlay.cpp	2022-04-21 20:33:24.472484600 +0200
@@ -14,6 +14,7 @@
 #include <qpainterpath.h>
 #include <qimage.h>
 #include <qevent.h>
+#include <qpainterpath.h>
 
 static QImage::Format qwtMaskImageFormat()
 {
