Map: try to wait for Map to load

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-07-28 21:19:00 -07:00
parent dff6c001d7
commit 7c92c7dc0a
2 changed files with 13 additions and 2 deletions

View file

@ -22,7 +22,17 @@ MapWidget::MapWidget(QWidget *parent) : QQuickWidget(parent)
qmlRegisterType<MapLocationModel>("org.subsurfacedivelog.mobile", 1, 0, "MapLocationModel");
qmlRegisterType<MapLocation>("org.subsurfacedivelog.mobile", 1, 0, "MapLocation");
connect(this, &QQuickWidget::statusChanged, this, &MapWidget::doneLoading);
setSource(QUrl(QStringLiteral("qrc:/MapWidget.qml")));
}
void MapWidget::doneLoading(QQuickWidget::Status status)
{
if (status != QQuickWidget::Ready) {
qDebug() << "MapWidget status" << status;
return;
}
qDebug() << "MapWidget ready";
setResizeMode(QQuickWidget::SizeRootObjectToView);
m_rootItem = qobject_cast<QQuickItem *>(rootObject());

View file

@ -34,6 +34,7 @@ public slots:
void prepareForGetDiveCoordinates();
void selectedDivesChanged(QList<int>);
void coordinatesChangedLocal();
void doneLoading(QQuickWidget::Status status);
private:
void setEditMode(bool editMode);