QPdfWriter: pass QUuid by value

QUuid is a) trivially copyable, b) ≤ 16 bytes, so as per [1] should be
passed by value. Clazy, indeed, complains, so fix it.

Found in API-review.

Amends 2fbece8a73cb2d2692c78c38e1576c0c9c62fce7.

[1] https://www.macieira.org/blog/2012/02/the-value-of-passing-by-value/

Change-Id: I321ebd650dac8e58c173d957259c3700b1f59ace
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7550f0e2c1a4ca10a0e4604e2d429b98481d4e2d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2024-09-02 11:01:19 +02:00 committed by Qt Cherry-pick Bot
parent 69d5d78ce9
commit 0ae162e2a9
2 changed files with 2 additions and 2 deletions

View File

@ -205,7 +205,7 @@ QUuid QPdfWriter::documentId() const
\since 6.8 \since 6.8
Sets the ID of the document to \a documentId. Sets the ID of the document to \a documentId.
*/ */
void QPdfWriter::setDocumentId(const QUuid &documentId) void QPdfWriter::setDocumentId(QUuid documentId)
{ {
Q_D(QPdfWriter); Q_D(QPdfWriter);
d->engine->d_func()->documentId = documentId; d->engine->d_func()->documentId = documentId;

View File

@ -37,7 +37,7 @@ public:
void setCreator(const QString &creator); void setCreator(const QString &creator);
QUuid documentId() const; QUuid documentId() const;
void setDocumentId(const QUuid &documentId); void setDocumentId(QUuid documentId);
bool newPage() override; bool newPage() override;