diff --git a/examples/xmlpatterns/filetree/filetree.pro b/examples/xmlpatterns/filetree/filetree.pro
index fc1c11bada656d2e664086685234d408a0224e6d..4b3430a3d696bde8713aafb48548d4b7863852f5 100644
--- a/examples/xmlpatterns/filetree/filetree.pro
+++ b/examples/xmlpatterns/filetree/filetree.pro
@@ -1,7 +1,7 @@
 SOURCES += main.cpp filetree.cpp mainwindow.cpp ../shared/xmlsyntaxhighlighter.cpp
 HEADERS += filetree.h  mainwindow.h ../shared/xmlsyntaxhighlighter.h
 FORMS += forms/mainwindow.ui
-QT += xmlpatterns
+QT += widgets xmlpatterns
 RESOURCES += queries.qrc
 INCLUDEPATH += ../shared/
 
diff --git a/examples/xmlpatterns/filetree/main.cpp b/examples/xmlpatterns/filetree/main.cpp
index 939072a4828f90c951bd186ea606922e5d78f83f..339b62a3a741b9f929345979ed5388d2c75938fb 100644
--- a/examples/xmlpatterns/filetree/main.cpp
+++ b/examples/xmlpatterns/filetree/main.cpp
@@ -38,7 +38,7 @@
 **
 ****************************************************************************/
 
-#include <QtGui/QApplication>
+#include <QtWidgets/QApplication>
 
 #include "mainwindow.h"
 
diff --git a/examples/xmlpatterns/filetree/mainwindow.cpp b/examples/xmlpatterns/filetree/mainwindow.cpp
index 43502ce881c6274b74994c658b327c105dfb7191..96cb7933a0263764ff0592f27d4ee88f788443d3 100644
--- a/examples/xmlpatterns/filetree/mainwindow.cpp
+++ b/examples/xmlpatterns/filetree/mainwindow.cpp
@@ -38,7 +38,8 @@
 **
 ****************************************************************************/
 
-#include <QtGui>
+#include <QFileDialog>
+#include <QMessageBox>
 #include <QLibraryInfo>
 #include <QtXmlPatterns>
 
diff --git a/examples/xmlpatterns/recipes/querymainwindow.cpp b/examples/xmlpatterns/recipes/querymainwindow.cpp
index 95a8669987f10085f3cafe9f18218b80ca0f3930..23933067f3626e7bfd0cbabfbc566a7c5239fe21 100644
--- a/examples/xmlpatterns/recipes/querymainwindow.cpp
+++ b/examples/xmlpatterns/recipes/querymainwindow.cpp
@@ -38,7 +38,8 @@
 **
 ****************************************************************************/
 
-#include <QtGui>
+#include <QMessageBox>
+#include <QFileDialog>
 #include <QtXmlPatterns>
 
 #include "querymainwindow.h"
diff --git a/examples/xmlpatterns/recipes/recipes.pro b/examples/xmlpatterns/recipes/recipes.pro
index 9e78db4c6a0f778b4d02ffa7bddb907e98a07a5b..2e1f8ec3607ef9494994f02e86f3eee684f24495 100644
--- a/examples/xmlpatterns/recipes/recipes.pro
+++ b/examples/xmlpatterns/recipes/recipes.pro
@@ -1,4 +1,4 @@
-QT          += xmlpatterns
+QT          += widgets xmlpatterns
 FORMS       += forms/querywidget.ui \
                forms/querywidget_mobiles.ui
 HEADERS     = querymainwindow.h ../shared/xmlsyntaxhighlighter.h
diff --git a/examples/xmlpatterns/schema/schema.pro b/examples/xmlpatterns/schema/schema.pro
index 4fda6512c65a9ba4f2d4a6e7741c5191d03d8385..61b147ca6eeba5311851953b27f75af12583d101 100644
--- a/examples/xmlpatterns/schema/schema.pro
+++ b/examples/xmlpatterns/schema/schema.pro
@@ -1,4 +1,4 @@
-QT          += xmlpatterns
+QT          += widgets xmlpatterns
 FORMS       += schema.ui schema_mobiles.ui
 HEADERS     = mainwindow.h ../shared/xmlsyntaxhighlighter.h
 RESOURCES   = schema.qrc
diff --git a/examples/xmlpatterns/trafficinfo/main.cpp b/examples/xmlpatterns/trafficinfo/main.cpp
index 95acca58c46372a8fc5c8f31261cfe7a0aa34343..78227cef5cfee0238409f9ca42e9550db77a10d1 100644
--- a/examples/xmlpatterns/trafficinfo/main.cpp
+++ b/examples/xmlpatterns/trafficinfo/main.cpp
@@ -40,7 +40,7 @@
 
 #include "mainwindow.h"
 
