程序
.h #ifndef WIDGET_H #define WIDGET_H #include <QWidget> #include <QLabel> #include <QFileSystemWatcher> class Widget : public QWidget { Q_OBJECT public: Widget(QWidget *parent = 0); ~Widget(); public slots: void directroyChanged(QString path); private: QLabel *pathLabel; QFileSystemWatcher fsWatcher; }; #endif // WIDGET_H
.cpp #include "widget.h" #include <QVBoxLayout> #include <QDir> #include <QMessageBox> #include <QApplication> Widget::Widget(QWidget *parent) : QWidget(parent) { QStringList args=qApp->arguments(); QString path; if(args.count()>1) { path=args[1]; } else { path=QDir::currentPath(); } pathLabel=new QLabel; pathLabel->setText("监视的目录"+path); QVBoxLayout*mainLayout=new QVBoxLayout(this); mainLayout->addWidget(pathLabel); fsWatcher.addPath(path); connect(&fsWatcher,SIGNAL(directoryChanged(QString)),this,SLOT(directroyChanged(QString))); } Widget::~Widget() { } void Widget::directroyChanged(QString path) { QMessageBox::information(NULL,"目录发生变化",path); }
效果展示
本网页所有视频内容由 imoviebox边看边下-网页视频下载, iurlBox网页地址收藏管理器 下载并得到。
ImovieBox网页视频下载器 下载地址: ImovieBox网页视频下载器-最新版本下载
本文章由: imapbox邮箱云存储,邮箱网盘,ImageBox 图片批量下载器,网页图片批量下载专家,网页图片批量下载器,获取到文章图片,imoviebox网页视频批量下载器,下载视频内容,为您提供.
阅读和此文章类似的: 全球云计算