For Qt5 the project file needs to add QT += widgets.

--- dialogbox.pro	2016-03-02 20:31:01.000000000 +0100
+++ dialogbox.pro	2016-12-27 22:06:17.270398461 +0100
@@ -1,5 +1,6 @@
 TEMPLATE = app
 TARGET = dialogbox
+QT += widgets
 DEPENDPATH += .
 INCLUDEPATH += .
 