-#include <QtGui/QApplication>
+#include <QtWidgets/QApplication>
 
 int main(int argc, char **argv)
 {
diff --git a/examples/xmlpatterns/trafficinfo/mainwindow.cpp b/examples/xmlpatterns/trafficinfo/mainwindow.cpp
index 72a561c96593e7f673f25b3f6151b5608d9ffeee..4b141563d0e76f85fb22211d18eb75ba35aa35fb 100644
--- a/examples/xmlpatterns/trafficinfo/mainwindow.cpp
+++ b/examples/xmlpatterns/trafficinfo/mainwindow.cpp
@@ -43,8 +43,8 @@
 
 #include <QtCore/QSettings>
 #include <QtCore/QTimer>
-#include <QtGui/QAction>
-#include <QtGui/QApplication>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QApplication>
 #include <QtGui/QBitmap>
 #include <QtGui/QLinearGradient>
 #include <QtGui/QMouseEvent>
diff --git a/examples/xmlpatterns/trafficinfo/mainwindow.h b/examples/xmlpatterns/trafficinfo/mainwindow.h
index 800131e97d52aad349fba67f2954f392e0cd92e2..d451d337510cfc132687047a00f0bc504fe532ed 100644
--- a/examples/xmlpatterns/trafficinfo/mainwindow.h
+++ b/examples/xmlpatterns/trafficinfo/mainwindow.h
@@ -44,7 +44,7 @@
 #include "stationquery.h"
 #include "timequery.h"
 
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
 
 class MainWindow : public QWidget
 {
diff --git a/examples/xmlpatterns/trafficinfo/stationdialog.h b/examples/xmlpatterns/trafficinfo/stationdialog.h
index 81a73e8666e1cc10ba90abdaae1f4fa7bdfefec4..fa738f82715037a21b4dcc4c1f66305ed6eda701 100644
--- a/examples/xmlpatterns/trafficinfo/stationdialog.h
+++ b/examples/xmlpatterns/trafficinfo/stationdialog.h
@@ -41,7 +41,7 @@
 #ifndef STATIONDIALOG_H
 #define STATIONDIALOG_H
 
-#include <QtGui/QDialog>
+#include <QtWidgets/QDialog>
 
 #include "stationquery.h"
 #include "ui_stationdialog.h"
diff --git a/examples/xmlpatterns/trafficinfo/trafficinfo.pro b/examples/xmlpatterns/trafficinfo/trafficinfo.pro
index d0aa7d20734e3d5d9e9d65837f10c3f861e0a541..8a1291092f6e676e13b2f1352881dafb322d8f6d 100644
--- a/examples/xmlpatterns/trafficinfo/trafficinfo.pro
+++ b/examples/xmlpatterns/trafficinfo/trafficinfo.pro
@@ -1,4 +1,4 @@
-QT          += xmlpatterns
+QT          += widgets xmlpatterns
 HEADERS     = mainwindow.h stationdialog.h stationquery.h timequery.h
 SOURCES     = main.cpp mainwindow.cpp stationdialog.cpp stationquery.cpp timequery.cpp
 FORMS       = stationdialog.ui
diff --git a/src/xmlpatterns/xmlpatterns.pro b/src/xmlpatterns/xmlpatterns.pro
index 1422a0e240aa3bc146425ecd150c1c1a31f3f3f9..c1960c7d4a789fac65a37b6474636bdfcf06a4ac 100644
--- a/src/xmlpatterns/xmlpatterns.pro
+++ b/src/xmlpatterns/xmlpatterns.pro
@@ -1,23 +1,20 @@
 load(qt_module)
 
-TARGET = QtXmlPatterns
-QPRO_PWD = $$PWD
-QT = core-private \
-    network
+TARGET     = QtXmlPatterns
+QPRO_PWD   = $$PWD
 
 CONFIG += module
-MODULE_PRI = ../../modules/qt_xmlpatterns.pri
+MODULE_PRI += ../../modules/qt_xmlpatterns.pri
 
-DEFINES += QT_BUILD_XMLPATTERNS_LIB \
-    QT_NO_USING_NAMESPACE
+QT = core-private network
+
+DEFINES += QT_BUILD_XMLPATTERNS_LIB QT_NO_USING_NAMESPACE
 win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x61000000
-unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore \
-    QtNetwork
+unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore QtNetwork
 load(qt_module_config)
 
 HEADERS += qtxmlpatternsversion.h
 
-PRECOMPILED_HEADER = $$QT_SOURCE_TREE/src/corelib/global/qt_pch.h
 include($$PWD/common.pri)
 include($$PWD/acceltree/acceltree.pri)
 include($$PWD/api/api.pri)