Compare commits

...

2 Commits

Author SHA1 Message Date
Daniele Forsi b60eb5513d Prevent the dialogs to be hidden behind the main window
This also menas that when the main window is closed, the dialogs get
closed automatically, and not only when the map window is closed.
2024-04-14 19:43:55 +02:00
Daniele Forsi d09ee2d1f8 Update the IPB beacons table only when the dialog is visible 2024-04-14 19:43:44 +02:00
3 changed files with 19 additions and 5 deletions

View File

@ -198,9 +198,9 @@ MapGUI::MapGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur
m_polygonMapModel(this),
m_polylineMapModel(this),
m_beacons(nullptr),
m_beaconDialog(this),
m_ibpBeaconDialog(this),
m_radioTimeDialog(this),
m_beaconDialog(this, this),
m_ibpBeaconDialog(this, this),
m_radioTimeDialog(this, this),
m_cesium(nullptr),
m_legend(nullptr),
m_nasaWidget(nullptr),

View File

@ -32,7 +32,6 @@ MapIBPBeaconDialog::MapIBPBeaconDialog(MapGUI *gui, QWidget* parent) :
ui->setupUi(this);
connect(&m_timer, &QTimer::timeout, this, &MapIBPBeaconDialog::updateTime);
m_timer.setInterval(1000);
m_timer.start();
ui->beacons->setRowCount(IBPBeacon::m_frequencies.size());
for (int row = 0; row < IBPBeacon::m_frequencies.size(); row++)
{
@ -44,7 +43,6 @@ MapIBPBeaconDialog::MapIBPBeaconDialog(MapGUI *gui, QWidget* parent) :
ui->beacons->setItem(row, IBP_BEACON_COL_DISTANCE, new QTableWidgetItem(""));
}
resizeTable();
updateTable(QTime::currentTime());
}
MapIBPBeaconDialog::~MapIBPBeaconDialog()
@ -126,3 +124,17 @@ void MapIBPBeaconDialog::updateTime()
updateTable(t);
}
}
void MapIBPBeaconDialog::showEvent(QShowEvent *event)
{
(void) event;
updateTable(QTime::currentTime());
updateTime();
m_timer.start();
}
void MapIBPBeaconDialog::hideEvent(QHideEvent *event)
{
(void) event;
m_timer.stop();
}

View File

@ -43,6 +43,8 @@ private slots:
void accept();
void on_beacons_cellDoubleClicked(int row, int column);
void updateTime();
void showEvent(QShowEvent *event);
void hideEvent(QHideEvent *event);
private:
MapGUI *m_gui;