diff options
Diffstat (limited to 'examples/widgets/doc')
-rw-r--r-- | examples/widgets/doc/dropsite.qdoc | 8 | ||||
-rw-r--r-- | examples/widgets/doc/src/addressbook.qdoc | 11 | ||||
-rw-r--r-- | examples/widgets/doc/src/diagramscene.qdoc | 2 | ||||
-rw-r--r-- | examples/widgets/doc/src/fetchmore.qdoc | 2 | ||||
-rw-r--r-- | examples/widgets/doc/src/orderform.qdoc | 2 | ||||
-rw-r--r-- | examples/widgets/doc/src/plugandpaint.qdoc | 4 | ||||
-rw-r--r-- | examples/widgets/doc/src/simpletreemodel.qdoc | 5 | ||||
-rw-r--r-- | examples/widgets/doc/src/stardelegate.qdoc | 14 |
8 files changed, 19 insertions, 29 deletions
diff --git a/examples/widgets/doc/dropsite.qdoc b/examples/widgets/doc/dropsite.qdoc index 32bcfe8916..af8766a308 100644 --- a/examples/widgets/doc/dropsite.qdoc +++ b/examples/widgets/doc/dropsite.qdoc @@ -202,13 +202,7 @@ \snippet draganddrop/dropsite/dropsitewindow.cpp updateFormatsTable() part1 Once we are sure that \c mimeData is valid, we iterate through its - supported formats using the \l{The foreach Keyword}{foreach keyword}. - This keyword has the following format: - - \include code/doc_src_examples_dropsite.qdoc 0 - - In our example, \c format is the \a variable and the \a container is a - QStringList, obtained from \c mimeData->formats(). + supported formats. \note The \l{QMimeData::formats()}{formats()} function returns a QStringList object, containing all the formats supported by the diff --git a/examples/widgets/doc/src/addressbook.qdoc b/examples/widgets/doc/src/addressbook.qdoc index 1fa0bfa9d4..e5e7fe5c2c 100644 --- a/examples/widgets/doc/src/addressbook.qdoc +++ b/examples/widgets/doc/src/addressbook.qdoc @@ -90,8 +90,8 @@ \snippet itemviews/addressbook/tablemodel.h 0 Two constructors are used, a default constructor which uses - \c TableModel's own \c {QList<Contact>} and one that takes - \c {QList<Contact>} as an argument, for convenience. + \c TableModel's own \c {QVector<Contact>} and one that takes + \c {QVector<Contact>} as an argument, for convenience. \section1 TableModel Class Implementation @@ -108,9 +108,6 @@ \c columnCount()'s value is always 2 because we only need space for the \b Name and \b Address columns. - \note The \c Q_UNUSED() macro prevents the compiler from - generating warnings regarding unused parameters. - \snippet itemviews/addressbook/tablemodel.cpp 1 The \c data() function returns either a \b Name or @@ -164,7 +161,7 @@ them here so that we can reuse the model in other programs. The last function in \c {TableModel}, \c getContacts() returns the - QList<Contact> object that holds all the contacts in the address + QVector<Contact> object that holds all the contacts in the address book. We use this function later to obtain the list of contacts to check for existing entries, write the contacts to a file and read them back. Further explanation is given with \c AddressWidget. @@ -233,7 +230,7 @@ \image addressbook-signals.png Signals and Slots Connections - We provide 2 \c addEntry() functions: 1 which is intended to be + We provide two \c addEntry() functions: One which is intended to be used to accept user input, and the other which performs the actual task of adding new entries to the address book. We divide the responsibility of adding entries into two parts to allow diff --git a/examples/widgets/doc/src/diagramscene.qdoc b/examples/widgets/doc/src/diagramscene.qdoc index ca4876f2e8..860dcc5cb9 100644 --- a/examples/widgets/doc/src/diagramscene.qdoc +++ b/examples/widgets/doc/src/diagramscene.qdoc @@ -589,7 +589,7 @@ \snippet graphicsview/diagramscene/diagramscene.cpp 14 The scene has single selection, i.e., only one item can be - selected at any given time. The foreach will then loop one time + selected at any given time. The for loop will then loop one time with the selected item or none if no item is selected. \c isItemChange() is used to check whether a selected item exists and also is of the specified diagram \a type. diff --git a/examples/widgets/doc/src/fetchmore.qdoc b/examples/widgets/doc/src/fetchmore.qdoc index df0cf3b8ec..a27efaf071 100644 --- a/examples/widgets/doc/src/fetchmore.qdoc +++ b/examples/widgets/doc/src/fetchmore.qdoc @@ -29,7 +29,7 @@ \example itemviews/fetchmore \title Fetch More Example \ingroup examples-itemviews - \brief The Fetch More example shows how two add items to an item view + \brief The Fetch More example shows how to add items to an item view model on demand. \image fetchmore-example.png diff --git a/examples/widgets/doc/src/orderform.qdoc b/examples/widgets/doc/src/orderform.qdoc index de59fc402d..5c63081a77 100644 --- a/examples/widgets/doc/src/orderform.qdoc +++ b/examples/widgets/doc/src/orderform.qdoc @@ -191,7 +191,7 @@ We then set the \c{cursor}'s position back to its last position in \c topFrame and fill in the customer's name (provided by the constructor) - and address - using a \c foreach loop to traverse the QString, \c address. + and address - using a range-based for loop to traverse the QString, \c address. \snippet richtext/orderform/mainwindow.cpp 4 diff --git a/examples/widgets/doc/src/plugandpaint.qdoc b/examples/widgets/doc/src/plugandpaint.qdoc index d3044860ab..b37176da0e 100644 --- a/examples/widgets/doc/src/plugandpaint.qdoc +++ b/examples/widgets/doc/src/plugandpaint.qdoc @@ -171,8 +171,8 @@ \snippet tools/plugandpaint/app/mainwindow.cpp 8 We use QDir::entryList() to get a list of all files in that - directory. Then we iterate over the result using \l foreach and - try to load the plugin using QPluginLoader. + directory. Then we iterate over the result using a range-based for loop + and try to load the plugin using QPluginLoader. The QObject provided by the plugin is accessible through QPluginLoader::instance(). If the dynamic library isn't a Qt diff --git a/examples/widgets/doc/src/simpletreemodel.qdoc b/examples/widgets/doc/src/simpletreemodel.qdoc index a50197b04d..f5fe93897c 100644 --- a/examples/widgets/doc/src/simpletreemodel.qdoc +++ b/examples/widgets/doc/src/simpletreemodel.qdoc @@ -170,9 +170,8 @@ \snippet itemviews/simpletreemodel/treeitem.cpp 5 - Column data is returned by the \c data() function, taking advantage of - QList's ability to provide sensible default values if the column number - is out of range: + Column data is returned by the \c data() function. The bounds are checked + before accessing the container with the data: \snippet itemviews/simpletreemodel/treeitem.cpp 6 diff --git a/examples/widgets/doc/src/stardelegate.qdoc b/examples/widgets/doc/src/stardelegate.qdoc index 44d17662ca..0b91723a51 100644 --- a/examples/widgets/doc/src/stardelegate.qdoc +++ b/examples/widgets/doc/src/stardelegate.qdoc @@ -42,11 +42,11 @@ editing takes place. Delegates are subclasses of QAbstractItemDelegate. Qt provides - QItemDelegate, which inherits QAbstractItemDelegate and handles + QStyledItemDelegate, which inherits QAbstractItemDelegate and handles the most common data types (notably \c int and QString). If we need to support custom data types, or want to customize the rendering or the editing for existing data types, we can subclass - QAbstractItemDelegate or QItemDelegate. See \l{Delegate Classes} + QAbstractItemDelegate or QStyledItemDelegate. See \l{Delegate Classes} for more information about delegates, and \l{Model/View Programming} if you need a high-level introduction to Qt's model/view architecture (including delegates). @@ -62,9 +62,9 @@ expressed as stars, such as "2 out of 5 stars" or "5 out of 6 stars". - \li \c StarDelegate inherits QItemDelegate and provides support + \li \c StarDelegate inherits QStyledItemDelegate and provides support for \c StarRating (in addition to the data types already - handled by QItemDelegate). + handled by QStyledItemDelegate). \li \c StarEditor inherits QWidget and is used by \c StarDelegate to let the user edit a star rating using the mouse. @@ -80,12 +80,12 @@ \snippet itemviews/stardelegate/stardelegate.h 0 All public functions are reimplemented virtual functions from - QItemDelegate to provide custom rendering and editing. + QStyledItemDelegate to provide custom rendering and editing. \section1 StarDelegate Class Implementation The \l{QAbstractItemDelegate::}{paint()} function is - reimplemented from QItemDelegate and is called whenever the view + reimplemented from QStyledItemDelegate and is called whenever the view needs to repaint an item: \snippet itemviews/stardelegate/stardelegate.cpp 0 @@ -93,7 +93,7 @@ The function is invoked once for each item, represented by a QModelIndex object from the model. If the data stored in the item is a \c StarRating, we paint it ourselves; otherwise, we let - QItemDelegate paint it for us. This ensures that the \c + QStyledItemDelegate paint it for us. This ensures that the \c StarDelegate can handle the most common data types. If the item is a \c StarRating, we draw the background if the |