Qt6: don't build MapWidget

Since Qt6 doesn't include QtLocation anymore, we can't build MapWidget.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2022-02-09 15:56:36 -08:00
parent ce254bee57
commit 47d900bee5
5 changed files with 23 additions and 0 deletions

View file

@ -148,7 +148,9 @@ void DiveFilter::startFilterDiveSites(QVector<dive_site *> ds)
dive_sites = ds;
// When switching into dive site mode, reload the dive sites.
// TODO: why here? why not catch the filterReset signal in the map widget
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
MapWidget::instance()->reload();
#endif
emit diveListNotifier.filterReset();
}
}
@ -159,7 +161,9 @@ void DiveFilter::stopFilterDiveSites()
return;
dive_sites.clear();
emit diveListNotifier.filterReset();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
MapWidget::instance()->reload();
#endif
}
void DiveFilter::setFilterDiveSite(QVector<dive_site *> ds)
@ -172,8 +176,10 @@ void DiveFilter::setFilterDiveSite(QVector<dive_site *> ds)
dive_sites = ds;
emit diveListNotifier.filterReset();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
MapWidget::instance()->setSelected(dive_sites);
MapWidget::instance()->selectionChanged();
#endif
MainWindow::instance()->diveList->expandAll();
}

View file

@ -523,7 +523,9 @@ void DiveListView::selectionChangeDone()
if (d->selected && !d->hidden_by_filter && d->dive_site && !selectedSites.contains(d->dive_site))
selectedSites.push_back(d->dive_site);
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
MapWidget::instance()->setSelected(selectedSites);
#endif
}
emit divesSelected();
}

View file

@ -132,7 +132,9 @@ MainWindow::MainWindow() : QMainWindow(),
// for the "default" mode
mainTab.reset(new MainTab);
diveList.reset(new DiveListView);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
mapWidget.reset(MapWidget::instance()); // Yes, this is ominous see comment in mapwidget.cpp.
#endif
plannerWidgets.reset(new PlannerWidgets);
statistics.reset(new StatsWidget);
profile.reset(new ProfileWidget);
@ -198,7 +200,9 @@ MainWindow::MainWindow() : QMainWindow(),
initialUiSetup();
readSettings();
diveList->setFocus();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
MapWidget::instance()->reload();
#endif
diveList->expand(diveList->model()->index(0, 0));
diveList->scrollTo(diveList->model()->index(0, 0), QAbstractItemView::PositionAtCenter);
#ifdef NO_USERMANUAL
@ -327,7 +331,9 @@ void MainWindow::selectionChanged()
if (current_dive)
enableDisableOtherDCsActions();
profile->plotCurrentDive();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
MapWidget::instance()->selectionChanged();
#endif
}
void MainWindow::on_actionNew_triggered()
@ -508,7 +514,9 @@ void MainWindow::closeCurrentFile()
clear_dive_file_data(); // this clears all the core data structures and resets the models
setCurrentFile(nullptr);
diveList->setSortOrder(DiveTripModelBase::NR, Qt::DescendingOrder);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
MapWidget::instance()->reload();
#endif
if (!existing_filename)
setTitle();
disableShortcuts();

View file

@ -89,8 +89,10 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
connect(&diveListNotifier, &DiveListNotifier::settingsChanged, this, &MainTab::updateDiveInfo);
connect(ui.editDiveSiteButton, &QToolButton::clicked, MainWindow::instance(), &MainWindow::startDiveSiteEdit);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
connect(ui.location, &DiveLocationLineEdit::entered, MapWidget::instance(), &MapWidget::centerOnIndex);
connect(ui.location, &DiveLocationLineEdit::currentChanged, MapWidget::instance(), &MapWidget::centerOnIndex);
#endif
connect(ui.location, &DiveLocationLineEdit::editingFinished, this, &MainTab::on_location_diveSiteSelected);
// One might think that we could listen to the precise property-changed signals of the preferences system.

View file

@ -2,8 +2,11 @@
#include <QQmlEngine>
#include <QQuickItem>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include "map-widget/qmlmapwidgethelper.h"
#include "qt-models/maplocationmodel.h"
#endif
#include "stats/statsview.h"
#include "core/qt-gui.h"
#include "core/settings/qPref.h"
@ -222,7 +225,9 @@ static void register_qml_types(QQmlEngine *engine)
register_qml_type<ChartListModel>("ChartListModel");
#endif // not SUBSURFACE_MOBILE
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
register_qml_type<MapWidgetHelper>("MapWidgetHelper");
register_qml_type<MapLocationModel>("MapLocationModel");
#endif
register_qml_type<StatsView>("StatsView");
}