widgets: Pass non-trivially-copyable or large types by const-ref
Change-Id: I912c6a9ee7b27350ac3d1fe147b697338e76f53c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>bb10
parent
6cc79ad994
commit
d6c2dea7da
|
|
@ -2796,7 +2796,7 @@ void QGraphicsAnchorLayoutPrivate::interpolateEdge(AnchorVertex *base, AnchorDat
|
|||
}
|
||||
|
||||
bool QGraphicsAnchorLayoutPrivate::solveMinMax(const QList<QSimplexConstraint *> &constraints,
|
||||
GraphPath path, qreal *min, qreal *max)
|
||||
const GraphPath &path, qreal *min, qreal *max)
|
||||
{
|
||||
QSimplex simplex;
|
||||
bool feasible = simplex.setConstraints(constraints);
|
||||
|
|
|
|||
|
|
@ -522,7 +522,7 @@ public:
|
|||
|
||||
// Linear Programming solver methods
|
||||
bool solveMinMax(const QList<QSimplexConstraint *> &constraints,
|
||||
GraphPath path, qreal *min, qreal *max);
|
||||
const GraphPath &path, qreal *min, qreal *max);
|
||||
bool solvePreferred(const QList<QSimplexConstraint *> &constraints,
|
||||
const QList<AnchorData *> &variables);
|
||||
bool hasConflicts() const;
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ public:
|
|||
|
||||
struct ExtraStruct {
|
||||
ExtraStruct() {} // for QVector, don't use
|
||||
ExtraStruct(Extra type, QVariant value)
|
||||
ExtraStruct(Extra type, const QVariant &value)
|
||||
: type(type), value(value)
|
||||
{ }
|
||||
|
||||
|
|
|
|||
|
|
@ -2056,7 +2056,11 @@ void QGraphicsWidget::insertAction(QAction *before, QAction *action)
|
|||
|
||||
\sa removeAction(), QMenu, insertAction(), QWidget::insertActions()
|
||||
*/
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
void QGraphicsWidget::insertActions(QAction *before, const QList<QAction *> &actions)
|
||||
#else
|
||||
void QGraphicsWidget::insertActions(QAction *before, QList<QAction *> actions)
|
||||
#endif
|
||||
{
|
||||
for (int i = 0; i < actions.count(); ++i)
|
||||
insertAction(before, actions.at(i));
|
||||
|
|
|
|||
|
|
@ -139,11 +139,12 @@ public:
|
|||
void addAction(QAction *action);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
void addActions(const QList<QAction*> &actions);
|
||||
void insertActions(QAction *before, const QList<QAction*> &actions);
|
||||
#else
|
||||
void addActions(QList<QAction*> actions);
|
||||
void insertActions(QAction *before, QList<QAction*> actions);
|
||||
#endif
|
||||
void insertAction(QAction *before, QAction *action);
|
||||
void insertActions(QAction *before, QList<QAction*> actions);
|
||||
void removeAction(QAction *action);
|
||||
QList<QAction*> actions() const;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class QWidgetItemData
|
|||
{
|
||||
public:
|
||||
inline QWidgetItemData() : role(-1) {}
|
||||
inline QWidgetItemData(int r, QVariant v) : role(r), value(v) {}
|
||||
inline QWidgetItemData(int r, const QVariant &v) : role(r), value(v) {}
|
||||
int role;
|
||||
QVariant value;
|
||||
inline bool operator==(const QWidgetItemData &other) const { return role == other.role && value == other.value; }
|
||||
|
|
|
|||
|
|
@ -3326,7 +3326,11 @@ void QWidget::insertAction(QAction *before, QAction *action)
|
|||
|
||||
\sa removeAction(), QMenu, insertAction(), contextMenuPolicy
|
||||
*/
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
void QWidget::insertActions(QAction *before, const QList<QAction*> &actions)
|
||||
#else
|
||||
void QWidget::insertActions(QAction *before, QList<QAction*> actions)
|
||||
#endif
|
||||
{
|
||||
for(int i = 0; i < actions.count(); ++i)
|
||||
insertAction(before, actions.at(i));
|
||||
|
|
@ -5018,7 +5022,7 @@ void QWidgetPrivate::unsetCursor_sys()
|
|||
qt_qpa_set_cursor(q, false);
|
||||
}
|
||||
|
||||
static inline void applyCursor(QWidget *w, QCursor c)
|
||||
static inline void applyCursor(QWidget *w, const QCursor &c)
|
||||
{
|
||||
if (QWindow *window = w->windowHandle())
|
||||
window->setCursor(c);
|
||||
|
|
|
|||
|
|
@ -541,11 +541,12 @@ public:
|
|||
void addAction(QAction *action);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
void addActions(const QList<QAction*> &actions);
|
||||
void insertActions(const QAction *before, const QList<QAction*> &actions);
|
||||
#else
|
||||
void addActions(QList<QAction*> actions);
|
||||
void insertActions(QAction *before, QList<QAction*> actions);
|
||||
#endif
|
||||
void insertAction(QAction *before, QAction *action);
|
||||
void insertActions(QAction *before, QList<QAction*> actions);
|
||||
void removeAction(QAction *action);
|
||||
QList<QAction*> actions() const;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1851,7 +1851,7 @@ void QPlainTextEditPrivate::relayoutDocument()
|
|||
}
|
||||
}
|
||||
|
||||
static void fillBackground(QPainter *p, const QRectF &rect, QBrush brush, QRectF gradientRect = QRectF())
|
||||
static void fillBackground(QPainter *p, const QRectF &rect, QBrush brush, const QRectF &gradientRect = QRectF())
|
||||
{
|
||||
p->save();
|
||||
if (brush.style() >= Qt::LinearGradientPattern && brush.style() <= Qt::ConicalGradientPattern) {
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ public:
|
|||
|
||||
|
||||
HistoryEntry createHistoryEntry() const;
|
||||
void restoreHistoryEntry(const HistoryEntry entry);
|
||||
void restoreHistoryEntry(const HistoryEntry &entry);
|
||||
|
||||
QStack<HistoryEntry> stack;
|
||||
QStack<HistoryEntry> forwardStack;
|
||||
|
|
@ -554,7 +554,7 @@ QTextBrowserPrivate::HistoryEntry QTextBrowserPrivate::createHistoryEntry() cons
|
|||
return entry;
|
||||
}
|
||||
|
||||
void QTextBrowserPrivate::restoreHistoryEntry(const HistoryEntry entry)
|
||||
void QTextBrowserPrivate::restoreHistoryEntry(const HistoryEntry &entry)
|
||||
{
|
||||
setSource(entry.url);
|
||||
hbar->setValue(entry.hpos);
|
||||
|
|
|
|||
Loading…
Reference in New Issue