/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
    \example satelliteinfo
    \title SatelliteInfo (C++/QML)

    \brief The SatelliteInfo example shows the available satellites
    at the user's current position and marks the satellites
    currently contributing to the GPS fix as pink.

    \ingroup qtpositioning-examples

    Key \l{Qt Positioning} classes used in this example:

    \list
    \li \l{QGeoSatelliteInfo}
    \li \l{QGeoSatelliteInfoSource}
    \endlist

    \image ../images/example-satelliteinfo.png

    The example displays the signal strength of all satellites in view. Any
    satellite that is currently used to calculate the GPS fix is marked pink.
    The number at the bottom of each signal bar is the individual satellite
    identifier.

    The application operates in three different modes:

    \table
        \header
            \li Application mode
            \li Description
        \row
            \li running
            \li The application continuously queries the system for satellite updates. When new data
                is available it will be displayed.
        \row
            \li stopped
            \li The application stops updating the satellite information.
        \row
            \li single
            \li The application makes a single update request with a timeout of 10s. The display
                remains empty until the request was answered by the system.
    \endtable

    If the platform does not provide satellite information, the application
    automatically switches into a demo mode, whereby it continuously switches
    between predefined sets of satellite data.

    \include examples-run.qdocinc

    \section1 Satellite Info Model

    The key part of this example is the \c SatelliteModel data model. It
    represents the information about the satellites.
    It uses the \l Q_PROPERTY and \l QML_ELEMENT macros, so that it can be
    available from QML.

    \snippet satelliteinfo/satellitemodel.h 0
    \snippet satelliteinfo/satellitemodel.h 1
    \snippet satelliteinfo/satellitemodel.h 2

    The \c SatelliteModel object creates an instance of
    \l QGeoSatelliteInfoSource using the \l {QGeoSatelliteInfoSource::}
    {createDefaultSource()} method. Once the source is created, the
    \l {QGeoSatelliteInfoSource::}{satellitesInViewUpdated()} and
    \l {QGeoSatelliteInfoSource::}{satellitesInUseUpdated()} signals are used
    to notify about the changes in satellite information.

    \snippet satelliteinfo/satellitemodel.cpp 0

    The aforementioned signals provide the lists of \l QGeoSatelliteInfo
    objects that represent satellites in view and satellites in use,
    respectively. This data is used to update the model.

    \snippet satelliteinfo/satellitemodel.cpp 1

    If the satellite info source is not available, demo data is used to simulate
    satellite information updates.

    \snippet satelliteinfo/satellitemodel.cpp 2

    The model is later used in QML to visualize the data.

    \section1 Exposing the Model to QML

    To expose \c SatelliteModel to QML, we use the \l QML_ELEMENT macro.
    See the \l QQmlEngine class documentation for more details on it.

    To make the type available in QML, we need to update our build accordingly.

    \section2 CMake Build

    For a CMake-based build, we need to add the following to the
    \c {CMakeLists.txt}:

    \quotefromfile satelliteinfo/CMakeLists.txt
    \skipto qt_add_qml_module(satelliteinfo
    \printuntil )

    \section2 qmake Build

    For a qmake build, we need to modify the \c {satelliteinfo.pro} file in the
    following way:

    \quotefromfile satelliteinfo/satelliteinfo.pro
    \skipto CONFIG
    \printuntil QML_IMPORT_MAJOR_VERSION
*/
