#include <QDebug>
#include <QDir>
#include <QFile>
+#include <QtConcurrentRun>
#include <QtDeclarative>
// search Paths seem to be broken in Harmattan?
stationListProxyModel(new StationListProxyModel(this))
{
showFullScreen();
- stationListModel->load(trueFilePath("stations:stations.qpl"));
+ future = QtConcurrent::run(
+ stationListModel, &StationListModel::load,
+ trueFilePath("stations:stations.qpl"));
stationListProxyModel->setSourceModel(stationListModel);
// the qml dir, then load the file.
// m_view->setSource(QUrl::fromLocalFile("qml:main.qml"));
setSource(QUrl::fromLocalFile(trueFilePath("qml:main.qml")));
+}
+View::~View()
+{
+ future.waitForFinished();
}
*/
+#include <QFuture>
#include <QDeclarativeView>
class StationListModel;
Q_OBJECT
public:
explicit View(QWidget *parent = 0);
+ ~View();
signals:
public slots:
private:
- StationListModel *stationListModel;
- StationListProxyModel *stationListProxyModel;
+ QFuture<void> future;
+ StationListModel *stationListModel;
+ StationListProxyModel *stationListProxyModel;
};
#endif // QP_VIEW_H