summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/itemviews')
-rw-r--r--src/widgets/itemviews/qabstractitemdelegate.cpp2
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp6
-rw-r--r--src/widgets/itemviews/qdatawidgetmapper.cpp6
-rw-r--r--src/widgets/itemviews/qitemdelegate.cpp20
-rw-r--r--src/widgets/itemviews/qitemeditorfactory.cpp8
-rw-r--r--src/widgets/itemviews/qlistwidget.cpp12
-rw-r--r--src/widgets/itemviews/qstandarditemmodel.cpp10
-rw-r--r--src/widgets/itemviews/qstyleditemdelegate.cpp18
-rw-r--r--src/widgets/itemviews/qtablewidget.cpp14
-rw-r--r--src/widgets/itemviews/qtreeview.cpp4
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp6
-rw-r--r--src/widgets/itemviews/qtreewidgetitemiterator.cpp2
12 files changed, 54 insertions, 54 deletions
diff --git a/src/widgets/itemviews/qabstractitemdelegate.cpp b/src/widgets/itemviews/qabstractitemdelegate.cpp
index 125beab91b..890eba3407 100644
--- a/src/widgets/itemviews/qabstractitemdelegate.cpp
+++ b/src/widgets/itemviews/qabstractitemdelegate.cpp
@@ -83,7 +83,7 @@ QT_BEGIN_NAMESPACE
We create the \c WidgetDelegate class, which inherits from
QStyledItemDelegate. We do the drawing in the paint() function:
- \snippet doc/src/snippets/widgetdelegate.cpp 0
+ \snippet widgetdelegate.cpp 0
Notice that we use a QStyleOptionProgressBar and initialize its
members. We can then use the current QStyle to draw it.
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index 2ff039595a..777767ee70 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -308,7 +308,7 @@ void QAbstractItemViewPrivate::_q_scrollerStateChanged()
setVerticalScrollMode(). To set the range of the scroll bars, you
can, for example, reimplement the view's resizeEvent() function:
- \snippet doc/src/snippets/code/src_gui_itemviews_qabstractitemview.cpp 0
+ \snippet code/src_gui_itemviews_qabstractitemview.cpp 0
Note that the range is not updated until the widget is shown.
@@ -654,7 +654,7 @@ QAbstractItemView::~QAbstractItemView()
views. We recommend that you delete the old selection model if it is no
longer required. This is done with the following code:
- \snippet doc/src/snippets/code/src_gui_itemviews_qabstractitemview.cpp 2
+ \snippet code/src_gui_itemviews_qabstractitemview.cpp 2
If both the old model and the old selection model do not have parents, or
if their parents are long-lived objects, it may be preferable to call their
@@ -3124,7 +3124,7 @@ void QAbstractItemView::closePersistentEditor(const QModelIndex &index)
deleted. For example, in the code snippet below, the QLineEdit object will
be deleted.
- \snippet doc/src/snippets/code/src_gui_itemviews_qabstractitemview.cpp 1
+ \snippet code/src_gui_itemviews_qabstractitemview.cpp 1
This function should only be used to display static content within the
visible area corresponding to an item of data. If you want to display
diff --git a/src/widgets/itemviews/qdatawidgetmapper.cpp b/src/widgets/itemviews/qdatawidgetmapper.cpp
index 2f7b1f7ecb..4396519810 100644
--- a/src/widgets/itemviews/qdatawidgetmapper.cpp
+++ b/src/widgets/itemviews/qdatawidgetmapper.cpp
@@ -289,7 +289,7 @@ void QDataWidgetMapperPrivate::_q_modelDestroyed()
The following code will map the columns of the model to widgets called \c mySpinBox,
\c myLineEdit and \c{myCountryChooser}:
- \snippet doc/src/snippets/code/src_gui_itemviews_qdatawidgetmapper.cpp 0
+ \snippet code/src_gui_itemviews_qdatawidgetmapper.cpp 0
After the call to toFirst(), \c mySpinBox displays the value \c{1}, \c myLineEdit
displays \c{Qt Norway} and \c myCountryChooser displays \c{Oslo}. The
@@ -476,7 +476,7 @@ QModelIndex QDataWidgetMapper::rootIndex() const
is mapped to the QLineEdit \c nameLineEdit, and the second is
mapped to the QSpinBox \c{ageSpinBox}:
- \snippet doc/src/snippets/code/src_gui_itemviews_qdatawidgetmapper.cpp 1
+ \snippet code/src_gui_itemviews_qdatawidgetmapper.cpp 1
\b{Notes:}
\list
@@ -737,7 +737,7 @@ int QDataWidgetMapper::currentIndex() const
with new data whenever the selection of a QTableView named
\c myTableView changes:
- \snippet doc/src/snippets/code/src_gui_itemviews_qdatawidgetmapper.cpp 2
+ \snippet code/src_gui_itemviews_qdatawidgetmapper.cpp 2
\sa currentIndex()
*/
diff --git a/src/widgets/itemviews/qitemdelegate.cpp b/src/widgets/itemviews/qitemdelegate.cpp
index bd9f4510f7..68d31c7dd2 100644
--- a/src/widgets/itemviews/qitemdelegate.cpp
+++ b/src/widgets/itemviews/qitemdelegate.cpp
@@ -400,7 +400,7 @@ QString QItemDelegatePrivate::valueToText(const QVariant &value, const QStyleOpt
For example, a selected item may need to be displayed differently to
unselected items, as shown in the following code:
- \snippet examples/itemviews/pixelator/pixeldelegate.cpp 2
+ \snippet itemviews/pixelator/pixeldelegate.cpp 2
\dots
After painting, you should ensure that the painter is returned to its
@@ -1136,21 +1136,21 @@ QRect QItemDelegate::textRectangle(QPainter * /*painter*/, const QRect &rect,
key press events are handled by default:
\list
- \li \gui Tab
- \li \gui Backtab
- \li \gui Enter
- \li \gui Return
- \li \gui Esc
+ \li \uicontrol Tab
+ \li \uicontrol Backtab
+ \li \uicontrol Enter
+ \li \uicontrol Return
+ \li \uicontrol Esc
\endlist
- In the case of \gui Tab, \gui Backtab, \gui Enter and \gui Return
+ In the case of \uicontrol Tab, \uicontrol Backtab, \uicontrol Enter and \uicontrol Return
key press events, the \a editor's data is comitted to the model
- and the editor is closed. If the \a event is a \gui Tab key press
+ and the editor is closed. If the \a event is a \uicontrol Tab key press
the view will open an editor on the next item in the
- view. Likewise, if the \a event is a \gui Backtab key press the
+ view. Likewise, if the \a event is a \uicontrol Backtab key press the
view will open an editor on the \e previous item in the view.
- If the event is a \gui Esc key press event, the \a editor is
+ If the event is a \uicontrol Esc key press event, the \a editor is
closed \e without committing its data.
\sa commitData(), closeEditor()
diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp
index b4180c18dd..f970a77ab4 100644
--- a/src/widgets/itemviews/qitemeditorfactory.cpp
+++ b/src/widgets/itemviews/qitemeditorfactory.cpp
@@ -339,7 +339,7 @@ void QItemEditorFactory::setDefaultFactory(QItemEditorFactory *factory)
editing data. A property is set as the user property with the USER
keyword:
- \snippet doc/src/snippets/code/src_gui_itemviews_qitemeditorfactory.cpp 0
+ \snippet code/src_gui_itemviews_qitemeditorfactory.cpp 0
If the editor does not provide a user property, it must return the
name of the property from valuePropertyName(); delegates will then
@@ -405,7 +405,7 @@ void QItemEditorFactory::setDefaultFactory(QItemEditorFactory *factory)
This way, it is not necessary to subclass
QItemEditorCreatorBase.
- \snippet doc/src/snippets/code/src_gui_itemviews_qitemeditorfactory.cpp 1
+ \snippet code/src_gui_itemviews_qitemeditorfactory.cpp 1
The constructor takes the name of the property that contains the
editing data. QItemDelegate can then access the property by name
@@ -456,7 +456,7 @@ void QItemEditorFactory::setDefaultFactory(QItemEditorFactory *factory)
Example:
- \snippet doc/src/snippets/code/src_gui_itemviews_qitemeditorfactory.cpp 2
+ \snippet code/src_gui_itemviews_qitemeditorfactory.cpp 2
Setting the \c editorFactory created above in an item delegate via
QItemDelegate::setItemEditorFactory() makes sure that all values of type
@@ -468,7 +468,7 @@ void QItemEditorFactory::setDefaultFactory(QItemEditorFactory *factory)
System}{meta-object system}). You set the user property with
the USER keyword:
- \snippet doc/src/snippets/code/src_gui_itemviews_qitemeditorfactory.cpp 3
+ \snippet code/src_gui_itemviews_qitemeditorfactory.cpp 3
\sa QItemEditorCreatorBase, QItemEditorCreator,
QItemEditorFactory, QItemDelegate, {Color Editor Factory Example}
diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp
index 01cb7b4235..4a17b65328 100644
--- a/src/widgets/itemviews/qlistwidget.cpp
+++ b/src/widgets/itemviews/qlistwidget.cpp
@@ -474,7 +474,7 @@ Qt::DropActions QListModel::supportedDropActions() const
List items can be inserted automatically into a list, when they are
constructed, by specifying the list widget:
- \snippet doc/src/snippets/qlistwidget-using/mainwindow.cpp 2
+ \snippet qlistwidget-using/mainwindow.cpp 2
Alternatively, list items can also be created without a parent widget, and
later inserted into a list using QListWidget::insertItem().
@@ -1154,7 +1154,7 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
List widgets are constructed in the same way as other widgets:
- \snippet doc/src/snippets/qlistwidget-using/mainwindow.cpp 0
+ \snippet qlistwidget-using/mainwindow.cpp 0
The selectionMode() of a list widget determines how many of the items in
the list can be selected at the same time, and whether complex selections
@@ -1166,15 +1166,15 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
parent widget and added to the list later. If a list widget already exists
when the items are constructed, the first method is easier to use:
- \snippet doc/src/snippets/qlistwidget-using/mainwindow.cpp 1
+ \snippet qlistwidget-using/mainwindow.cpp 1
If you need to insert a new item into the list at a particular position,
then it should be constructed without a parent widget. The insertItem()
function should then be used to place it within the list. The list widget
will take ownership of the item.
- \snippet doc/src/snippets/qlistwidget-using/mainwindow.cpp 6
- \snippet doc/src/snippets/qlistwidget-using/mainwindow.cpp 7
+ \snippet qlistwidget-using/mainwindow.cpp 6
+ \snippet qlistwidget-using/mainwindow.cpp 7
For multiple items, insertItems() can be used instead. The number of items
in the list is found with the count() function. To remove items from the
@@ -1258,7 +1258,7 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
This signal is emitted when the \a item is activated. The \a item is
activated when the user clicks or double clicks on it, depending on the
system configuration. It is also activated when the user presses the
- activation key (on Windows and X11 this is the \gui Return key, on Mac OS
+ activation key (on Windows and X11 this is the \uicontrol Return key, on Mac OS
X it is \key{Ctrl+0}).
*/
diff --git a/src/widgets/itemviews/qstandarditemmodel.cpp b/src/widgets/itemviews/qstandarditemmodel.cpp
index 5616d76c4a..4f488993f8 100644
--- a/src/widgets/itemviews/qstandarditemmodel.cpp
+++ b/src/widgets/itemviews/qstandarditemmodel.cpp
@@ -1989,11 +1989,11 @@ QDataStream &operator<<(QDataStream &out, const QStandardItem &item)
An example usage of QStandardItemModel to create a table:
- \snippet doc/src/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp 0
+ \snippet code/src_gui_itemviews_qstandarditemmodel.cpp 0
An example usage of QStandardItemModel to create a tree:
- \snippet doc/src/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp 1
+ \snippet code/src_gui_itemviews_qstandarditemmodel.cpp 1
After setting the model on a view, you typically want to react to user
actions, such as an item being clicked. Since a QAbstractItemView provides
@@ -2005,19 +2005,19 @@ QDataStream &operator<<(QDataStream &out, const QStandardItem &item)
a QAbstractItemView signal, such as QAbstractItemView::clicked(). First
you connect the view's signal to a slot in your class:
- \snippet doc/src/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp 2
+ \snippet code/src_gui_itemviews_qstandarditemmodel.cpp 2
When you receive the signal, you call itemFromIndex() on the given model
index to get a pointer to the item:
- \snippet doc/src/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp 3
+ \snippet code/src_gui_itemviews_qstandarditemmodel.cpp 3
Conversely, you must obtain the QModelIndex of an item when you want to
invoke a model/view function that takes an index as argument. You can
obtain the index either by using the model's indexFromItem() function, or,
equivalently, by calling QStandardItem::index():
- \snippet doc/src/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp 4
+ \snippet code/src_gui_itemviews_qstandarditemmodel.cpp 4
You are, of course, not required to use the item-based approach; you could
instead rely entirely on the QAbstractItemModel interface when working with
diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp
index 119692531f..fc2d18a459 100644
--- a/src/widgets/itemviews/qstyleditemdelegate.cpp
+++ b/src/widgets/itemviews/qstyleditemdelegate.cpp
@@ -602,21 +602,21 @@ void QStyledItemDelegate::setItemEditorFactory(QItemEditorFactory *factory)
key press events are handled by default:
\list
- \li \gui Tab
- \li \gui Backtab
- \li \gui Enter
- \li \gui Return
- \li \gui Esc
+ \li \uicontrol Tab
+ \li \uicontrol Backtab
+ \li \uicontrol Enter
+ \li \uicontrol Return
+ \li \uicontrol Esc
\endlist
- In the case of \gui Tab, \gui Backtab, \gui Enter and \gui Return
+ In the case of \uicontrol Tab, \uicontrol Backtab, \uicontrol Enter and \uicontrol Return
key press events, the \a editor's data is comitted to the model
- and the editor is closed. If the \a event is a \gui Tab key press
+ and the editor is closed. If the \a event is a \uicontrol Tab key press
the view will open an editor on the next item in the
- view. Likewise, if the \a event is a \gui Backtab key press the
+ view. Likewise, if the \a event is a \uicontrol Backtab key press the
view will open an editor on the \e previous item in the view.
- If the event is a \gui Esc key press event, the \a editor is
+ If the event is a \uicontrol Esc key press event, the \a editor is
closed \e without committing its data.
\sa commitData(), closeEditor()
diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp
index 7ae74640d6..a50b6f3111 100644
--- a/src/widgets/itemviews/qtablewidget.cpp
+++ b/src/widgets/itemviews/qtablewidget.cpp
@@ -979,7 +979,7 @@ QTableWidgetSelectionRange::~QTableWidgetSelectionRange()
Top-level items are constructed without a parent then inserted at the
position specified by a pair of row and column numbers:
- \snippet doc/src/snippets/qtablewidget-using/mainwindow.cpp 3
+ \snippet qtablewidget-using/mainwindow.cpp 3
Each item can have its own background brush which is set with
the setBackground() function. The current background brush can be
@@ -1504,18 +1504,18 @@ QTableWidgetItem &QTableWidgetItem::operator=(const QTableWidgetItem &other)
Table widgets can be constructed with the required numbers of rows and
columns:
- \snippet doc/src/snippets/qtablewidget-using/mainwindow.cpp 0
+ \snippet qtablewidget-using/mainwindow.cpp 0
Alternatively, tables can be constructed without a given size and resized
later:
- \snippet doc/src/snippets/qtablewidget-resizing/mainwindow.cpp 0
- \snippet doc/src/snippets/qtablewidget-resizing/mainwindow.cpp 1
+ \snippet qtablewidget-resizing/mainwindow.cpp 0
+ \snippet qtablewidget-resizing/mainwindow.cpp 1
Items are created ouside the table (with no parent widget) and inserted
into the table with setItem():
- \snippet doc/src/snippets/qtablewidget-resizing/mainwindow.cpp 2
+ \snippet qtablewidget-resizing/mainwindow.cpp 2
If you want to enable sorting in your table widget, do so after you
have populated it with items, otherwise sorting may interfere with
@@ -1530,7 +1530,7 @@ QTableWidgetItem &QTableWidgetItem::operator=(const QTableWidgetItem &other)
construct a table item with an icon and aligned text, and use it as the
header for a particular column:
- \snippet doc/src/snippets/qtablewidget-using/mainwindow.cpp 2
+ \snippet qtablewidget-using/mainwindow.cpp 2
The number of rows in the table can be found with rowCount(), and the
number of columns with columnCount(). The table can be cleared with the
@@ -2267,7 +2267,7 @@ QWidget *QTableWidget::cellWidget(int row, int column) const
deleted. For example, in the code snippet below, the QLineEdit object will
be deleted.
- \snippet doc/src/snippets/code/src_gui_itemviews_qtablewidget.cpp 0
+ \snippet code/src_gui_itemviews_qtablewidget.cpp 0
\sa cellWidget()
*/
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index 04835b63b4..44dd4b0761 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -85,8 +85,8 @@ QT_BEGIN_NAMESPACE
model. In the following example, the contents of a directory are
supplied by a QFileSystemModel and displayed as a tree:
- \snippet doc/src/snippets/shareddirmodel/main.cpp 3
- \snippet doc/src/snippets/shareddirmodel/main.cpp 6
+ \snippet shareddirmodel/main.cpp 3
+ \snippet shareddirmodel/main.cpp 6
The model/view architecture ensures that the contents of the tree view
are updated as the model changes.
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index e2d84825f0..d9d6c1434c 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -901,12 +901,12 @@ void QTreeModel::timerEvent(QTimerEvent *ev)
to represent cities of the world, and adds a entry for Oslo as a child
item:
- \snippet doc/src/snippets/qtreewidget-using/mainwindow.cpp 3
+ \snippet qtreewidget-using/mainwindow.cpp 3
Items can be added in a particular order by specifying the item they
follow when they are constructed:
- \snippet doc/src/snippets/qtreewidget-using/mainwindow.cpp 5
+ \snippet qtreewidget-using/mainwindow.cpp 5
Each column in an item can have its own background brush which is set with
the setBackground() function. The current background brush can be
@@ -2355,7 +2355,7 @@ void QTreeWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
In its simplest form, a tree widget can be constructed in the following way:
- \snippet doc/src/snippets/code/src_gui_itemviews_qtreewidget.cpp 0
+ \snippet code/src_gui_itemviews_qtreewidget.cpp 0
Before items can be added to the tree widget, the number of columns must
be set with setColumnCount(). This allows each item to have one or more
diff --git a/src/widgets/itemviews/qtreewidgetitemiterator.cpp b/src/widgets/itemviews/qtreewidgetitemiterator.cpp
index 116860ce89..45fddc7333 100644
--- a/src/widgets/itemviews/qtreewidgetitemiterator.cpp
+++ b/src/widgets/itemviews/qtreewidgetitemiterator.cpp
@@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
For example, the following code examples each item in a tree, checking the
text in the first column against a user-specified search string:
- \snippet doc/src/snippets/qtreewidgetitemiterator-using/mainwindow.cpp 0
+ \snippet qtreewidgetitemiterator-using/mainwindow.cpp 0
It is also possible to filter out certain types of node by passing certain
\l{IteratorFlag}{flags} to the constructor of QTreeWidgetItemIterator.