From 555a6b5d5d2dd91a0dcf9e3d5fbadd1b31bf80f3 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Wed, 26 Sep 2018 08:56:36 +0200 Subject: Modernize the "filesystemwatcher" feature Change-Id: If030b56ad97e047d89d442629262b4839df306d4 Reviewed-by: Edward Welbourne Reviewed-by: Ulf Hermann --- examples/opengl/qopenglwindow/background_renderer.cpp | 2 +- examples/opengl/qopenglwindow/background_renderer.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'examples') 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 #include #include +#if QT_CONFIG(filesystemwatcher) #include +#endif #include #include #include @@ -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; -- cgit v1.2.3