1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QFILESYSTEMWATCHER_H
5#define QFILESYSTEMWATCHER_H
6
7#include <QtCore/qobject.h>
8
9QT_REQUIRE_CONFIG(filesystemwatcher);
10
11QT_BEGIN_NAMESPACE
12
13
14class QFileSystemWatcherPrivate;
15
16class Q_CORE_EXPORT QFileSystemWatcher : public QObject
17{
18 Q_OBJECT
19 Q_DECLARE_PRIVATE(QFileSystemWatcher)
20
21public:
22 QFileSystemWatcher(QObject *parent = nullptr);
23 QFileSystemWatcher(const QStringList &paths, QObject *parent = nullptr);
24 ~QFileSystemWatcher();
25
26 bool addPath(const QString &file);
27 QStringList addPaths(const QStringList &files);
28 bool removePath(const QString &file);
29 QStringList removePaths(const QStringList &files);
30
31 QStringList files() const;
32 QStringList directories() const;
33
34Q_SIGNALS:
35 void fileChanged(const QString &path, QPrivateSignal);
36 void directoryChanged(const QString &path, QPrivateSignal);
37
38private:
39 Q_PRIVATE_SLOT(d_func(), void _q_fileChanged(const QString &path, bool removed))
40 Q_PRIVATE_SLOT(d_func(), void _q_directoryChanged(const QString &path, bool removed))
41};
42
43QT_END_NAMESPACE
44
45#endif // QFILESYSTEMWATCHER_H
46

source code of qtbase/src/corelib/io/qfilesystemwatcher.h