equal
deleted
inserted
replaced
39 ** |
39 ** |
40 ****************************************************************************/ |
40 ****************************************************************************/ |
41 |
41 |
42 #include <QApplication> |
42 #include <QApplication> |
43 #include <QMainWindow> |
43 #include <QMainWindow> |
|
44 #include <QMessageBox> |
44 #include <QTimer> |
45 #include <QTimer> |
45 #include <qgeopositioninfosource.h> |
46 #include <qgeopositioninfosource.h> |
46 #include <qgeosatelliteinfosource.h> |
47 #include <qgeosatelliteinfosource.h> |
47 |
48 |
48 #include "satellitedialog.h" |
49 #include "satellitedialog.h" |
56 SatelliteDialog::ExitOnCancel, |
57 SatelliteDialog::ExitOnCancel, |
57 SatelliteDialog::OrderByPrnNumber, |
58 SatelliteDialog::OrderByPrnNumber, |
58 SatelliteDialog::ScaleToMaxPossible); |
59 SatelliteDialog::ScaleToMaxPossible); |
59 |
60 |
60 QGeoPositionInfoSource *posSource = QGeoPositionInfoSource::createDefaultSource(0); |
61 QGeoPositionInfoSource *posSource = QGeoPositionInfoSource::createDefaultSource(0); |
|
62 QGeoSatelliteInfoSource *satSource = QGeoSatelliteInfoSource::createDefaultSource(0); |
|
63 |
|
64 if ((posSource == 0) || (satSource == 0)) { |
|
65 QMessageBox::critical(0, "SatelliteDialog", "This examples requires a valid location source and no valid location sources are available on this platform."); |
|
66 return -1; |
|
67 } |
|
68 |
61 posSource->setUpdateInterval(5000); |
69 posSource->setUpdateInterval(5000); |
62 QGeoSatelliteInfoSource *satSource = QGeoSatelliteInfoSource::createDefaultSource(0); |
|
63 |
70 |
64 dialog->connectSources(posSource, satSource); |
71 dialog->connectSources(posSource, satSource); |
65 |
72 |
66 posSource->startUpdates(); |
73 posSource->startUpdates(); |
67 satSource->startUpdates(); |
74 satSource->startUpdates(); |