summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-09-26 08:56:36 +0200
committerLiang Qi <liang.qi@qt.io>2018-09-27 08:18:55 +0000
commit555a6b5d5d2dd91a0dcf9e3d5fbadd1b31bf80f3 (patch)
treee0faaad63a8dc4055807a72ecce89cf7dc0d1cb2 /examples
parent5e64957ee4162ecf4456306a530a68761c2b127f (diff)
Modernize the "filesystemwatcher" feature
Change-Id: If030b56ad97e047d89d442629262b4839df306d4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/opengl/qopenglwindow/background_renderer.cpp2
-rw-r--r--examples/opengl/qopenglwindow/background_renderer.h4
2 files changed, 4 insertions, 2 deletions
diff --git a/examples/opengl/qopenglwindow/background_renderer.cpp b/examples/opengl/qopenglwindow/background_renderer.cpp
index cba4ae1f2f..9da1b9bf99 100644
--- a/examples/opengl/qopenglwindow/background_renderer.cpp
+++ b/examples/opengl/qopenglwindow/background_renderer.cpp
@@ -84,7 +84,7 @@ FragmentToy::FragmentToy(const QString &fragmentSource, QObject *parent)
QFileInfo info(fragmentSource);
m_fragment_file_last_modified = info.lastModified();
m_fragment_file = fragmentSource;
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
m_watcher.addPath(info.canonicalPath());
QObject::connect(&m_watcher, &QFileSystemWatcher::directoryChanged, this, &FragmentToy::fileChanged);
#endif
diff --git a/examples/opengl/qopenglwindow/background_renderer.h b/examples/opengl/qopenglwindow/background_renderer.h
index f7683db3d6..d99b7ddbeb 100644
--- a/examples/opengl/qopenglwindow/background_renderer.h
+++ b/examples/opengl/qopenglwindow/background_renderer.h
@@ -54,7 +54,9 @@
#include <QObject>
#include <QFile>
#include <QDateTime>
+#if QT_CONFIG(filesystemwatcher)
#include <QFileSystemWatcher>
+#endif
#include <QOpenGLVertexArrayObject>
#include <QOpenGLBuffer>
#include <QOpenGLShaderProgram>
@@ -71,7 +73,7 @@ public:
private:
void fileChanged(const QString &path);
bool m_recompile_shaders;
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
QFileSystemWatcher m_watcher;
#endif
QString m_fragment_file;