diff options
Diffstat (limited to 'examples/sql/doc')
-rw-r--r-- | examples/sql/doc/images/books-demo.png | bin | 14782 -> 13975 bytes | |||
-rw-r--r-- | examples/sql/doc/images/drilldown-example.png | bin | 6612 -> 10335 bytes | |||
-rw-r--r-- | examples/sql/doc/src/books.qdoc | 29 | ||||
-rw-r--r-- | examples/sql/doc/src/cachedtable.qdoc | 35 | ||||
-rw-r--r-- | examples/sql/doc/src/drilldown.qdoc | 39 | ||||
-rw-r--r-- | examples/sql/doc/src/masterdetail.qdoc | 29 | ||||
-rw-r--r-- | examples/sql/doc/src/querymodel.qdoc | 29 | ||||
-rw-r--r-- | examples/sql/doc/src/relationaltablemodel.qdoc | 29 | ||||
-rw-r--r-- | examples/sql/doc/src/sqlbrowser.qdoc | 29 | ||||
-rw-r--r-- | examples/sql/doc/src/sqlwidgetmapper.qdoc | 40 | ||||
-rw-r--r-- | examples/sql/doc/src/tablemodel.qdoc | 29 |
11 files changed, 38 insertions, 250 deletions
diff --git a/examples/sql/doc/images/books-demo.png b/examples/sql/doc/images/books-demo.png Binary files differindex 77b3b308c9..29f5c84473 100644 --- a/examples/sql/doc/images/books-demo.png +++ b/examples/sql/doc/images/books-demo.png diff --git a/examples/sql/doc/images/drilldown-example.png b/examples/sql/doc/images/drilldown-example.png Binary files differindex 39a4117637..b6cf443e7c 100644 --- a/examples/sql/doc/images/drilldown-example.png +++ b/examples/sql/doc/images/drilldown-example.png diff --git a/examples/sql/doc/src/books.qdoc b/examples/sql/doc/src/books.qdoc index f65daed372..b4ca8bdd2e 100644 --- a/examples/sql/doc/src/books.qdoc +++ b/examples/sql/doc/src/books.qdoc @@ -1,34 +1,11 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! \example books \title Books \ingroup sql_examples + \examplecategory {Data Processing & I/O} \brief Shows how to use Qt SQL classes with a model/view framework. The Books example shows how Qt's SQL classes can be used with the model/view diff --git a/examples/sql/doc/src/cachedtable.qdoc b/examples/sql/doc/src/cachedtable.qdoc index 0dd7928e21..ff60f7b1b7 100644 --- a/examples/sql/doc/src/cachedtable.qdoc +++ b/examples/sql/doc/src/cachedtable.qdoc @@ -1,34 +1,11 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! \example cachedtable - \title Cached Table Example + \title Cached SQL Table \ingroup sql_examples + \examplecategory {Data Processing & I/O} \brief The Cached Table example shows how a table view can be used to access a database, caching any changes to the data until the user explicitly submits them using a @@ -38,7 +15,7 @@ The example consists of a single class, \c TableEditor, which is a custom dialog widget that allows the user to modify data stored in - a database. We will first review the class definiton and how to + a database. We will first review the class definition and how to use the class, then we will take a look at the implementation. \section1 TableEditor Class Definition @@ -64,7 +41,7 @@ We are also going to show how a table view can be used to cache any changes to the data until the user explicitly requests to submit them. For that reason we need to declare a \c submit() slot - in additon to the model and the editor's buttons. + in addition to the model and the editor's buttons. \table 100% \header \li Connecting to a Database diff --git a/examples/sql/doc/src/drilldown.qdoc b/examples/sql/doc/src/drilldown.qdoc index f43ba38a23..d334018b4a 100644 --- a/examples/sql/doc/src/drilldown.qdoc +++ b/examples/sql/doc/src/drilldown.qdoc @@ -1,34 +1,11 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! \example drilldown \title Drill Down Example \ingroup sql_examples + \examplecategory {Data Processing & I/O} \brief The Drill Down example shows how to read data from a database as well as submit changes, using the QSqlRelationalTableModel and @@ -69,8 +46,8 @@ \snippet drilldown/informationwindow.h 0 When we create an information window, we pass the associated - item ID, a parent, and a pointer to the database, to the - constructor. We will use the database pointer to populate our + item ID, a pointer to the model, and a parent to the + constructor. We will use the model pointer to populate our window with data, while passing the parent parameter on to the base class. The ID is stored for future reference. @@ -177,10 +154,6 @@ We need to use lambdas for connecting the \c enableButtons slot because its signature does not match \c QTextEdit::textChanged and \c QComboBox::currentIndexChanged. - Since the latter has another overload with the signature - \c {const QString &} and the selected signal would be ambiguous, - we need to use \c QOverload<int>::of to select a specific overload - for \c currentIndexChanged. We add all the widgets into a layout, store the item ID and the name of the displayed image file for future reference, and set @@ -307,7 +280,7 @@ The \c findWindow() function, on the other hand, is frequently used. It is called from the \c showInformation() function to - detemine whether a window is already created for the given + determine whether a window is already created for the given item (whenever we create an \c InformationWindow object, we store a reference to it in the \c informationWindows list). The latter function is in turn called from our custom \c diff --git a/examples/sql/doc/src/masterdetail.qdoc b/examples/sql/doc/src/masterdetail.qdoc index 033dd41f72..fec579a6a0 100644 --- a/examples/sql/doc/src/masterdetail.qdoc +++ b/examples/sql/doc/src/masterdetail.qdoc @@ -1,34 +1,11 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! \example masterdetail \title Master Detail Example \ingroup sql_examples + \examplecategory {Data Processing & I/O} \brief The Master Detail Example shows how to present data from different data sources in the same application. The album titles, and the diff --git a/examples/sql/doc/src/querymodel.qdoc b/examples/sql/doc/src/querymodel.qdoc index 4f14975234..c9fa4cec96 100644 --- a/examples/sql/doc/src/querymodel.qdoc +++ b/examples/sql/doc/src/querymodel.qdoc @@ -1,34 +1,11 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! \example querymodel \title Query Model Example \ingroup sql_examples + \examplecategory {Data Processing & I/O} \brief The Query Model example shows how to make customized versions of data obtained from a SQL query, using a model that encapsulates diff --git a/examples/sql/doc/src/relationaltablemodel.qdoc b/examples/sql/doc/src/relationaltablemodel.qdoc index 95648cdc78..371fef8133 100644 --- a/examples/sql/doc/src/relationaltablemodel.qdoc +++ b/examples/sql/doc/src/relationaltablemodel.qdoc @@ -1,34 +1,11 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! \example relationaltablemodel \title Relational Table Model Example \ingroup sql_examples + \examplecategory {Data Processing & I/O} \brief The Relational Table Model example shows how to use table views with a relational model to visualize the relations between items in a database. diff --git a/examples/sql/doc/src/sqlbrowser.qdoc b/examples/sql/doc/src/sqlbrowser.qdoc index 6eeb2376f3..ad783f5760 100644 --- a/examples/sql/doc/src/sqlbrowser.qdoc +++ b/examples/sql/doc/src/sqlbrowser.qdoc @@ -1,34 +1,11 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! \example sqlbrowser \title SQL Browser \ingroup sql_examples + \examplecategory {Data Processing & I/O} \brief The SQL Browser example shows how a data browser can be used to visualize the results of SQL statements on a live database. diff --git a/examples/sql/doc/src/sqlwidgetmapper.qdoc b/examples/sql/doc/src/sqlwidgetmapper.qdoc index a0fc26a642..0764e601c3 100644 --- a/examples/sql/doc/src/sqlwidgetmapper.qdoc +++ b/examples/sql/doc/src/sqlwidgetmapper.qdoc @@ -1,34 +1,11 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! \example sqlwidgetmapper \title SQL Widget Mapper Example \ingroup sql_examples + \examplecategory {Data Processing & I/O} \brief The SQL Widget Mapper example shows how to use a map information from a database to widgets on a form. @@ -125,8 +102,7 @@ As a result, the user is able to select an item from the combo box, and the associated value is written back to the model. - The rest of the constructor is very similar to that of the - \l{Simple Widget Mapper Example}: + The rest of the constructor sets up connections and layouts: \snippet sqlwidgetmapper/window.cpp Set up connections and layouts @@ -139,7 +115,7 @@ \section1 Delegate Class Definition and Implementation The delegate we use to mediate interaction between the widget mapper and - the input widgets is a small QItemDelegate subclass: + the input widgets is a small QStyledItemDelegate subclass: \snippet sqlwidgetmapper/delegate.h Delegate class definition @@ -150,7 +126,7 @@ Since we only provide an empty implementation of the constructor, we concentrate on the other two functions. - The \l{QItemDelegate::}{setEditorData()} implementation takes the data + The \l{QStyledItemDelegate::}{setEditorData()} implementation takes the data referred to by the model index supplied and processes it according to the presence of a \c currentIndex property in the editor widget: @@ -162,10 +138,10 @@ values needed for the \c currentIndex property. As a result, instead of showing "0", "1" or "2" in the combo box, one of - its predefined set of items is shown. We call QItemDelegate::setEditorData() + its predefined set of items is shown. We call QStyledItemDelegate::setEditorData() for widgets without the \c currentIndex property. - The \l{QItemDelegate::}{setModelData()} implementation performs the reverse + The \l{QStyledItemDelegate::}{setModelData()} implementation performs the reverse process, taking the value stored in the widget's \c currentIndex property and storing it back in the model: diff --git a/examples/sql/doc/src/tablemodel.qdoc b/examples/sql/doc/src/tablemodel.qdoc index 66d1801508..1542d121aa 100644 --- a/examples/sql/doc/src/tablemodel.qdoc +++ b/examples/sql/doc/src/tablemodel.qdoc @@ -1,34 +1,11 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! \example tablemodel \title Table Model Example \ingroup sql_examples + \examplecategory {Data Processing & I/O} \brief The Table Model example shows how to use a specialized SQL table model with table views to edit information in a database. |