QPointerEvent: de-inline point(i)

This function contributed 1.2s of the total 361s (0.34%) to KDDockWidgets
compilation time, according to a trace generated by Sergio Martins:

    **** Time summary:
    Compilation (146 times):
      Parsing (frontend):          343.2 s
      Codegen & opts (backend):     18.1 s

    **** Templates that took longest to instantiate:
      [...]
      1228 ms: QList<QEventPoint>::operator[] (59 times, avg 20 ms)
      1213 ms: QList<QEventPoint>::detach (59 times, avg 20 ms)
      1209 ms: QArrayDataPointer<QEventPoint>::detach (59 times, avg 20 ms)
      1202 ms: QArrayDataPointer<QEventPoint>::reallocateAndGrow (59 times, avg 20 ms)

Task-number: QTBUG-97601
Pick-to: 6.3
Change-Id: I5f4ff9843f7deff9f390c465df28cba3391e048b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
bb10
Marc Mutz 2022-01-04 09:16:41 +01:00
parent 316389c123
commit 36709d7dd5
2 changed files with 5 additions and 3 deletions

View File

@ -257,10 +257,12 @@ QInputEvent::~QInputEvent()
*/
/*!
\fn QEventPoint &QPointerEvent::point(qsizetype i)
Returns a QEventPoint reference for the point at index \a i.
*/
QEventPoint &QPointerEvent::point(qsizetype i)
{
return m_points[i];
}
/*!
\fn const QList<QEventPoint> &QPointerEvent::points() const

View File

@ -114,7 +114,7 @@ public:
}
void setTimestamp(quint64 timestamp) override;
qsizetype pointCount() const { return m_points.count(); }
QEventPoint &point(qsizetype i) { return m_points[i]; }
QEventPoint &point(qsizetype i);
const QList<QEventPoint> &points() const { return m_points; }
QEventPoint *pointById(int id);
bool allPointsGrabbed() const;