aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2016-11-16 14:22:36 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2016-11-29 10:10:27 +0000
commite579076bb36e6594003b2ade7f3d062944ef6f47 (patch)
tree1c00c8a02c638582d342504f3bebd45dbcd46be1 /tools
parent4e1463c20aa6ec52f23e1e5f6426b68edb2255f0 (diff)
Get rid of most QT_NO_FOO usages
Instead use QT_CONFIG(foo). This change actually detected a few mis-spelled macros and invalid usages. Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tools')
-rw-r--r--tools/qml/main.cpp10
-rw-r--r--tools/qmleasing/splineeditor.cpp4
-rw-r--r--tools/qmleasing/splineeditor.h4
-rw-r--r--tools/qmlscene/main.cpp16
4 files changed, 17 insertions, 17 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index 071908e78e..31fd9b383f 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -215,7 +215,7 @@ public Q_SLOTS:
returnCode = retCode;
}
-#if defined(QT_GUI_LIB) && !defined(QT_NO_OPENGL)
+#if defined(QT_GUI_LIB) && QT_CONFIG(opengl)
void onOpenGlContextCreated(QOpenGLContext *context);
#endif
};
@@ -237,7 +237,7 @@ void LoadWatcher::contain(QObject *o, const QUrl &containPath)
void LoadWatcher::checkForWindow(QObject *o)
{
-#if defined(QT_GUI_LIB) && !defined(QT_NO_OPENGL)
+#if defined(QT_GUI_LIB) && QT_CONFIG(opengl)
if (verboseMode && o->isWindowType() && o->inherits("QQuickWindow")) {
connect(o, SIGNAL(openglContextCreated(QOpenGLContext*)),
this, SLOT(onOpenGlContextCreated(QOpenGLContext*)));
@@ -247,7 +247,7 @@ void LoadWatcher::checkForWindow(QObject *o)
#endif // QT_GUI_LIB && !QT_NO_OPENGL
}
-#if defined(QT_GUI_LIB) && !defined(QT_NO_OPENGL)
+#if defined(QT_GUI_LIB) && QT_CONFIG(opengl)
void LoadWatcher::onOpenGlContextCreated(QOpenGLContext *context)
{
context->makeCurrent(qobject_cast<QWindow *>(sender()));
@@ -524,7 +524,7 @@ int main(int argc, char *argv[])
if (quietMode && verboseMode)
verboseMode = false;
-#ifndef QT_NO_TRANSLATION
+#if QT_CONFIG(translation)
//qt_ translations loaded by QQmlApplicationEngine
QString sysLocale = QLocale::system().name();
@@ -569,7 +569,7 @@ int main(int argc, char *argv[])
for (const QString &path : qAsConst(files)) {
//QUrl::fromUserInput doesn't treat no scheme as relative file paths
-#ifndef QT_NO_REGULAREXPRESSION
+#if QT_CONFIG(regularexpression)
QRegularExpression urlRe("[[:word:]]+://.*");
if (urlRe.match(path).hasMatch()) { //Treat as a URL
QUrl url = QUrl::fromUserInput(path);
diff --git a/tools/qmleasing/splineeditor.cpp b/tools/qmleasing/splineeditor.cpp
index 6fee013c62..01a279afbf 100644
--- a/tools/qmleasing/splineeditor.cpp
+++ b/tools/qmleasing/splineeditor.cpp
@@ -224,7 +224,7 @@ void SplineEditor::mouseReleaseEvent(QMouseEvent *e)
}
}
-#ifndef QT_NO_CONTEXTMENU
+#if QT_CONFIG(contextmenu)
void SplineEditor::contextMenuEvent(QContextMenuEvent *e)
{
int index = findControlPoint(e->pos());
@@ -244,7 +244,7 @@ void SplineEditor::contextMenuEvent(QContextMenuEvent *e)
addPoint(e->pos());
}
}
-#endif // QT_NO_CONTEXTMENU
+#endif // contextmenu
void SplineEditor::invalidate()
{
diff --git a/tools/qmleasing/splineeditor.h b/tools/qmleasing/splineeditor.h
index 243e199cd0..414b787bc3 100644
--- a/tools/qmleasing/splineeditor.h
+++ b/tools/qmleasing/splineeditor.h
@@ -79,9 +79,9 @@ protected:
void mousePressEvent(QMouseEvent *);
void mouseMoveEvent(QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *);
-#ifndef QT_NO_CONTEXTMENU
+#if QT_CONFIG(contextmenu)
void contextMenuEvent(QContextMenuEvent *);
-#endif // QT_NO_CONTEXTMENU
+#endif // contextmenu
void invalidate();
void invalidateSmoothList();
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp
index db0af1d071..1e8d91a95b 100644
--- a/tools/qmlscene/main.cpp
+++ b/tools/qmlscene/main.cpp
@@ -289,7 +289,7 @@ static bool checkVersion(const QUrl &url)
static void displayFileDialog(Options *options)
{
-#if defined(QT_WIDGETS_LIB) && !defined(QT_NO_FILEDIALOG)
+#if defined(QT_WIDGETS_LIB) && QT_CONFIG(filedialog)
QString fileName = QFileDialog::getOpenFileName(0, "Open QML file", QString(), "QML Files (*.qml)");
if (!fileName.isEmpty()) {
QFileInfo fi(fileName);
@@ -301,7 +301,7 @@ static void displayFileDialog(Options *options)
#endif
}
-#ifndef QT_NO_TRANSLATION
+#if QT_CONFIG(translation)
static void loadTranslationFile(QTranslator &translator, const QString& directory)
{
translator.load(QLatin1String("qml_" )+QLocale::system().name(), directory + QLatin1String("/i18n"));
@@ -361,7 +361,7 @@ static void usage()
puts(" ");
exit(1);
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
// Listen on GL context creation of the QQuickWindow in order to print diagnostic output.
class DiagnosticGlContextCreationListener : public QObject {
Q_OBJECT
@@ -405,7 +405,7 @@ static void setWindowTitle(bool verbose, const QObject *topLevel, QWindow *windo
if (verbose) {
newTitle += QLatin1String(" [Qt ") + QLatin1String(QT_VERSION_STR) + QLatin1Char(' ')
+ QGuiApplication::platformName() + QLatin1Char(' ');
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
newTitle += QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL
? QLatin1String("GL") : QLatin1String("GLES");
#endif
@@ -509,7 +509,7 @@ int main(int argc, char ** argv)
}
}
-#ifndef QT_NO_TRANSLATION
+#if QT_CONFIG(translation)
QTranslator translator;
QTranslator qtTranslator;
QString sysLocale = QLocale::system().name();
@@ -545,7 +545,7 @@ int main(int argc, char ** argv)
if (!options.url.isEmpty()) {
if (!options.versionDetection || checkVersion(options.url)) {
-#ifndef QT_NO_TRANSLATION
+#if QT_CONFIG(translation)
QTranslator translator;
#endif
@@ -559,7 +559,7 @@ int main(int argc, char ** argv)
engine.addPluginPath(pluginPaths.at(i));
if (options.url.isLocalFile()) {
QFileInfo fi(options.url.toLocalFile());
-#ifndef QT_NO_TRANSLATION
+#if QT_CONFIG(translation)
loadTranslationFile(translator, fi.path());
#endif
loadDummyDataFiles(engine, fi.path());
@@ -598,7 +598,7 @@ int main(int argc, char ** argv)
if (window) {
setWindowTitle(options.verbose, topLevel, window.data());
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (options.verbose)
new DiagnosticGlContextCreationListener(window.data());
#endif