summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-01-10 08:46:52 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-01-10 22:16:07 +0000
commit3eac688ec005833509bffc7097c378af9c5b515f (patch)
treee8c169654e6bb08f6094d35deb5d887a9be51bf3 /src/widgets
parent574b56913f3d1ca6ad05617c32bd275807613c6b (diff)
Documentation: Add \nullptr macro and use where applicable
Qt for Python users reading the documentation assume that int(0) can be passed for pointer parameters. Use the newly introduced \nullptr to disambiguate this. In a follow-up step, the \nullptr macro can be defined as None when generating the Qt for Python documentation. Task-number: PYSIDE-903 Change-Id: I3a45f87175a0668ab5f3f95f0aff409f7e3ef027 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/dialogs/qdialog.cpp2
-rw-r--r--src/widgets/dialogs/qprogressdialog.cpp2
-rw-r--r--src/widgets/effects/qgraphicseffect.cpp6
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp4
-rw-r--r--src/widgets/graphicsview/qgraphicslayoutitem.cpp2
-rw-r--r--src/widgets/itemviews/qabstractitemdelegate.cpp2
-rw-r--r--src/widgets/itemviews/qlistwidget.cpp4
-rw-r--r--src/widgets/itemviews/qtablewidget.cpp6
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp2
-rw-r--r--src/widgets/kernel/qapplication.cpp6
-rw-r--r--src/widgets/kernel/qformlayout.cpp2
-rw-r--r--src/widgets/kernel/qwidget.cpp4
-rw-r--r--src/widgets/styles/qstylefactory.cpp2
-rw-r--r--src/widgets/util/qundogroup.cpp2
-rw-r--r--src/widgets/util/qundoview.cpp2
-rw-r--r--src/widgets/widgets/qabstractbutton.cpp2
-rw-r--r--src/widgets/widgets/qabstractspinbox.cpp2
-rw-r--r--src/widgets/widgets/qmenu.cpp2
-rw-r--r--src/widgets/widgets/qmenubar.cpp2
19 files changed, 28 insertions, 28 deletions
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index 1fb5e61301..c9093095a7 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -969,7 +969,7 @@ Qt::Orientation QDialog::orientation() const
Sets the widget, \a extension, to be the dialog's extension,
deleting any previous extension. The dialog takes ownership of the
- extension. Note that if 0 is passed any existing extension will be
+ extension. Note that if \nullptr is passed, any existing extension will be
deleted. This function must only be called while the dialog is hidden.
Instead of using this functionality, we recommend that you simply call
diff --git a/src/widgets/dialogs/qprogressdialog.cpp b/src/widgets/dialogs/qprogressdialog.cpp
index 4bf78e2115..e1fb1055ae 100644
--- a/src/widgets/dialogs/qprogressdialog.cpp
+++ b/src/widgets/dialogs/qprogressdialog.cpp
@@ -397,7 +397,7 @@ void QProgressDialog::setLabelText(const QString &text)
Sets the cancel button to the push button, \a cancelButton. The
progress dialog takes ownership of this button which will be deleted
when necessary, so do not pass the address of an object that is on
- the stack, i.e. use new() to create the button. If 0 is passed then
+ the stack, i.e. use new() to create the button. If \nullptr is passed,
no cancel button will be shown.
\sa setCancelButtonText()
diff --git a/src/widgets/effects/qgraphicseffect.cpp b/src/widgets/effects/qgraphicseffect.cpp
index 028010d3dd..94188f3485 100644
--- a/src/widgets/effects/qgraphicseffect.cpp
+++ b/src/widgets/effects/qgraphicseffect.cpp
@@ -178,7 +178,7 @@ QRectF QGraphicsEffect::sourceBoundingRect(Qt::CoordinateSystem system) const
/*!
Returns a pointer to the item if this source is a QGraphicsItem; otherwise
- returns 0.
+ returns \nullptr.
\sa widget()
*/
@@ -189,7 +189,7 @@ const QGraphicsItem *QGraphicsEffectSource::graphicsItem() const
/*!
Returns a pointer to the widget if this source is a QWidget; otherwise
- returns 0.
+ returns \nullptr.
\sa graphicsItem()
*/
@@ -200,7 +200,7 @@ const QWidget *QGraphicsEffectSource::widget() const
/*!
Returns a pointer to the style options (used when drawing the source) if
- available; otherwise returns 0.
+ available; otherwise returns \nullptr.
\sa graphicsItem(), widget()
*/
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp
index 3a9bfab298..86f3d6a2f0 100644
--- a/src/widgets/graphicsview/qgraphicsitem.cpp
+++ b/src/widgets/graphicsview/qgraphicsitem.cpp
@@ -1726,8 +1726,8 @@ QGraphicsItem *QGraphicsItem::topLevelItem() const
/*!
\since 4.6
- Returns a pointer to the item's parent, cast to a QGraphicsObject. returns 0 if the parent item
- is not a QGraphicsObject.
+ Returns a pointer to the item's parent, cast to a QGraphicsObject. Returns
+ \nullptr if the parent item is not a QGraphicsObject.
\sa parentItem(), childItems()
*/
diff --git a/src/widgets/graphicsview/qgraphicslayoutitem.cpp b/src/widgets/graphicsview/qgraphicslayoutitem.cpp
index 9951fc0383..aed154a95f 100644
--- a/src/widgets/graphicsview/qgraphicslayoutitem.cpp
+++ b/src/widgets/graphicsview/qgraphicslayoutitem.cpp
@@ -369,7 +369,7 @@ bool QGraphicsLayoutItemPrivate::hasWidthForHeight() const
protected constructor, or by calling setParentLayoutItem(). The
parentLayoutItem() function returns a pointer to the item's layoutItem
parent. If the item's parent is 0 or if the parent does not inherit
- from QGraphicsItem, the parentLayoutItem() function then returns 0.
+ from QGraphicsItem, the parentLayoutItem() function then returns \nullptr.
isLayout() returns \c true if the QGraphicsLayoutItem subclass is itself a
layout, or false otherwise.
diff --git a/src/widgets/itemviews/qabstractitemdelegate.cpp b/src/widgets/itemviews/qabstractitemdelegate.cpp
index 7bc0ece4b3..9508aed3d3 100644
--- a/src/widgets/itemviews/qabstractitemdelegate.cpp
+++ b/src/widgets/itemviews/qabstractitemdelegate.cpp
@@ -240,7 +240,7 @@ QAbstractItemDelegate::~QAbstractItemDelegate()
model being used. The editor's parent widget is specified by \a parent,
and the item options by \a option.
- The base implementation returns 0. If you want custom editing you
+ The base implementation returns \nullptr. If you want custom editing you
will need to reimplement this function.
The returned editor widget should have Qt::StrongFocus;
diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp
index 72e0a67a64..b9c0e0a4b7 100644
--- a/src/widgets/itemviews/qlistwidget.cpp
+++ b/src/widgets/itemviews/qlistwidget.cpp
@@ -1375,7 +1375,7 @@ void QListWidget::setSelectionModel(QItemSelectionModel *selectionModel)
/*!
Returns the item that occupies the given \a row in the list if one has been
- set; otherwise returns 0.
+ set; otherwise returns \nullptr.
\sa row()
*/
@@ -1442,7 +1442,7 @@ void QListWidget::insertItems(int row, const QStringList &labels)
/*!
Removes and returns the item from the given \a row in the list widget;
- otherwise returns 0.
+ otherwise returns \nullptr.
Items removed from a list widget will not be managed by Qt, and will need
to be deleted manually.
diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp
index 2d539e10ba..eee3e91ac3 100644
--- a/src/widgets/itemviews/qtablewidget.cpp
+++ b/src/widgets/itemviews/qtablewidget.cpp
@@ -1936,7 +1936,7 @@ int QTableWidget::column(const QTableWidgetItem *item) const
/*!
Returns the item for the given \a row and \a column if one has been set; otherwise
- returns 0.
+ returns \nullptr.
\sa setItem()
*/
@@ -2029,7 +2029,7 @@ QTableWidgetItem *QTableWidget::takeVerticalHeaderItem(int row)
/*!
Returns the horizontal header item for column, \a column, if one has been
- set; otherwise returns 0.
+ set; otherwise returns \nullptr.
*/
QTableWidgetItem *QTableWidget::horizontalHeaderItem(int column) const
{
@@ -2435,7 +2435,7 @@ int QTableWidget::visualColumn(int logicalColumn) const
/*!
\fn QTableWidgetItem *QTableWidget::itemAt(const QPoint &point) const
- Returns a pointer to the item at the given \a point, or returns 0 if
+ Returns a pointer to the item at the given \a point, or returns \nullptr if
\a point is not covered by an item in the table widget.
\sa item()
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index a0af27115d..9fbfb50029 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -2688,7 +2688,7 @@ void QTreeWidget::addTopLevelItem(QTreeWidgetItem *item)
/*!
Removes the top-level item at the given \a index in the tree and
- returns it, otherwise returns 0;
+ returns it, otherwise returns \nullptr;
\sa insertTopLevelItem(), topLevelItem(), topLevelItemCount()
*/
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 6800a51d4b..ebab87b193 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -360,7 +360,7 @@ void QApplicationPrivate::createEventDispatcher()
/*!
\fn QWidget *QApplication::topLevelAt(const QPoint &point)
- Returns the top-level widget at the given \a point; returns 0 if
+ Returns the top-level widget at the given \a point; returns \nullptr if
there is no such widget.
*/
QWidget *QApplication::topLevelAt(const QPoint &pos)
@@ -1226,7 +1226,7 @@ void QApplication::setStyle(QStyle *style)
"windows", "windowsvista", "fusion", or "macintosh". Style
names are case insensitive.
- Returns 0 if an unknown \a style is passed, otherwise the QStyle object
+ Returns \nullptr if an unknown \a style is passed, otherwise the QStyle object
returned is set as the application's GUI style.
\warning To ensure that the application's style is set correctly, it is
@@ -2177,7 +2177,7 @@ void QApplicationPrivate::notifyActiveWindowChange(QWindow *previous)
/*!internal
* Helper function that returns the new focus widget, but does not set the focus reason.
- * Returns 0 if a new focus widget could not be found.
+ * Returns \nullptr if a new focus widget could not be found.
* Shared with QGraphicsProxyWidgetPrivate::findFocusChild()
*/
QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool next,
diff --git a/src/widgets/kernel/qformlayout.cpp b/src/widgets/kernel/qformlayout.cpp
index 66e8858e21..600934b8a1 100644
--- a/src/widgets/kernel/qformlayout.cpp
+++ b/src/widgets/kernel/qformlayout.cpp
@@ -1825,7 +1825,7 @@ int QFormLayout::rowCount() const
/*!
Returns the layout item in the given \a row with the specified \a
- role (column). Returns 0 if there is no such item.
+ role (column). Returns \nullptr if there is no such item.
\sa QLayout::itemAt(), setItem()
*/
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 2a94b25ec9..9f7c486148 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -10409,7 +10409,7 @@ bool QWidget::hasHeightForWidth() const
Returns the visible child widget at the position (\a{x}, \a{y})
in the widget's coordinate system. If there is no visible child
- widget at the specified position, the function returns 0.
+ widget at the specified position, the function returns \nullptr.
*/
/*!
@@ -12373,7 +12373,7 @@ Q_WIDGETS_EXPORT QWidgetPrivate *qt_widget_private(QWidget *widget)
\since 4.5
Returns the proxy widget for the corresponding embedded widget in a graphics
- view; otherwise returns 0.
+ view; otherwise returns \nullptr.
\sa QGraphicsProxyWidget::createProxyForChildWidget(),
QGraphicsScene::addWidget()
diff --git a/src/widgets/styles/qstylefactory.cpp b/src/widgets/styles/qstylefactory.cpp
index c959994d2c..b0ce5e52cf 100644
--- a/src/widgets/styles/qstylefactory.cpp
+++ b/src/widgets/styles/qstylefactory.cpp
@@ -77,7 +77,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
/*!
Creates and returns a QStyle object that matches the given \a key, or
- returns 0 if no matching style is found.
+ returns \nullptr if no matching style is found.
Both built-in styles and styles from style plugins are queried for a
matching style.
diff --git a/src/widgets/util/qundogroup.cpp b/src/widgets/util/qundogroup.cpp
index f9605c7a2f..9bd63d4232 100644
--- a/src/widgets/util/qundogroup.cpp
+++ b/src/widgets/util/qundogroup.cpp
@@ -242,7 +242,7 @@ void QUndoGroup::setActiveStack(QUndoStack *stack)
Returns the active stack of this group.
If none of the stacks are active, or if the group is empty, this function
- returns 0.
+ returns \nullptr.
\sa setActiveStack(), QUndoStack::setActive()
*/
diff --git a/src/widgets/util/qundoview.cpp b/src/widgets/util/qundoview.cpp
index 31f6c0dff2..c862cbcea5 100644
--- a/src/widgets/util/qundoview.cpp
+++ b/src/widgets/util/qundoview.cpp
@@ -412,7 +412,7 @@ void QUndoView::setGroup(QUndoGroup *group)
/*!
Returns the group displayed by this view.
- If the view is not looking at group, this function returns 0.
+ If the view is not looking at group, this function returns \nullptr.
\sa setGroup(), setStack()
*/
diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp
index 5854472ff0..f30a3bc7b8 100644
--- a/src/widgets/widgets/qabstractbutton.cpp
+++ b/src/widgets/widgets/qabstractbutton.cpp
@@ -805,7 +805,7 @@ bool QAbstractButton::autoExclusive() const
Returns the group that this button belongs to.
If the button is not a member of any QButtonGroup, this function
- returns 0.
+ returns \nullptr.
\sa QButtonGroup
*/
diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp
index 4e1aa51b4b..00ac5034e9 100644
--- a/src/widgets/widgets/qabstractspinbox.cpp
+++ b/src/widgets/widgets/qabstractspinbox.cpp
@@ -692,7 +692,7 @@ QLineEdit *QAbstractSpinBox::lineEdit() const
QAbstractSpinBox takes ownership of the new lineEdit
- If QLineEdit::validator() for the \a lineEdit returns 0, the internal
+ If QLineEdit::validator() for the \a lineEdit returns \nullptr, the internal
validator of the spinbox will be set on the line edit.
*/
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index e3c29ff6ee..48253b52b0 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -2283,7 +2283,7 @@ int QMenu::columnCount() const
}
/*!
- Returns the item at \a pt; returns 0 if there is no item there.
+ Returns the item at \a pt; returns \nullptr if there is no item there.
*/
QAction *QMenu::actionAt(const QPoint &pt) const
{
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index ce74a4c2ff..e7984078de 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -1581,7 +1581,7 @@ bool QMenuBar::eventFilter(QObject *object, QEvent *event)
}
/*!
- Returns the QAction at \a pt. Returns 0 if there is no action at \a pt or if
+ Returns the QAction at \a pt. Returns \nullptr if there is no action at \a pt or if
the location has a separator.
\sa addAction(), addSeparator()