diff --git a/src/gui/itemmodels/qstandarditemmodel_p.h b/src/gui/itemmodels/qstandarditemmodel_p.h index 491a49f9c2..b49045d283 100644 --- a/src/gui/itemmodels/qstandarditemmodel_p.h +++ b/src/gui/itemmodels/qstandarditemmodel_p.h @@ -61,7 +61,7 @@ class QStandardItemData { public: inline QStandardItemData() : role(-1) {} - inline QStandardItemData(int r, QVariant v) : role(r), value(v) {} + inline QStandardItemData(int r, const QVariant &v) : role(r), value(v) {} int role; QVariant value; inline bool operator==(const QStandardItemData &other) const { return role == other.role && value == other.value; } diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 26113357df..b90fce97e0 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -522,7 +522,7 @@ public: }; class Attribute { public: - Attribute(AttributeType t, int s, int l, QVariant val) : type(t), start(s), length(l), value(val) {} + Attribute(AttributeType t, int s, int l, QVariant val) : type(t), start(s), length(l), value(qMove(val)) {} AttributeType type; int start; diff --git a/src/gui/kernel/qinputmethod.h b/src/gui/kernel/qinputmethod.h index 3e801bff3c..d7a7b1db8a 100644 --- a/src/gui/kernel/qinputmethod.h +++ b/src/gui/kernel/qinputmethod.h @@ -82,7 +82,7 @@ public: QLocale locale() const; Qt::LayoutDirection inputDirection() const; - static QVariant queryFocusObject(Qt::InputMethodQuery query, QVariant argument); + static QVariant queryFocusObject(Qt::InputMethodQuery query, QVariant argument); // ### Qt 6: QVariant by const-ref public Q_SLOTS: void show(); diff --git a/src/gui/opengl/qopenglgradientcache_p.h b/src/gui/opengl/qopenglgradientcache_p.h index 61949d5b7c..f2cc082250 100644 --- a/src/gui/opengl/qopenglgradientcache_p.h +++ b/src/gui/opengl/qopenglgradientcache_p.h @@ -59,7 +59,7 @@ class QOpenGL2GradientCache : public QOpenGLSharedResource struct CacheInfo { inline CacheInfo(QGradientStops s, qreal op, QGradient::InterpolationMode mode) : - stops(s), opacity(op), interpolationMode(mode) {} + stops(qMove(s)), opacity(op), interpolationMode(mode) {} GLuint texId; QGradientStops stops; diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index f55dddfb6a..28a6276746 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -4132,7 +4132,7 @@ class QGradientCache struct CacheInfo { inline CacheInfo(QGradientStops s, int op, QGradient::InterpolationMode mode) : - stops(s), opacity(op), interpolationMode(mode) {} + stops(qMove(s)), opacity(op), interpolationMode(mode) {} QRgba64 buffer[GRADIENT_STOPTABLE_SIZE]; QGradientStops stops; int opacity; diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp index 7d75e649b0..c7bbcea4f4 100644 --- a/src/gui/text/qtextdocumentlayout.cpp +++ b/src/gui/text/qtextdocumentlayout.cpp @@ -467,9 +467,9 @@ public: void drawFlow(const QPointF &offset, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &context, QTextFrame::Iterator it, const QList &floats, QTextBlock *cursorBlockNeedingRepaint) const; void drawBlock(const QPointF &offset, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &context, - QTextBlock bl, bool inRootFrame) const; + const QTextBlock &bl, bool inRootFrame) const; void drawListItem(const QPointF &offset, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &context, - QTextBlock bl, const QTextCharFormat *selectionFormat) const; + const QTextBlock &bl, const QTextCharFormat *selectionFormat) const; void drawTableCell(const QRectF &cellRect, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &cell_context, QTextTable *table, QTextTableData *td, int r, int c, QTextBlock *cursorBlockNeedingRepaint, QPointF *cursorBlockOffset) const; @@ -487,7 +487,7 @@ public: HitPoint hitTest(QTextFrame::Iterator it, HitPoint hit, const QFixedPoint &p, int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const; HitPoint hitTest(QTextTable *table, const QFixedPoint &point, int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const; - HitPoint hitTest(QTextBlock bl, const QFixedPoint &point, int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const; + HitPoint hitTest(const QTextBlock &bl, const QFixedPoint &point, int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const; QTextLayoutStruct layoutCell(QTextTable *t, const QTextTableCell &cell, QFixed width, int layoutFrom, int layoutTo, QTextTableData *tableData, QFixed absoluteTableY, @@ -749,7 +749,7 @@ QTextDocumentLayoutPrivate::hitTest(QTextTable *table, const QFixedPoint &point, } QTextDocumentLayoutPrivate::HitPoint -QTextDocumentLayoutPrivate::hitTest(QTextBlock bl, const QFixedPoint &point, int *position, QTextLayout **l, +QTextDocumentLayoutPrivate::hitTest(const QTextBlock &bl, const QFixedPoint &point, int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const { QTextLayout *tl = bl.layout(); @@ -1285,7 +1285,7 @@ void QTextDocumentLayoutPrivate::drawFlow(const QPointF &offset, QPainter *paint void QTextDocumentLayoutPrivate::drawBlock(const QPointF &offset, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &context, - QTextBlock bl, bool inRootFrame) const + const QTextBlock &bl, bool inRootFrame) const { const QTextLayout *tl = bl.layout(); QRectF r = tl->boundingRect(); @@ -1379,7 +1379,7 @@ void QTextDocumentLayoutPrivate::drawBlock(const QPointF &offset, QPainter *pain void QTextDocumentLayoutPrivate::drawListItem(const QPointF &offset, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &context, - QTextBlock bl, const QTextCharFormat *selectionFormat) const + const QTextBlock &bl, const QTextCharFormat *selectionFormat) const { Q_Q(const QTextDocumentLayout); const QTextBlockFormat blockFormat = bl.blockFormat(); diff --git a/src/gui/text/qtextodfwriter.cpp b/src/gui/text/qtextodfwriter.cpp index 6b17a264b1..429e910f18 100644 --- a/src/gui/text/qtextodfwriter.cpp +++ b/src/gui/text/qtextodfwriter.cpp @@ -396,7 +396,7 @@ void QTextOdfWriter::writeInlineCharacter(QXmlStreamWriter &writer, const QTextF writer.writeEndElement(); // frame } -void QTextOdfWriter::writeFormats(QXmlStreamWriter &writer, QSet formats) const +void QTextOdfWriter::writeFormats(QXmlStreamWriter &writer, const QSet &formats) const { writer.writeStartElement(officeNS, QString::fromLatin1("automatic-styles")); QVector allStyles = m_document->allFormats(); diff --git a/src/gui/text/qtextodfwriter_p.h b/src/gui/text/qtextodfwriter_p.h index 20805a8d27..15a4b40796 100644 --- a/src/gui/text/qtextodfwriter_p.h +++ b/src/gui/text/qtextodfwriter_p.h @@ -83,7 +83,7 @@ public: bool createArchive() const { return m_createArchive; } void writeBlock(QXmlStreamWriter &writer, const QTextBlock &block); - void writeFormats(QXmlStreamWriter &writer, QSet formatIds) const; + void writeFormats(QXmlStreamWriter &writer, const QSet &formatIds) const; void writeBlockFormat(QXmlStreamWriter &writer, QTextBlockFormat format, int formatIndex) const; void writeCharacterFormat(QXmlStreamWriter &writer, QTextCharFormat format, int formatIndex) const; void writeListFormat(QXmlStreamWriter &writer, QTextListFormat format, int formatIndex) const;