--- a/src/qtgui/recoll.pro.in
+++ b/src/qtgui/recoll.pro.in
@@ -8,6 +8,7 @@
 @QMAKE_ENABLE_ZEITGEIST@QMAKE_CXXFLAGS += -DUSE_ZEITGEIST
 
 QT += xml
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets webkitwidgets
 
 CONFIG  += qt warn_on thread release