From 827d1ed633b13719964d82e06195d9df4bd34419 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 17 Aug 2014 20:44:39 +0200 Subject: QMenu: don't hold QPointers in QList MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QPointer is larger than a void*, so holding them in a 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. Change-Id: Ia224a4fe01acc1d4ca9b57c62941dd0f37780c67 Reviewed-by: Sérgio Martins Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/widgets/widgets/qmenu_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets/widgets/qmenu_p.h') diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h index ab6ca068fb..3acf73af90 100644 --- a/src/widgets/widgets/qmenu_p.h +++ b/src/widgets/widgets/qmenu_p.h @@ -422,7 +422,7 @@ public: QPointer widget; QPointer action; }; - virtual QList > calcCausedStack() const; + virtual QVector > calcCausedStack() const; QMenuCaused causedPopup; void hideUpToMenuBar(); void hideMenu(QMenu *menu); @@ -450,7 +450,7 @@ public: //firing of events void activateAction(QAction *, QAction::ActionEvent, bool self=true); - void activateCausedStack(const QList > &, QAction *, QAction::ActionEvent, bool); + void activateCausedStack(const QVector > &, QAction *, QAction::ActionEvent, bool); void _q_actionTriggered(); void _q_actionHovered(); -- cgit v1.2.3