// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
    \title Qt Quick Demo - StocQt
    \examplecategory {Data Visualization & 3D}
    \ingroup qtquickdemos
    \example demos/stocqt
    \brief A configurable stock chart for the NASDAQ-100.
    \meta {tag} {demo,quick,game}
    \borderedimage qtquick-demo-stocqt.png

    The \e{StocQt} application presents a trend chart for the first stock in
    the list of NASDAQ-100 stocks. It allows the user to choose another stock
    from the list, and fetches the required data from the offline dataset
    using \c XMLHttpRequest.

    The application uses several custom types such as Button, CheckBox,
    StockChart, StockInfo, StockView, and so on. These types are used to
    present the stock data in a readable form and also let the user customize
    the trend chart. For example, the user can choose to view the weekly,
    monthly, quarterly, or half yearly trends in the stock price.

    The application uses the ObjectModel type to access the two visual data
    models that it depends on.

    \quotefromfile demos/stocqt/stocqt.qml
    \skipto ListView
    \printuntil id
    \dots 8
    \skipto model
    \printuntil StockView
    \printuntil }
    \printuntil }
    \printuntil }

    The StockListView model is a static data model listing the
    NASDAQ-100 stocks with basic information such as stockId, name, value,
    change, and so on. This data model is used by the application if the
    user wants to choose another stock from the list.

    StockView is a complex data model that presents a trend chart for the
    selected stock. It uses another custom type, StockChart, which presents
    the graphical trend of the stock price using a Canvas. This data model
    is used for most of the time during the lifetime of the application.

    \quotefromfile demos/stocqt/content/StockChart.qml
    \skipto Rectangle
    \printuntil id
    \dots
    \skipto Canvas
    \printuntil id
    \dots 8
    \skipto onPaint
    \printuntil /^\}$/

    To understand the application better, browse through its code using
    Qt Creator.

    \include examples-run.qdocinc

    \sa {QML Applications}
*/
