/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** 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 Digia.  For licensing terms and
** conditions see http://qt.digia.com/licensing.  For further information
** use the contact form at http://qt.digia.com/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: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
    \group qtquickcontrols_examples
    \ingroup all-examples
    \title Qt Quick Controls Examples
    \brief A Collection of examples for \l{Qt Quick Controls}, written in QML.

    These examples show how to create user interfaces using
    \l{Qt Quick Controls}.
*/

/*!
    \example gallery
    \title Qt Quick Controls - Gallery
    \ingroup qtquickcontrols_examples
    \brief A collection of components for a classic desktop-style UI.
    \image qtquickcontrols-example-gallery.png

    This example project demonstrates the various UI components provided by
    \l{Qt Quick Controls}.

    \include examples-run.qdocinc
*/

/*!
    \example basiclayouts
    \title Qt Quick Controls - Basic Layouts Example
    \ingroup qtquickcontrols_examples
    \brief Demonstrates how to use layout types to arrange a UI
    \image qtquickcontrols-example-basiclayouts.png

    This example shows how to easily arrange UI components into
    \l{Qt Quick Layouts}{layouts} with \l{GridLayout}, \l{RowLayout}, and
    \l{ColumnLayout}.

    \include examples-run.qdocinc
*/

/*!
    \example splitview
    \title Qt Quick Controls - Split View Example
    \ingroup qtquickcontrols_examples
    \brief An example for the SplitView UI control.
    \image qtquickcontrols-example-splitview.png

    This example project demonstrates the usage of \l {SplitView} from
    \l{Qt Quick Controls} - a control that lays out items horizontally or
    vertically with a draggable splitter between each item.

    \include examples-run.qdocinc
*/

/*!
    \example tableview
    \title Qt Quick Controls - Table View Example
    \ingroup qtquickcontrols_examples
    \brief An example for the TableView control.
    \image qtquickcontrols-example-tableview.png

    This example shows how a \l{TableView} from \l{Qt Quick Controls}
    can be used together with different types of data models to display
    lists of information with support for scroll bars, selections and
    resizable header sections.

    \include examples-run.qdocinc
*/

/*!
    \example texteditor
    \title Qt Quick Controls - Text Editor Example
    \ingroup qtquickcontrols_examples
    \brief A QML app using Qt Quick Controls and a C++ class to
    provide a fully-functional rich-text editor application.

    \image qtquickcontrols-example-text.png

    The \e{Text Editor Example} presents a sample HTML file using the TextArea
    control, preserving the HTML formatting. It uses a C++ class to handle the
    document by providing options to open, format, and edit. The app also lets
    you open and edit a plain text files.

    The C++ class, DocumentHandler, extends QObject and is registered
    as a QML type under the namespace, "\c{org.qtproject.example 1.0}".

    The following snippets show how the type is registered under
    a namespace and later imported by \e main.qml.

    QML type registration:

    \code
    #include <QtQml/qqml.h>
    ...
    qmlRegisterType<DocumentHandler>("org.qtproject.example", 1, 0, "DocumentHandler");
    ...
    \endcode

    QML namespace import:

    \qml
    import org.qtproject.example 1.0
    \endqml

    For more information about registering C++ classses as QML types, see
    \l {Defining QML Types from C++}.

    \include examples-run.qdocinc
*/

/*!
    \example touch
    \title Qt Quick Controls - Touch Gallery
    \ingroup qtquickcontrols_examples
    \brief Demonstrates UI controls for a touch interface
    \image qtquickcontrols-example-touch.png

    This example shows how to implement a UI suitable
    for touch input using \l{Qt Quick Controls}.

    \include examples-run.qdocinc
*/

/*!
    \example calendar
    \title Qt Quick Controls - Calendar Example
    \ingroup qtquickcontrols_examples
    \brief Demonstrates the use of Calendar control
    \image qtquickcontrols-example-calendar.png

    The Calendar example displays a Calendar control and an events list for
    the selected date. It uses a C++ class to fetch the event details from an
    SQLite database. The example app uses a custom CalendarStyle to highlight
    the selected date and mark the dates that have events.

    The following snippet from \e main.qml shows how the Calendar control is
    used in the app:

    \code
    Calendar {
        id: calendar
        width: (parent.width > parent.height ? parent.width * 0.6 - parent.spacing : parent.width)
        height: (parent.height > parent.width ? parent.height * 0.6 - parent.spacing : parent.height)
        frameVisible: true
        weekNumbersVisible: true
        selectedDate: new Date(2014, 0, 1)
        focus: true

        style: CalendarStyle {
            dayDelegate: Item {
                     ...
                }
           }
    }
    \endcode

    The C++ class, SqlEventModel, inherits SqlQueryModel to create a database
    with dummy events for certain dates.

    \quotefromfile calendar/src/sqleventmodel.cpp
    \skipto SqlEventModel::SqlEventModel()
    \printto QList
    \skipto void SqlEventModel
    \printuntil /\^}

    In \e main.qml, the SqlEventModel custom type is used to get the list of
    events to mark the dates on the calendar.

    \code
    SqlEventModel {
        id: eventModel
    }

    Calendar {
        ...
        style: CalendarStyle {
            dayDelegate: Item {
                ...
                Image {
                    visible: eventModel.eventsForDate(styleData.date).length > 0
                    ...
                    source: "qrc:/images/eventindicator.png"
                }
            }
        }
    }
    \endcode

    The app uses a Flow type to position the items, and manipulates the
    items' width and height based on the orientation change on mobile devices.

    \code
    Calendar {
        id: calendar
        width: (parent.width > parent.height ? parent.width * 0.6 - parent.spacing : parent.width)
        height: (parent.height > parent.width ? parent.height * 0.6 - parent.spacing : parent.height)
    }

    Rectangle {
        width: (parent.width > parent.height ? parent.width * 0.4 - parent.spacing : parent.width)
        height: (parent.height > parent.width ? parent.height * 0.4 - parent.spacing : parent.height)
        border.color: Qt.darker(color, 1.2)

        ListView {
            ...
        }
    }
    \endcode
    \include examples-run.qdocinc
*/
