mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Map: try to wait for Map to load
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
dff6c001d7
commit
7c92c7dc0a
2 changed files with 13 additions and 2 deletions
|
@ -22,7 +22,17 @@ MapWidget::MapWidget(QWidget *parent) : QQuickWidget(parent)
|
||||||
qmlRegisterType<MapLocationModel>("org.subsurfacedivelog.mobile", 1, 0, "MapLocationModel");
|
qmlRegisterType<MapLocationModel>("org.subsurfacedivelog.mobile", 1, 0, "MapLocationModel");
|
||||||
qmlRegisterType<MapLocation>("org.subsurfacedivelog.mobile", 1, 0, "MapLocation");
|
qmlRegisterType<MapLocation>("org.subsurfacedivelog.mobile", 1, 0, "MapLocation");
|
||||||
|
|
||||||
|
connect(this, &QQuickWidget::statusChanged, this, &MapWidget::doneLoading);
|
||||||
setSource(QUrl(QStringLiteral("qrc:/MapWidget.qml")));
|
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);
|
setResizeMode(QQuickWidget::SizeRootObjectToView);
|
||||||
|
|
||||||
m_rootItem = qobject_cast<QQuickItem *>(rootObject());
|
m_rootItem = qobject_cast<QQuickItem *>(rootObject());
|
||||||
|
|
|
@ -34,6 +34,7 @@ public slots:
|
||||||
void prepareForGetDiveCoordinates();
|
void prepareForGetDiveCoordinates();
|
||||||
void selectedDivesChanged(QList<int>);
|
void selectedDivesChanged(QList<int>);
|
||||||
void coordinatesChangedLocal();
|
void coordinatesChangedLocal();
|
||||||
|
void doneLoading(QQuickWidget::Status status);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setEditMode(bool editMode);
|
void setEditMode(bool editMode);
|
||||||
|
|
Loading…
Add table
Reference in a new issue