QDoc: Drop default arguments from some \fn documentation strings

In the \fn commands for a limited number of methods in the
documentation for Testlib and Widgets, `= 0` is passed as default
argument instead of `= Qt::KeyboardModifiers()`. Until QDoc with Clang
17, inclusive, QDoc generated the correct signature. However, with
Clang 18, QDoc outputs `= 0` in the documentation. While strictly
speaking still correct, this change impacts the documentation
negatively in terms of readability.

Dropping the default argument from the \fn command ensures that QDoc
generates the right signature with both Clang 17 and Clang 18.

Task-number: QTBUG-123130
Change-Id: I94ccec2f2c9a02241095fb5b18feb74aa55f97e1
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 08e6d4b43d7959e87c4bd6e13165025f24eafd13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Paul Wicking 2024-03-12 14:24:21 +01:00 committed by Qt Cherry-pick Bot
parent d33437c4f9
commit d224becf72
3 changed files with 13 additions and 13 deletions

View File

@ -1231,7 +1231,7 @@
\sa QTest::keyClick() \sa QTest::keyClick()
*/ */
/*! \fn void QTest::mousePress(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint(), int delay=-1) /*! \fn void QTest::mousePress(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier, QPoint pos = QPoint(), int delay=-1)
Simulates pressing a mouse \a button with an optional \a modifier Simulates pressing a mouse \a button with an optional \a modifier
on a \a widget. The position is defined by \a pos; the default on a \a widget. The position is defined by \a pos; the default
@ -1242,7 +1242,7 @@
\sa QTest::mouseRelease(), QTest::mouseClick() \sa QTest::mouseRelease(), QTest::mouseClick()
*/ */
/*! \fn void QTest::mousePress(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0, QPoint pos = QPoint(), int delay=-1) /*! \fn void QTest::mousePress(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos = QPoint(), int delay=-1)
\overload \overload
\since 5.0 \since 5.0
@ -1255,7 +1255,7 @@
\sa QTest::mouseRelease(), QTest::mouseClick() \sa QTest::mouseRelease(), QTest::mouseClick()
*/ */
/*! \fn void QTest::mouseRelease(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint(), int delay=-1) /*! \fn void QTest::mouseRelease(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier, QPoint pos = QPoint(), int delay=-1)
Simulates releasing a mouse \a button with an optional \a modifier Simulates releasing a mouse \a button with an optional \a modifier
on a \a widget. The position of the release is defined by \a pos; on a \a widget. The position of the release is defined by \a pos;
@ -1275,7 +1275,7 @@
\sa QTest::mousePress(), QTest::mouseClick() \sa QTest::mousePress(), QTest::mouseClick()
*/ */
/*! \fn void QTest::mouseRelease(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0, QPoint pos = QPoint(), int delay=-1) /*! \fn void QTest::mouseRelease(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos = QPoint(), int delay=-1)
\overload \overload
\since 5.0 \since 5.0
@ -1297,7 +1297,7 @@
\sa QTest::mousePress(), QTest::mouseClick() \sa QTest::mousePress(), QTest::mouseClick()
*/ */
/*! \fn void QTest::mouseClick(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint(), int delay=-1) /*! \fn void QTest::mouseClick(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier, QPoint pos = QPoint(), int delay=-1)
Simulates clicking a mouse \a button with an optional \a modifier Simulates clicking a mouse \a button with an optional \a modifier
on a \a widget. The position of the click is defined by \a pos; on a \a widget. The position of the click is defined by \a pos;
@ -1308,7 +1308,7 @@
\sa QTest::mousePress(), QTest::mouseRelease() \sa QTest::mousePress(), QTest::mouseRelease()
*/ */
/*! \fn void QTest::mouseClick(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0, QPoint pos = QPoint(), int delay=-1) /*! \fn void QTest::mouseClick(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos = QPoint(), int delay=-1)
\overload \overload
\since 5.0 \since 5.0
@ -1321,7 +1321,7 @@
\sa QTest::mousePress(), QTest::mouseRelease() \sa QTest::mousePress(), QTest::mouseRelease()
*/ */
/*! \fn void QTest::mouseDClick(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint(), int delay=-1) /*! \fn void QTest::mouseDClick(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier, QPoint pos = QPoint(), int delay=-1)
Simulates double clicking a mouse \a button with an optional \a Simulates double clicking a mouse \a button with an optional \a
modifier on a \a widget. The position of the click is defined by modifier on a \a widget. The position of the click is defined by
@ -1332,7 +1332,7 @@
\sa QTest::mouseClick() \sa QTest::mouseClick()
*/ */
/*! \fn void QTest::mouseDClick(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0, QPoint pos = QPoint(), int delay=-1) /*! \fn void QTest::mouseDClick(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos = QPoint(), int delay=-1)
\overload \overload
\since 5.0 \since 5.0

View File

@ -118,25 +118,25 @@
For an example, please read the \l QTestEventList class documentation. For an example, please read the \l QTestEventList class documentation.
*/ */
/*! \fn void QTestEventList::addMousePress(Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay=-1) /*! \fn void QTestEventList::addMousePress(Qt::MouseButton button, Qt::KeyboardModifiers modifiers, QPoint pos = QPoint(), int delay=-1)
Add a mouse press to the list. The event will press the \a button with optional \a modifiers at the position \a pos with an optional \a delay. The default position is the center of the widget. Add a mouse press to the list. The event will press the \a button with optional \a modifiers at the position \a pos with an optional \a delay. The default position is the center of the widget.
\sa QTest::mousePress() \sa QTest::mousePress()
*/ */
/*! \fn void QTestEventList::addMouseRelease(Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay=-1) /*! \fn void QTestEventList::addMouseRelease(Qt::MouseButton button, Qt::KeyboardModifiers modifiers, QPoint pos = QPoint(), int delay=-1)
Add a mouse release to the list. The event will release the \a button with optional \a modifiers at the position \a pos with an optional \a delay. The default position is the center of the widget. Add a mouse release to the list. The event will release the \a button with optional \a modifiers at the position \a pos with an optional \a delay. The default position is the center of the widget.
\sa QTest::mouseRelease() \sa QTest::mouseRelease()
*/ */
/*! \fn void QTestEventList::addMouseClick(Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay=-1) /*! \fn void QTestEventList::addMouseClick(Qt::MouseButton button, Qt::KeyboardModifiers modifiers, QPoint pos = QPoint(), int delay=-1)
Add a mouse click to the list. The event will click the \a button with optional \a modifiers at the position \a pos with an optional \a delay. The default position is the center of the widget. Add a mouse click to the list. The event will click the \a button with optional \a modifiers at the position \a pos with an optional \a delay. The default position is the center of the widget.
\sa QTest::mouseClick() \sa QTest::mouseClick()
*/ */
/*! \fn void QTestEventList::addMouseDClick(Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay=-1) /*! \fn void QTestEventList::addMouseDClick(Qt::MouseButton button, Qt::KeyboardModifiers modifiers, QPoint pos = QPoint(), int delay=-1)
Add a double mouse click to the list. The event will double click the \a button with optional \a modifiers at the position \a pos with an optional \a delay. The default position is the center of the widget. Add a double mouse click to the list. The event will double click the \a button with optional \a modifiers at the position \a pos with an optional \a delay. The default position is the center of the widget.

View File

@ -146,7 +146,7 @@ void QGraphicsGridLayout::addItem(QGraphicsLayoutItem *item, int row, int column
} }
/*! /*!
\fn QGraphicsGridLayout::addItem(QGraphicsLayoutItem *item, int row, int column, Qt::Alignment alignment = 0) \fn QGraphicsGridLayout::addItem(QGraphicsLayoutItem *item, int row, int column, Qt::Alignment alignment)
Adds \a item to the grid on \a row and \a column. You can specify Adds \a item to the grid on \a row and \a column. You can specify
an optional \a alignment for \a item. an optional \a alignment for \a item.