summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qlineedit_p.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-07-09 21:40:58 +0200
committerMarc Mutz <marc.mutz@kdab.com>2015-07-13 10:38:04 +0000
commitb3364cd8bf5ec6dc6d58dcb82c8285d6b3700a7a (patch)
treee1fd57ef7fe61375e6d552400ebb23a88fc943c1 /src/widgets/widgets/qlineedit_p.h
parent4a24de06f6ba83798d9f2dd8ad6a005da9506f13 (diff)
QLineEdit: don't hold SideWidgetEntry's in a QList
SideWidgetEntry is larger than a void*, so holding it in QList is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Fix by marking it movable, and holding in a QVector instead. Change-Id: Ia87b9ac634ad9386bc667355e6e236bc3d56ab29 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/widgets/widgets/qlineedit_p.h')
-rw-r--r--src/widgets/widgets/qlineedit_p.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/widgets/qlineedit_p.h b/src/widgets/widgets/qlineedit_p.h
index 4654262ea7..57055757eb 100644
--- a/src/widgets/widgets/qlineedit_p.h
+++ b/src/widgets/widgets/qlineedit_p.h
@@ -111,7 +111,7 @@ public:
QAction *action;
int flags;
};
- typedef QList<SideWidgetEntry> SideWidgetEntryList;
+ typedef QVector<SideWidgetEntry> SideWidgetEntryList;
QLineEditPrivate()
: control(0), frame(1), contextMenuEnabled(1), cursorVisible(0),
@@ -225,6 +225,7 @@ private:
int lastTextSize;
mutable QSize m_iconSize;
};
+Q_DECLARE_TYPEINFO(QLineEditPrivate::SideWidgetEntry, Q_PRIMITIVE_TYPE);
inline int QLineEditPrivate::effectiveLeftTextMargin() const
{