ui(new Ui::Dialog)
{
ui->setupUi(this);
/* timer = new QTimer(this);
timer->start(100);*/
watcher.addPath("/mnt/rd/frame.jpg");
hsvSaveConnect();
checkBox();
connect(ui->save,SIGNAL(clicked()),this,SLOT(saveValueToSD()));
connect(ui->load,SIGNAL(clicked()),this,SLOT(loadInitValue()));
connect(&watcher,
SIGNAL(fileChanged
(const QString &)),
this,
SLOT(loadImage
()));
connect(&watcher,
SIGNAL(directoryChanged
(const QString &)),
this,
SLOT(loadImage
()));
qDebug() << watcher.files() << watcher.directories();
}
void Dialog::loadImage()
{
qDebug() << "img loaded";
QPixmap original
("/mnt/rd/frame.jpg");
if(original.isNull())
{
qDebug()<<"Failed to load image.";
}
ui->original->setPixmap(original);
}
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
/* timer = new QTimer(this);
timer->start(100);*/
QFileSystemWatcher watcher;
watcher.addPath("/mnt/rd/frame.jpg");
hsvSaveConnect();
checkBox();
connect(ui->save,SIGNAL(clicked()),this,SLOT(saveValueToSD()));
connect(ui->load,SIGNAL(clicked()),this,SLOT(loadInitValue()));
connect(&watcher,SIGNAL(fileChanged(const QString &)),this,SLOT(loadImage()));
connect(&watcher,SIGNAL(directoryChanged(const QString &)),this,SLOT(loadImage()));
qDebug() << watcher.files() << watcher.directories();
}
void Dialog::loadImage()
{
qDebug() << "img loaded";
QPixmap original("/mnt/rd/frame.jpg");
if(original.isNull())
{
qDebug()<<"Failed to load image.";
}
ui->original->setPixmap(original);
}
To copy to clipboard, switch view to plain text mode
Bookmarks