Hmm the code seems to have disappeared and I can't edit or delete the original post. 
Excerpt from AddEditEmployerView.qml:
folder: employersController.picturesLocation()
folder: employersController.picturesLocation()
To copy to clipboard, switch view to plain text mode
Excerpt from EmployersController.h:
#include <QDebug>
#include <QStandardPaths>
#include <QUrl>
Q_INVOKABLE
QUrl picturesLocation
() { QUrl url
("file:///" + QStandardPaths
::standardLocations(QStandardPaths
::PicturesLocation).
at(0));
if (url.isEmpty())
qDebug() << "Empty url!";
else if (!url.isValid())
qDebug() << "Invalid url!";
else
qDebug() << url;
return url;
}
#include <QDebug>
#include <QStandardPaths>
#include <QUrl>
Q_INVOKABLE QUrl picturesLocation() {
QUrl url("file:///" + QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).at(0));
if (url.isEmpty())
qDebug() << "Empty url!";
else if (!url.isValid())
qDebug() << "Invalid url!";
else
qDebug() << url;
return url;
}
To copy to clipboard, switch view to plain text mode
Bookmarks