summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/dbus/dbus.pro2
-rw-r--r--examples/examples.pro12
-rw-r--r--examples/network/network.pro2
-rw-r--r--examples/opengl/cube/cube.pro2
-rw-r--r--examples/qtconcurrent/qtconcurrent.pro2
-rw-r--r--examples/threads/threads.pro2
-rw-r--r--examples/touch/fingerpaint/fingerpaint.pro2
-rw-r--r--examples/widgets/animation/sub-attaq/sub-attaq.pro2
-rw-r--r--examples/widgets/graphicsview/chip/chip.pro4
-rw-r--r--examples/widgets/graphicsview/graphicsview.pro2
-rw-r--r--examples/widgets/graphicsview/padnavigator/padnavigator.pro2
-rw-r--r--examples/widgets/itemviews/pixelator/pixelator.pro2
-rw-r--r--examples/widgets/itemviews/spreadsheet/spreadsheet.pro4
-rw-r--r--examples/widgets/mainwindows/dockwidgets/dockwidgets.pro2
-rw-r--r--examples/widgets/painting/affine/affine.pro2
-rw-r--r--examples/widgets/painting/composition/composition.pro2
-rw-r--r--examples/widgets/painting/deform/deform.pro2
-rw-r--r--examples/widgets/painting/fontsampler/fontsampler.pro2
-rw-r--r--examples/widgets/painting/gradients/gradients.pro2
-rw-r--r--examples/widgets/painting/pathstroke/pathstroke.pro2
-rw-r--r--examples/widgets/painting/shared/shared.pri2
-rw-r--r--examples/widgets/painting/shared/shared.pro2
-rw-r--r--examples/widgets/richtext/orderform/orderform.pro2
-rw-r--r--examples/widgets/richtext/textedit/textedit.pro2
-rw-r--r--examples/widgets/statemachine/statemachine.pro2
-rw-r--r--examples/widgets/tutorials/threads/threads.pro2
-rw-r--r--examples/widgets/widgets/imageviewer/imageviewer.pro2
-rw-r--r--examples/widgets/widgets/scribble/scribble.pro2
-rw-r--r--examples/xml/xml.pro2
-rw-r--r--mkspecs/features/ctest_testcase.prf2
-rw-r--r--mkspecs/features/qt_functions.prf7
-rw-r--r--src/platformsupport/linuxaccessibility/linuxaccessibility.pri2
-rw-r--r--src/plugins/bearer/bearer.pro2
-rw-r--r--src/plugins/platforminputcontexts/platforminputcontexts.pro2
-rw-r--r--src/plugins/platforms/cocoa/cocoa.pro2
-rw-r--r--src/plugins/plugins.pro6
-rw-r--r--tests/auto/auto.pro8
-rw-r--r--tests/auto/corelib/animation/animation.pro2
-rw-r--r--tests/auto/corelib/io/qprocess/qprocess.pri2
-rw-r--r--tests/auto/corelib/itemmodels/itemmodels.pro2
-rw-r--r--tests/auto/corelib/kernel/qpointer/qpointer.pro2
-rw-r--r--tests/auto/corelib/statemachine/qstatemachine/qstatemachine.pro2
-rw-r--r--tests/auto/gui/image/qicon/qicon.pro2
-rw-r--r--tests/auto/gui/image/qmovie/qmovie.pro2
-rw-r--r--tests/auto/gui/image/qpicture/qpicture.pro2
-rw-r--r--tests/auto/gui/image/qpixmap/qpixmap.pro2
-rw-r--r--tests/auto/gui/itemmodels/itemmodels.pro2
-rw-r--r--tests/auto/gui/kernel/kernel.pro2
-rw-r--r--tests/auto/gui/painting/qpainter/qpainter.pro4
-rw-r--r--tests/auto/gui/text/qfont/qfont.pro2
-rw-r--r--tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro2
-rw-r--r--tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro2
-rw-r--r--tests/auto/gui/text/qtextobject/qtextobject.pro2
-rw-r--r--tests/auto/gui/text/qtexttable/qtexttable.pro2
-rw-r--r--tests/auto/opengl/qgl/qgl.pro2
-rw-r--r--tests/auto/opengl/qglbuffer/qglbuffer.pro2
-rw-r--r--tests/auto/opengl/qglfunctions/qglfunctions.pro2
-rw-r--r--tests/auto/opengl/qglthreads/qglthreads.pro2
-rw-r--r--tests/auto/other/atwrapper/atWrapper.pro2
-rw-r--r--tests/auto/other/other.pro2
-rw-r--r--tests/auto/sql/models/models.pro2
-rw-r--r--tests/auto/tools/moc/moc.pro2
-rw-r--r--tests/auto/tools/tools.pro2
-rw-r--r--tests/auto/widgets/widgets/qmdiarea/qmdiarea.pro2
-rw-r--r--tests/benchmarks/benchmarks.pro4
-rw-r--r--tests/benchmarks/corelib/kernel/kernel.pro2
-rw-r--r--tests/benchmarks/corelib/tools/qregexp/qregexp.pro2
-rw-r--r--tests/benchmarks/gui/animation/animation.pro2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/GraphicsViewBenchmark.pro2
-rw-r--r--tests/benchmarks/gui/graphicsview/graphicsview.pro2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.pro2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.pri2
-rw-r--r--tests/benchmarks/gui/gui.pro2
-rw-r--r--tests/benchmarks/gui/image/image.pro2
-rw-r--r--tests/benchmarks/gui/kernel/kernel.pro2
-rw-r--r--tests/benchmarks/gui/painting/painting.pro2
-rw-r--r--tests/benchmarks/gui/styles/styles.pro2
-rw-r--r--tests/manual/lance/lance.pro2
78 files changed, 98 insertions, 91 deletions
diff --git a/examples/dbus/dbus.pro b/examples/dbus/dbus.pro
index 200dfb2484..fd43c23fa3 100644
--- a/examples/dbus/dbus.pro
+++ b/examples/dbus/dbus.pro
@@ -3,7 +3,7 @@ SUBDIRS = listnames \
pingpong \
complexpingpong
-!contains(QT_CONFIG, no-widgets) {
+qtHaveModule(widgets) {
SUBDIRS += chat \
remotecontrolledcar
}
diff --git a/examples/examples.pro b/examples/examples.pro
index e1c3611836..e66226703e 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -8,7 +8,7 @@ SUBDIRS = \
xml \
qpa
-!contains(QT_CONFIG, no-widgets) {
+qtHaveModule(widgets) {
SUBDIRS += widgets \
ipc \
sql \
@@ -17,12 +17,12 @@ SUBDIRS = \
gestures
}
-wince*|embedded|x11:!contains(QT_CONFIG, no-gui): SUBDIRS += embedded
+wince*|embedded|x11:qtHaveModule(gui): SUBDIRS += embedded
-contains(QT_BUILD_PARTS, tools):!contains(QT_CONFIG, no-gui):!contains(QT_CONFIG, no-widgets):SUBDIRS += qtestlib
-contains(QT_CONFIG, opengl):!contains(QT_CONFIG, no-widgets):SUBDIRS += opengl
-contains(QT_CONFIG, dbus): SUBDIRS += dbus
-contains(QT_CONFIG, concurrent): SUBDIRS += qtconcurrent
+contains(QT_BUILD_PARTS, tools):qtHaveModule(gui):qtHaveModule(widgets): SUBDIRS += qtestlib
+qtHaveModule(opengl):qtHaveModule(widgets): SUBDIRS += opengl
+qtHaveModule(dbus): SUBDIRS += dbus
+qtHaveModule(concurrent): SUBDIRS += qtconcurrent
aggregate.files = aggregate/examples.pro
aggregate.path = $$[QT_INSTALL_EXAMPLES]
diff --git a/examples/network/network.pro b/examples/network/network.pro
index f473a112f6..342297528b 100644
--- a/examples/network/network.pro
+++ b/examples/network/network.pro
@@ -4,7 +4,7 @@ SUBDIRS = \
download \
downloadmanager
-!contains(QT_CONFIG, no-widgets) {
+qtHaveModule(widgets) {
SUBDIRS += \
blockingfortuneclient \
broadcastreceiver \
diff --git a/examples/opengl/cube/cube.pro b/examples/opengl/cube/cube.pro
index aaa933c1e2..710b4442c7 100644
--- a/examples/opengl/cube/cube.pro
+++ b/examples/opengl/cube/cube.pro
@@ -5,7 +5,7 @@ TEMPLATE = app
SOURCES += main.cpp
-contains(QT_CONFIG, opengl) {
+qtHaveModule(opengl) {
QT += opengl
SOURCES += mainwidget.cpp \
diff --git a/examples/qtconcurrent/qtconcurrent.pro b/examples/qtconcurrent/qtconcurrent.pro
index 72220b1ab3..dafbabb5c3 100644
--- a/examples/qtconcurrent/qtconcurrent.pro
+++ b/examples/qtconcurrent/qtconcurrent.pro
@@ -8,7 +8,7 @@ SUBDIRS = imagescaling \
SUBDIRS += progressdialog
}
-contains(QT_CONFIG, no-widgets) {
+!qtHaveModule(widgets) {
SUBDIRS -= \
imagescaling \
progressdialog \
diff --git a/examples/threads/threads.pro b/examples/threads/threads.pro
index 027d4c2ebb..e47da84a06 100644
--- a/examples/threads/threads.pro
+++ b/examples/threads/threads.pro
@@ -4,4 +4,4 @@ CONFIG += no_docs_target
SUBDIRS = semaphores \
waitconditions
-!contains(QT_CONFIG, no-widgets):SUBDIRS += mandelbrot
+qtHaveModule(widgets): SUBDIRS += mandelbrot
diff --git a/examples/touch/fingerpaint/fingerpaint.pro b/examples/touch/fingerpaint/fingerpaint.pro
index 5093c8ad8d..5391897af7 100644
--- a/examples/touch/fingerpaint/fingerpaint.pro
+++ b/examples/touch/fingerpaint/fingerpaint.pro
@@ -1,5 +1,5 @@
QT += widgets
-!isEmpty(QT.printsupport.name): QT += printsupport
+qtHaveModule(printsupport): QT += printsupport
HEADERS = mainwindow.h \
scribblearea.h
diff --git a/examples/widgets/animation/sub-attaq/sub-attaq.pro b/examples/widgets/animation/sub-attaq/sub-attaq.pro
index 3ed823d1e6..ac79fd4249 100644
--- a/examples/widgets/animation/sub-attaq/sub-attaq.pro
+++ b/examples/widgets/animation/sub-attaq/sub-attaq.pro
@@ -1,5 +1,5 @@
QT += widgets
-contains(QT_CONFIG, opengl):QT += opengl
+qtHaveModule(opengl): QT += opengl
HEADERS += boat.h \
bomb.h \
mainwindow.h \
diff --git a/examples/widgets/graphicsview/chip/chip.pro b/examples/widgets/graphicsview/chip/chip.pro
index 8e3d91f38e..a46f07ce35 100644
--- a/examples/widgets/graphicsview/chip/chip.pro
+++ b/examples/widgets/graphicsview/chip/chip.pro
@@ -5,8 +5,8 @@ SOURCES += main.cpp
SOURCES += mainwindow.cpp view.cpp chip.cpp
QT += widgets
-!isEmpty(QT.printsupport.name): QT += printsupport
-contains(QT_CONFIG, opengl):QT += opengl
+qtHaveModule(printsupport): QT += printsupport
+qtHaveModule(opengl): QT += opengl
build_all:!build_pass {
CONFIG -= build_all
diff --git a/examples/widgets/graphicsview/graphicsview.pro b/examples/widgets/graphicsview/graphicsview.pro
index 901533a8de..9d6d7a75f6 100644
--- a/examples/widgets/graphicsview/graphicsview.pro
+++ b/examples/widgets/graphicsview/graphicsview.pro
@@ -15,6 +15,6 @@ SUBDIRS = \
contains(DEFINES, QT_NO_CURSOR)|contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= dragdroprobot
-contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles2):{
+qtHaveModule(opengl):!contains(QT_CONFIG, opengles.) {
SUBDIRS += boxes
}
diff --git a/examples/widgets/graphicsview/padnavigator/padnavigator.pro b/examples/widgets/graphicsview/padnavigator/padnavigator.pro
index 460cc90219..c2bc79b5cc 100644
--- a/examples/widgets/graphicsview/padnavigator/padnavigator.pro
+++ b/examples/widgets/graphicsview/padnavigator/padnavigator.pro
@@ -17,7 +17,7 @@ FORMS += \
form.ui
QT += widgets
-contains(QT_CONFIG, opengl):QT += opengl
+qtHaveModule(opengl): QT += opengl
# install
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/graphicsview/padnavigator
diff --git a/examples/widgets/itemviews/pixelator/pixelator.pro b/examples/widgets/itemviews/pixelator/pixelator.pro
index b844e7c3a4..35176a6026 100644
--- a/examples/widgets/itemviews/pixelator/pixelator.pro
+++ b/examples/widgets/itemviews/pixelator/pixelator.pro
@@ -1,5 +1,5 @@
QT += widgets
-!isEmpty(QT.printsupport.name): QT += printsupport
+qtHaveModule(printsupport): QT += printsupport
HEADERS = imagemodel.h \
mainwindow.h \
diff --git a/examples/widgets/itemviews/spreadsheet/spreadsheet.pro b/examples/widgets/itemviews/spreadsheet/spreadsheet.pro
index b69811a4b8..56f7424a93 100644
--- a/examples/widgets/itemviews/spreadsheet/spreadsheet.pro
+++ b/examples/widgets/itemviews/spreadsheet/spreadsheet.pro
@@ -1,6 +1,6 @@
QT += widgets
-!isEmpty(QT.printsupport.name): QT += printsupport
-#unix:contains(QT_CONFIG, dbus):QT += dbus widgets
+qtHaveModule(printsupport): QT += printsupport
+#unix:qtHaveModule(dbus): QT += dbus widgets
HEADERS += printview.h spreadsheet.h spreadsheetdelegate.h spreadsheetitem.h
SOURCES += main.cpp \
diff --git a/examples/widgets/mainwindows/dockwidgets/dockwidgets.pro b/examples/widgets/mainwindows/dockwidgets/dockwidgets.pro
index 4bccf49399..f445c5a89e 100644
--- a/examples/widgets/mainwindows/dockwidgets/dockwidgets.pro
+++ b/examples/widgets/mainwindows/dockwidgets/dockwidgets.pro
@@ -1,5 +1,5 @@
QT += widgets
-!isEmpty(QT.printsupport.name): QT += printsupport
+qtHaveModule(printsupport): QT += printsupport
HEADERS = mainwindow.h
SOURCES = main.cpp \
diff --git a/examples/widgets/painting/affine/affine.pro b/examples/widgets/painting/affine/affine.pro
index e94f4d12fb..1f2f8df87f 100644
--- a/examples/widgets/painting/affine/affine.pro
+++ b/examples/widgets/painting/affine/affine.pro
@@ -1,7 +1,7 @@
SOURCES += main.cpp xform.cpp
HEADERS += xform.h
-contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) {
+qtHaveModule(opengl) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl
}
diff --git a/examples/widgets/painting/composition/composition.pro b/examples/widgets/painting/composition/composition.pro
index 7ff82d789a..0269945ac8 100644
--- a/examples/widgets/painting/composition/composition.pro
+++ b/examples/widgets/painting/composition/composition.pro
@@ -6,7 +6,7 @@ SHARED_FOLDER = ../shared
include($$SHARED_FOLDER/shared.pri)
RESOURCES += composition.qrc
-contains(QT_CONFIG, opengl) {
+qtHaveModule(opengl) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl
}
diff --git a/examples/widgets/painting/deform/deform.pro b/examples/widgets/painting/deform/deform.pro
index 01dc0a869c..6409aaed96 100644
--- a/examples/widgets/painting/deform/deform.pro
+++ b/examples/widgets/painting/deform/deform.pro
@@ -7,7 +7,7 @@ include($$SHARED_FOLDER/shared.pri)
RESOURCES += deform.qrc
-contains(QT_CONFIG, opengl) {
+qtHaveModule(opengl) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl
}
diff --git a/examples/widgets/painting/fontsampler/fontsampler.pro b/examples/widgets/painting/fontsampler/fontsampler.pro
index 8325da0175..08dd07bc08 100644
--- a/examples/widgets/painting/fontsampler/fontsampler.pro
+++ b/examples/widgets/painting/fontsampler/fontsampler.pro
@@ -1,5 +1,5 @@
QT += widgets
-!isEmpty(QT.printsupport.name): QT += printsupport
+qtHaveModule(printsupport): QT += printsupport
FORMS = mainwindowbase.ui
HEADERS = mainwindow.h
diff --git a/examples/widgets/painting/gradients/gradients.pro b/examples/widgets/painting/gradients/gradients.pro
index a7d6ae68d1..73f3974c62 100644
--- a/examples/widgets/painting/gradients/gradients.pro
+++ b/examples/widgets/painting/gradients/gradients.pro
@@ -6,7 +6,7 @@ SHARED_FOLDER = ../shared
include($$SHARED_FOLDER/shared.pri)
RESOURCES += gradients.qrc
-contains(QT_CONFIG, opengl) {
+qtHaveModule(opengl) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl
}
diff --git a/examples/widgets/painting/pathstroke/pathstroke.pro b/examples/widgets/painting/pathstroke/pathstroke.pro
index 197fe22024..8ab3cb9244 100644
--- a/examples/widgets/painting/pathstroke/pathstroke.pro
+++ b/examples/widgets/painting/pathstroke/pathstroke.pro
@@ -7,7 +7,7 @@ include($$SHARED_FOLDER/shared.pri)
RESOURCES += pathstroke.qrc
-contains(QT_CONFIG, opengl) {
+qtHaveModule(opengl) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl
}
diff --git a/examples/widgets/painting/shared/shared.pri b/examples/widgets/painting/shared/shared.pri
index 6aef1bdd5b..1b8be82d03 100644
--- a/examples/widgets/painting/shared/shared.pri
+++ b/examples/widgets/painting/shared/shared.pri
@@ -1,6 +1,6 @@
INCLUDEPATH += $$PWD
-contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) {
+qtHaveModule(opengl) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl widgets
}
diff --git a/examples/widgets/painting/shared/shared.pro b/examples/widgets/painting/shared/shared.pro
index 42b474a946..2756bf75ca 100644
--- a/examples/widgets/painting/shared/shared.pro
+++ b/examples/widgets/painting/shared/shared.pro
@@ -1,7 +1,7 @@
TEMPLATE = lib
CONFIG += static
-contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) {
+qtHaveModule(opengl) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl
}
diff --git a/examples/widgets/richtext/orderform/orderform.pro b/examples/widgets/richtext/orderform/orderform.pro
index 1477d6ecab..0eb9da3ae1 100644
--- a/examples/widgets/richtext/orderform/orderform.pro
+++ b/examples/widgets/richtext/orderform/orderform.pro
@@ -1,5 +1,5 @@
QT += widgets
-!isEmpty(QT.printsupport.name): QT += printsupport
+qtHaveModule(printsupport): QT += printsupport
HEADERS = detailsdialog.h \
mainwindow.h
diff --git a/examples/widgets/richtext/textedit/textedit.pro b/examples/widgets/richtext/textedit/textedit.pro
index 36f860c5a8..c32bf68f68 100644
--- a/examples/widgets/richtext/textedit/textedit.pro
+++ b/examples/widgets/richtext/textedit/textedit.pro
@@ -1,5 +1,5 @@
QT += widgets
-!isEmpty(QT.printsupport.name): QT += printsupport
+qtHaveModule(printsupport): QT += printsupport
TEMPLATE = app
TARGET = textedit
diff --git a/examples/widgets/statemachine/statemachine.pro b/examples/widgets/statemachine/statemachine.pro
index 2a539d2e54..926e01cfda 100644
--- a/examples/widgets/statemachine/statemachine.pro
+++ b/examples/widgets/statemachine/statemachine.pro
@@ -3,7 +3,7 @@ SUBDIRS = \
factorial \
pingpong
-!contains(QT_CONFIG, no-widgets) {
+qtHaveModule(widgets) {
SUBDIRS += \
eventtransitions \
rogue \
diff --git a/examples/widgets/tutorials/threads/threads.pro b/examples/widgets/tutorials/threads/threads.pro
index 4d51120794..19718d760c 100644
--- a/examples/widgets/tutorials/threads/threads.pro
+++ b/examples/widgets/tutorials/threads/threads.pro
@@ -5,4 +5,4 @@ SUBDIRS = hellothread \
clock \
movedobject
-contains(QT_CONFIG, concurrent): SUBDIRS += helloconcurrent
+qtHaveModule(concurrent): SUBDIRS += helloconcurrent
diff --git a/examples/widgets/widgets/imageviewer/imageviewer.pro b/examples/widgets/widgets/imageviewer/imageviewer.pro
index 3378db7fb6..a0f9cebbda 100644
--- a/examples/widgets/widgets/imageviewer/imageviewer.pro
+++ b/examples/widgets/widgets/imageviewer/imageviewer.pro
@@ -1,5 +1,5 @@
QT += widgets
-!isEmpty(QT.printsupport.name): QT += printsupport
+qtHaveModule(printsupport): QT += printsupport
HEADERS = imageviewer.h
SOURCES = imageviewer.cpp \
diff --git a/examples/widgets/widgets/scribble/scribble.pro b/examples/widgets/widgets/scribble/scribble.pro
index 8c35ba777f..aff0fb442c 100644
--- a/examples/widgets/widgets/scribble/scribble.pro
+++ b/examples/widgets/widgets/scribble/scribble.pro
@@ -1,5 +1,5 @@
QT += widgets
-!isEmpty(QT.printsupport.name): QT += printsupport
+qtHaveModule(printsupport): QT += printsupport
HEADERS = mainwindow.h \
scribblearea.h
diff --git a/examples/xml/xml.pro b/examples/xml/xml.pro
index 7c7b6f7456..bc8686a475 100644
--- a/examples/xml/xml.pro
+++ b/examples/xml/xml.pro
@@ -2,7 +2,7 @@ TEMPLATE = subdirs
SUBDIRS = htmlinfo \
xmlstreamlint
-!contains(QT_CONFIG, no-widgets) {
+qtHaveModule(widgets) {
SUBDIRS += dombookmarks \
rsslisting \
saxbookmarks \
diff --git a/mkspecs/features/ctest_testcase.prf b/mkspecs/features/ctest_testcase.prf
index 555a0bbe5c..93ebd4607d 100644
--- a/mkspecs/features/ctest_testcase.prf
+++ b/mkspecs/features/ctest_testcase.prf
@@ -53,6 +53,6 @@ insignificant_test:!isEmpty(check.commands) {
check.commands = -$${check.commands}
}
-isEmpty(QT.widgets.name):CONFIG += insignificant_test # QTBUG-28540
+!qtHaveModule(widgets): CONFIG += insignificant_test # QTBUG-28540
QMAKE_EXTRA_TARGETS *= check
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index 0bae5f3f87..389f2418ad 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -51,6 +51,13 @@ defineTest(qtProcessModuleFlags) {
export($$1)
}
+# qt module
+defineTest(qtHaveModule) {
+ !isEmpty(QT.$${1}.name): \
+ return(true)
+ return(false)
+}
+
# qt module, UsePrivate flag, libs variable
defineTest(qtAddModule) {
MODULE_NAME = $$eval(QT.$${1}.name)
diff --git a/src/platformsupport/linuxaccessibility/linuxaccessibility.pri b/src/platformsupport/linuxaccessibility/linuxaccessibility.pri
index 85a02da004..09d437678f 100644
--- a/src/platformsupport/linuxaccessibility/linuxaccessibility.pri
+++ b/src/platformsupport/linuxaccessibility/linuxaccessibility.pri
@@ -1,4 +1,4 @@
-contains(QT_CONFIG, dbus):contains(QT_CONFIG, xcb):contains(QT_CONFIG, accessibility) {
+qtHaveModule(dbus):contains(QT_CONFIG, xcb):contains(QT_CONFIG, accessibility) {
QT += dbus
include(../../3rdparty/atspi2/atspi2.pri)
diff --git a/src/plugins/bearer/bearer.pro b/src/plugins/bearer/bearer.pro
index 899eede7bf..0375500306 100644
--- a/src/plugins/bearer/bearer.pro
+++ b/src/plugins/bearer/bearer.pro
@@ -1,6 +1,6 @@
TEMPLATE = subdirs
-linux*:contains(QT_CONFIG, dbus) {
+linux*:qtHaveModule(dbus) {
SUBDIRS += generic
SUBDIRS += connman networkmanager
}
diff --git a/src/plugins/platforminputcontexts/platforminputcontexts.pro b/src/plugins/platforminputcontexts/platforminputcontexts.pro
index 7c1f55927d..c8449e7e44 100644
--- a/src/plugins/platforminputcontexts/platforminputcontexts.pro
+++ b/src/plugins/platforminputcontexts/platforminputcontexts.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
-contains(QT_CONFIG, dbus) {
+qtHaveModule(dbus) {
!macx:!win32:SUBDIRS += ibus maliit
}
diff --git a/src/plugins/platforms/cocoa/cocoa.pro b/src/plugins/platforms/cocoa/cocoa.pro
index 85e3f0007c..83e2a88e6a 100644
--- a/src/plugins/platforms/cocoa/cocoa.pro
+++ b/src/plugins/platforms/cocoa/cocoa.pro
@@ -82,7 +82,7 @@ LIBS += -framework Cocoa -framework IOKit
QT += core-private gui-private platformsupport-private
-!contains(QT_CONFIG, no-widgets) {
+qtHaveModule(widgets) {
OBJECTIVE_SOURCES += \
qpaintengine_mac.mm \
qprintengine_mac.mm \
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index b056fa4002..3b0ff3f6c8 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -1,7 +1,7 @@
TEMPLATE = subdirs
SUBDIRS *= sqldrivers bearer
-!contains(QT_CONFIG, no-gui): SUBDIRS *= imageformats platforms platforminputcontexts generic
-!contains(QT_CONFIG, no-widgets): SUBDIRS += accessible
+qtHaveModule(gui): SUBDIRS *= imageformats platforms platforminputcontexts generic
+qtHaveModule(widgets): SUBDIRS += accessible
-!wince*:!contains(QT_CONFIG, no-widgets):SUBDIRS += printsupport
+!wince*:qtHaveModule(widgets): SUBDIRS += printsupport
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index b3906cc247..6ff0734186 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -18,7 +18,7 @@ SUBDIRS += \
wince*: SUBDIRS -= printsupport
cross_compile: SUBDIRS -= tools
-isEmpty(QT.opengl.name): SUBDIRS -= opengl
-!unix|embedded|!contains(QT_CONFIG, dbus): SUBDIRS -= dbus
-contains(QT_CONFIG, no-widgets): SUBDIRS -= widgets printsupport
-!contains(QT_CONFIG, concurrent): SUBDIRS -= concurrent
+!qtHaveModule(opengl): SUBDIRS -= opengl
+!unix|embedded|!qtHaveModule(dbus): SUBDIRS -= dbus
+!qtHaveModule(widgets): SUBDIRS -= widgets printsupport
+!qtHaveModule(concurrent): SUBDIRS -= concurrent
diff --git a/tests/auto/corelib/animation/animation.pro b/tests/auto/corelib/animation/animation.pro
index 563b7184bf..30c98f4a11 100644
--- a/tests/auto/corelib/animation/animation.pro
+++ b/tests/auto/corelib/animation/animation.pro
@@ -8,5 +8,5 @@ SUBDIRS=\
qsequentialanimationgroup \
qvariantanimation
-contains(QT_CONFIG, no-widgets): SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
qpropertyanimation
diff --git a/tests/auto/corelib/io/qprocess/qprocess.pri b/tests/auto/corelib/io/qprocess/qprocess.pri
index d139b3dcef..430251fbf1 100644
--- a/tests/auto/corelib/io/qprocess/qprocess.pri
+++ b/tests/auto/corelib/io/qprocess/qprocess.pri
@@ -17,5 +17,5 @@ SUBPROGRAMS = \
!contains(QMAKE_PLATFORM, wince): SUBPROGRAMS += testForwarding
-contains(QT_CONFIG, no-widgets): SUBPROGRAMS -= \
+!qtHaveModule(widgets): SUBPROGRAMS -= \
testGuiProcess
diff --git a/tests/auto/corelib/itemmodels/itemmodels.pro b/tests/auto/corelib/itemmodels/itemmodels.pro
index 5221bfae81..2f681c3330 100644
--- a/tests/auto/corelib/itemmodels/itemmodels.pro
+++ b/tests/auto/corelib/itemmodels/itemmodels.pro
@@ -3,7 +3,7 @@ TEMPLATE=subdirs
SUBDIRS = qabstractitemmodel \
qstringlistmodel
-!contains(QT_CONFIG, no-widgets): SUBDIRS += \
+qtHaveModule(widgets): SUBDIRS += \
qabstractproxymodel \
qidentityproxymodel \
qitemmodel \
diff --git a/tests/auto/corelib/kernel/qpointer/qpointer.pro b/tests/auto/corelib/kernel/qpointer/qpointer.pro
index 6c076e630f..8786d07292 100644
--- a/tests/auto/corelib/kernel/qpointer/qpointer.pro
+++ b/tests/auto/corelib/kernel/qpointer/qpointer.pro
@@ -2,6 +2,6 @@ CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qpointer
QT += testlib
-!contains(QT_CONFIG, no-widgets): QT += widgets
+qtHaveModule(widgets): QT += widgets
SOURCES = tst_qpointer.cpp
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/corelib/statemachine/qstatemachine/qstatemachine.pro b/tests/auto/corelib/statemachine/qstatemachine/qstatemachine.pro
index 1708735c52..b830efe3a5 100644
--- a/tests/auto/corelib/statemachine/qstatemachine/qstatemachine.pro
+++ b/tests/auto/corelib/statemachine/qstatemachine/qstatemachine.pro
@@ -2,6 +2,6 @@ CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qstatemachine
QT = core-private testlib gui
-!contains(QT_CONFIG, no-widgets): QT += widgets
+qtHaveModule(widgets): QT += widgets
SOURCES = tst_qstatemachine.cpp
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/gui/image/qicon/qicon.pro b/tests/auto/gui/image/qicon/qicon.pro
index d4ade0e8ab..337b938915 100644
--- a/tests/auto/gui/image/qicon/qicon.pro
+++ b/tests/auto/gui/image/qicon/qicon.pro
@@ -3,7 +3,7 @@ CONFIG += parallel_test
TARGET = tst_qicon
QT += testlib
-!contains(QT_CONFIG, no-widgets): QT += widgets
+qtHaveModule(widgets): QT += widgets
SOURCES += tst_qicon.cpp
RESOURCES = tst_qicon.qrc
diff --git a/tests/auto/gui/image/qmovie/qmovie.pro b/tests/auto/gui/image/qmovie/qmovie.pro
index a511f0b258..9290588625 100644
--- a/tests/auto/gui/image/qmovie/qmovie.pro
+++ b/tests/auto/gui/image/qmovie/qmovie.pro
@@ -2,7 +2,7 @@ CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qmovie
QT += testlib
-!contains(QT_CONFIG, no-widgets): QT += widgets
+qtHaveModule(widgets): QT += widgets
SOURCES += tst_qmovie.cpp
MOC_DIR=tmp
diff --git a/tests/auto/gui/image/qpicture/qpicture.pro b/tests/auto/gui/image/qpicture/qpicture.pro
index 8a93584aaa..b4927b4536 100644
--- a/tests/auto/gui/image/qpicture/qpicture.pro
+++ b/tests/auto/gui/image/qpicture/qpicture.pro
@@ -2,7 +2,7 @@ CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qpicture
QT += testlib
-!contains(QT_CONFIG, no-widgets): QT += widgets
+qtHaveModule(widgets): QT += widgets
SOURCES += tst_qpicture.cpp
diff --git a/tests/auto/gui/image/qpixmap/qpixmap.pro b/tests/auto/gui/image/qpixmap/qpixmap.pro
index f079f56864..6188bf2c6e 100644
--- a/tests/auto/gui/image/qpixmap/qpixmap.pro
+++ b/tests/auto/gui/image/qpixmap/qpixmap.pro
@@ -2,7 +2,7 @@ CONFIG += testcase
TARGET = tst_qpixmap
QT += core-private gui-private testlib
-!contains(QT_CONFIG, no-widgets): QT += widgets widgets-private
+qtHaveModule(widgets): QT += widgets widgets-private
SOURCES += tst_qpixmap.cpp
!wince* {
diff --git a/tests/auto/gui/itemmodels/itemmodels.pro b/tests/auto/gui/itemmodels/itemmodels.pro
index 169100f486..8a300d0210 100644
--- a/tests/auto/gui/itemmodels/itemmodels.pro
+++ b/tests/auto/gui/itemmodels/itemmodels.pro
@@ -3,5 +3,5 @@ SUBDIRS= \
qstandarditem \
qstandarditemmodel
-isEmpty(QT.widgets.name):SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
qstandarditemmodel
diff --git a/tests/auto/gui/kernel/kernel.pro b/tests/auto/gui/kernel/kernel.pro
index fb8cd2d566..7e3f25d377 100644
--- a/tests/auto/gui/kernel/kernel.pro
+++ b/tests/auto/gui/kernel/kernel.pro
@@ -19,6 +19,6 @@ SUBDIRS=\
qwindow \
qguiapplication \
-contains(QT_CONFIG, no-widgets): SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
qmouseevent_modal \
qtouchevent
diff --git a/tests/auto/gui/painting/qpainter/qpainter.pro b/tests/auto/gui/painting/qpainter/qpainter.pro
index 90a801ecb3..a30564cc50 100644
--- a/tests/auto/gui/painting/qpainter/qpainter.pro
+++ b/tests/auto/gui/painting/qpainter/qpainter.pro
@@ -3,8 +3,8 @@ CONFIG += parallel_test
TARGET = tst_qpainter
QT += testlib
-!contains(QT_CONFIG, no-widgets): QT += widgets widgets-private
-!contains(QT_CONFIG, no-widgets):!wince*: QT += printsupport
+qtHaveModule(widgets): QT += widgets widgets-private
+qtHaveModule(widgets):!wince*: QT += printsupport
SOURCES += tst_qpainter.cpp
diff --git a/tests/auto/gui/text/qfont/qfont.pro b/tests/auto/gui/text/qfont/qfont.pro
index 562294dd66..ced66c226c 100644
--- a/tests/auto/gui/text/qfont/qfont.pro
+++ b/tests/auto/gui/text/qfont/qfont.pro
@@ -3,7 +3,7 @@ CONFIG += parallel_test
TARGET = tst_qfont
QT += testlib
QT += core-private gui-private
-!contains(QT_CONFIG, no-widgets): QT += widgets
+qtHaveModule(widgets): QT += widgets
SOURCES += tst_qfont.cpp
diff --git a/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro b/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro
index c8db4df90e..24b58c7d3e 100644
--- a/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro
+++ b/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro
@@ -3,5 +3,5 @@ CONFIG += parallel_test
TARGET = tst_qsyntaxhighlighter
SOURCES += tst_qsyntaxhighlighter.cpp
QT += testlib
-!contains(QT_CONFIG, no-widgets) QT += widgets
+qtHaveModule(widgets) QT += widgets
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro b/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro
index d439e0deb9..76dd370a8d 100644
--- a/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro
+++ b/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro
@@ -2,7 +2,7 @@ CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qtextdocumentlayout
QT += testlib
-!contains(QT_CONFIG, no-widgets) QT += widgets
+qtHaveModule(widgets) QT += widgets
SOURCES += tst_qtextdocumentlayout.cpp
diff --git a/tests/auto/gui/text/qtextobject/qtextobject.pro b/tests/auto/gui/text/qtextobject/qtextobject.pro
index 59312ac1d5..ebeba2a64a 100644
--- a/tests/auto/gui/text/qtextobject/qtextobject.pro
+++ b/tests/auto/gui/text/qtextobject/qtextobject.pro
@@ -6,7 +6,7 @@ CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qtextobject
QT += testlib
-!contains(QT_CONFIG, no-widgets): QT += widgets
+qtHaveModule(widgets): QT += widgets
SOURCES += tst_qtextobject.cpp
diff --git a/tests/auto/gui/text/qtexttable/qtexttable.pro b/tests/auto/gui/text/qtexttable/qtexttable.pro
index a1034dac67..1c59bf1471 100644
--- a/tests/auto/gui/text/qtexttable/qtexttable.pro
+++ b/tests/auto/gui/text/qtexttable/qtexttable.pro
@@ -2,7 +2,7 @@ CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qtexttable
QT += testlib
-!contains(QT_CONFIG, no-widgets): QT += widgets
+qtHaveModule(widgets): QT += widgets
SOURCES += tst_qtexttable.cpp
diff --git a/tests/auto/opengl/qgl/qgl.pro b/tests/auto/opengl/qgl/qgl.pro
index e5aff000ac..311e41a624 100644
--- a/tests/auto/opengl/qgl/qgl.pro
+++ b/tests/auto/opengl/qgl/qgl.pro
@@ -4,7 +4,7 @@
CONFIG += testcase
TARGET = tst_qgl
-requires(contains(QT_CONFIG,opengl))
+requires(qtHaveModule(opengl))
QT += widgets widgets-private opengl-private gui-private core-private testlib
SOURCES += tst_qgl.cpp
diff --git a/tests/auto/opengl/qglbuffer/qglbuffer.pro b/tests/auto/opengl/qglbuffer/qglbuffer.pro
index 4d102415a8..72117322da 100644
--- a/tests/auto/opengl/qglbuffer/qglbuffer.pro
+++ b/tests/auto/opengl/qglbuffer/qglbuffer.pro
@@ -5,7 +5,7 @@
CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qglbuffer
-requires(contains(QT_CONFIG,opengl))
+requires(qtHaveModule(opengl))
QT += opengl widgets testlib
SOURCES += tst_qglbuffer.cpp
diff --git a/tests/auto/opengl/qglfunctions/qglfunctions.pro b/tests/auto/opengl/qglfunctions/qglfunctions.pro
index 321f62534e..a512ea0dd9 100644
--- a/tests/auto/opengl/qglfunctions/qglfunctions.pro
+++ b/tests/auto/opengl/qglfunctions/qglfunctions.pro
@@ -1,7 +1,7 @@
CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qglfunctions
-requires(contains(QT_CONFIG,opengl))
+requires(qtHaveModule(opengl))
QT += opengl widgets testlib
SOURCES += tst_qglfunctions.cpp
diff --git a/tests/auto/opengl/qglthreads/qglthreads.pro b/tests/auto/opengl/qglthreads/qglthreads.pro
index d5cbd0d9ed..3502c41c87 100644
--- a/tests/auto/opengl/qglthreads/qglthreads.pro
+++ b/tests/auto/opengl/qglthreads/qglthreads.pro
@@ -1,6 +1,6 @@
CONFIG += testcase
TARGET = tst_qglthreads
-requires(contains(QT_CONFIG,opengl))
+requires(qtHaveModule(opengl))
QT += opengl widgets testlib gui-private core-private
HEADERS += tst_qglthreads.h
diff --git a/tests/auto/other/atwrapper/atWrapper.pro b/tests/auto/other/atwrapper/atWrapper.pro
index d14293302e..1617ae89d1 100644
--- a/tests/auto/other/atwrapper/atWrapper.pro
+++ b/tests/auto/other/atwrapper/atWrapper.pro
@@ -6,7 +6,7 @@ DEFINES += SRCDIR=\\\"$$PWD\\\"
QT += xml svg network testlib
-contains(QT_CONFIG, opengl):QT += opengl
+qtHaveModule(opengl): QT += opengl
include($$ARTHUR/datagenerator/datagenerator.pri)
diff --git a/tests/auto/other/other.pro b/tests/auto/other/other.pro
index eb6ed667a8..ea6290db42 100644
--- a/tests/auto/other/other.pro
+++ b/tests/auto/other/other.pro
@@ -26,7 +26,7 @@ SUBDIRS=\
qtokenautomaton \
windowsmobile \
-contains(QT_CONFIG, no-widgets): SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
baselineexample \
gestures \
headersclean \
diff --git a/tests/auto/sql/models/models.pro b/tests/auto/sql/models/models.pro
index c00ec2c935..2c3ae4ef0a 100644
--- a/tests/auto/sql/models/models.pro
+++ b/tests/auto/sql/models/models.pro
@@ -4,5 +4,5 @@ SUBDIRS=\
qsqlrelationaltablemodel \
qsqltablemodel \
-contains(QT_CONFIG, no-widgets): SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
qsqlquerymodel
diff --git a/tests/auto/tools/moc/moc.pro b/tests/auto/tools/moc/moc.pro
index d91ae378da..772086d3c4 100644
--- a/tests/auto/tools/moc/moc.pro
+++ b/tests/auto/tools/moc/moc.pro
@@ -31,7 +31,7 @@ SOURCES += tst_moc.cpp
QT -= gui
QT += sql network testlib
-contains(QT_CONFIG, dbus){
+qtHaveModule(dbus) {
DEFINES += WITH_DBUS
QT += dbus
}
diff --git a/tests/auto/tools/tools.pro b/tests/auto/tools/tools.pro
index 4cc3d62a43..9b4d2ca22a 100644
--- a/tests/auto/tools/tools.pro
+++ b/tests/auto/tools/tools.pro
@@ -5,4 +5,4 @@ SUBDIRS=\
moc \
rcc \
-contains(QT_CONFIG, dbus):SUBDIRS += qdbuscpp2xml qdbusxml2cpp
+qtHaveModule(dbus): SUBDIRS += qdbuscpp2xml qdbusxml2cpp
diff --git a/tests/auto/widgets/widgets/qmdiarea/qmdiarea.pro b/tests/auto/widgets/widgets/qmdiarea/qmdiarea.pro
index 141392b251..cc2bcb3c30 100644
--- a/tests/auto/widgets/widgets/qmdiarea/qmdiarea.pro
+++ b/tests/auto/widgets/widgets/qmdiarea/qmdiarea.pro
@@ -6,7 +6,7 @@ QT += gui-private widgets testlib
INCLUDEPATH += .
SOURCES += tst_qmdiarea.cpp
DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
-contains(QT_CONFIG, opengl):QT += opengl
+qtHaveModule(opengl): QT += opengl
mac {
LIBS += -framework Security
diff --git a/tests/benchmarks/benchmarks.pro b/tests/benchmarks/benchmarks.pro
index e685c3d7b2..5fd8ff6368 100644
--- a/tests/benchmarks/benchmarks.pro
+++ b/tests/benchmarks/benchmarks.pro
@@ -5,8 +5,8 @@ SUBDIRS = \
network \
sql \
-# removed-by-refactor contains(QT_CONFIG, opengl): SUBDIRS += opengl
-contains(QT_CONFIG, dbus): SUBDIRS += dbus
+# removed-by-refactor qtHaveModule(opengl): SUBDIRS += opengl
+qtHaveModule(dbus): SUBDIRS += dbus
check-trusted.CONFIG += recursive
QMAKE_EXTRA_TARGETS += check-trusted
diff --git a/tests/benchmarks/corelib/kernel/kernel.pro b/tests/benchmarks/corelib/kernel/kernel.pro
index a55135b74d..02eeeaa254 100644
--- a/tests/benchmarks/corelib/kernel/kernel.pro
+++ b/tests/benchmarks/corelib/kernel/kernel.pro
@@ -7,6 +7,6 @@ SUBDIRS = \
qvariant \
qcoreapplication
-isEmpty(QT.widgets.name): SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
qmetaobject \
qobject
diff --git a/tests/benchmarks/corelib/tools/qregexp/qregexp.pro b/tests/benchmarks/corelib/tools/qregexp/qregexp.pro
index ef50a22d4d..74544519f3 100644
--- a/tests/benchmarks/corelib/tools/qregexp/qregexp.pro
+++ b/tests/benchmarks/corelib/tools/qregexp/qregexp.pro
@@ -6,7 +6,7 @@ CONFIG += release exceptions
SOURCES += main.cpp
RESOURCES += qregexp.qrc
-!isEmpty(QT.script.name):!pcre {
+qtHaveModule(script):!pcre {
DEFINES += HAVE_JSC
QT += script
}
diff --git a/tests/benchmarks/gui/animation/animation.pro b/tests/benchmarks/gui/animation/animation.pro
index 1c9a7c3c08..76c1a49e5c 100644
--- a/tests/benchmarks/gui/animation/animation.pro
+++ b/tests/benchmarks/gui/animation/animation.pro
@@ -1,2 +1,2 @@
TEMPLATE = subdirs
-!isEmpty(QT.widgets.name):SUBDIRS = qanimation
+qtHaveModule(widgets): SUBDIRS = qanimation
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/GraphicsViewBenchmark.pro b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/GraphicsViewBenchmark.pro
index b0bc021b0a..a6ed4b84fb 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/GraphicsViewBenchmark.pro
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/GraphicsViewBenchmark.pro
@@ -1,7 +1,7 @@
TEMPLATE = app
QT += svg testlib
-contains(QT_CONFIG, opengl):QT += opengl
+qtHaveModule(opengl): QT += opengl
HEADERS += widgets/gvbwidget.h \
widgets/abstractscrollarea.h \
diff --git a/tests/benchmarks/gui/graphicsview/graphicsview.pro b/tests/benchmarks/gui/graphicsview/graphicsview.pro
index f8ba062829..d89a00c4b9 100644
--- a/tests/benchmarks/gui/graphicsview/graphicsview.pro
+++ b/tests/benchmarks/gui/graphicsview/graphicsview.pro
@@ -8,7 +8,7 @@ SUBDIRS = \
qgraphicsview \
qgraphicswidget
-isEmpty(QT.widgets.name): SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
qgraphicsanchorlayout \
qgraphicsitem \
qgraphicsscene \
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.pro b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.pro
index 759216d46d..4047bad1ca 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.pro
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.pro
@@ -4,7 +4,7 @@ HEADERS += mainwindow.h view.h chip.h
SOURCES += main.cpp
SOURCES += mainwindow.cpp view.cpp chip.cpp
-contains(QT_CONFIG, opengl):QT += opengl
+qtHaveModule(opengl): QT += opengl
build_all:!build_pass {
CONFIG -= build_all
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.pri b/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.pri
index 8d02504b73..105117de30 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.pri
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.pri
@@ -10,4 +10,4 @@ RESOURCES += \
chiptester/images.qrc
QT += widgets
-contains(QT_CONFIG, opengl) QT += opengl
+qtHaveModule(opengl): QT += opengl
diff --git a/tests/benchmarks/gui/gui.pro b/tests/benchmarks/gui/gui.pro
index f4b84f0428..e943347938 100644
--- a/tests/benchmarks/gui/gui.pro
+++ b/tests/benchmarks/gui/gui.pro
@@ -17,5 +17,5 @@ TRUSTED_BENCHMARKS += \
include(../trusted-benchmarks.pri)
-isEmpty(QT.widgets.name): SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
itemviews
diff --git a/tests/benchmarks/gui/image/image.pro b/tests/benchmarks/gui/image/image.pro
index fa26f3ec4c..2d5db35a73 100644
--- a/tests/benchmarks/gui/image/image.pro
+++ b/tests/benchmarks/gui/image/image.pro
@@ -6,5 +6,5 @@ SUBDIRS = \
qpixmap \
qpixmapcache
-isEmpty(QT.widgets.name): SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
qimagereader
diff --git a/tests/benchmarks/gui/kernel/kernel.pro b/tests/benchmarks/gui/kernel/kernel.pro
index 303eff9759..cd7235cff8 100644
--- a/tests/benchmarks/gui/kernel/kernel.pro
+++ b/tests/benchmarks/gui/kernel/kernel.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
-!isEmpty(QT.widgets.name):SUBDIRS = \
+qtHaveModule(widgets): SUBDIRS = \
qapplication \
qwidget
diff --git a/tests/benchmarks/gui/painting/painting.pro b/tests/benchmarks/gui/painting/painting.pro
index e55222a2c2..b3fb34757c 100644
--- a/tests/benchmarks/gui/painting/painting.pro
+++ b/tests/benchmarks/gui/painting/painting.pro
@@ -6,7 +6,7 @@ SUBDIRS = \
qtracebench \
qtbench
-isEmpty(QT.widgets.name): SUBDIRS -= \
+!qtHaveModule(widgets): SUBDIRS -= \
qpainter \
qtracebench \
qtbench
diff --git a/tests/benchmarks/gui/styles/styles.pro b/tests/benchmarks/gui/styles/styles.pro
index 8930de127b..2c1d10b48c 100644
--- a/tests/benchmarks/gui/styles/styles.pro
+++ b/tests/benchmarks/gui/styles/styles.pro
@@ -1,3 +1,3 @@
TEMPLATE = subdirs
-!isEmpty(QT.widgets.name):SUBDIRS = \
+qtHaveModule(widgets): SUBDIRS = \
qstylesheetstyle
diff --git a/tests/manual/lance/lance.pro b/tests/manual/lance/lance.pro
index 6d1d7fa392..177ca0e40e 100644
--- a/tests/manual/lance/lance.pro
+++ b/tests/manual/lance/lance.pro
@@ -13,6 +13,6 @@ SOURCES += interactivewidget.cpp \
RESOURCES += icons.qrc \
$$LANCELOT_DIR/images.qrc
-contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl
+qtHaveModule(opengl): QT += opengl
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0