main.cpp Example File
picturetransfer/main.cpp
#include <QGuiApplication>
#include <QtQml/QQmlEngine>
#include <QtQuick/QQuickView>
#include <QDebug>
#include <QQmlContext>
#include <QStandardPaths>
#include "filetransfer.h"
int main(int argc, char *argv[])
{
QGuiApplication application(argc, argv);
QQuickView view;
FileTransfer fileTransfer;
view.rootContext()->setContextProperty("fileTransfer", QVariant::fromValue(&fileTransfer));
view.rootContext()->setContextProperty("SystemPictureFolder",
QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).first());
qDebug() << QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);
view.setSource(QUrl(QStringLiteral("qrc:/bttransfer.qml")));
view.setResizeMode(QQuickView::SizeRootObjectToView);
QObject::connect(view.engine(), SIGNAL(quit()), qApp, SLOT(quit()));
view.show();
return application.exec();
}