这是一个用来监控本地文件夹变化的服务
w1146869587
2021-11-05 d47914155055418fc8e01791fcca71c9c1efb064
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <QCoreApplication>
#include "mbwatchapp.h"
 
int main(int argc, char *argv[])
{
#if !defined(Q_OS_WIN)
    // QtService stores service settings in SystemScope, which normally require root privileges.
    // To allow testing this example as non-root, we change the directory of the SystemScope settings file.
    QSettings::setPath(QSettings::NativeFormat, QSettings::SystemScope, QDir::tempPath());
    qWarning("(Example uses dummy settings file: %s/QtSoftware.conf)", QDir::tempPath().toLatin1().constData());
#endif
    CMBWatchApp service(argc, argv);
    return service.exec();
}