QMenu addactions(...) actions()

36 views
Skip to first unread message

Luigi Ferraris

unread,
Jun 21, 2017, 10:58:51 AM6/21/17
to QtContribs
Hi Pritpal,
I need to "copy" actions from a QMenu to another and I read about

QList<QAction *> QWidget::actions() const
and
void QWidget::addActions(QList<QAction *> actions)

but they are missing on HbQt.
I know there are problems to "mimic" QList on CLIPPER but is there a way to enable these methods?

IOW I need to do toMenu:addActions( fromMenu:actions() )
where toMenu and fromMenu are QMenu objects.

Best regards
Luigi Ferraris

Luigi Ferraris

unread,
Jun 21, 2017, 11:17:34 AM6/21/17
to QtContribs
Looking at (eg) qtgui/qth/QGestureEvent.qth and qtgui/qth/QGraphicsWidget.qth
I think can be added to qtgui/qth/QMenu.qth these

QList<QAction *> actions () const
void addActions ( QList<QAction *> actions )

Is it true?

Regards
Luigi

Pritpal Bedi

unread,
Jun 21, 2017, 12:52:15 PM6/21/17
to QtContribs

QList<QAction *> actions () const
void addActions ( QList<QAction *> actions )

Is it true?


Yes.



Pritpal Bedi
a student of software analysis & concepts 

Luigi Ferraris

unread,
Jun 21, 2017, 2:10:11 PM6/21/17
to QtContribs
Hi Pritpal,
many thanks for your answer.

With a fresh QtContribs addons, before compile, I have added to QMenu.qth

QList<QAction *> actions () const
void addActions ( QList<QAction *> actions )
and then I rebuilt all QtContribs.

Within compiled QMenu.cpp I can find HB_FUNC_STATIC( ACTIONS ) but I not found any code related with addActions.
The same with compiled QGraphicsWidget.cpp: none code related with addActions.

Luigi
Reply all
Reply to author
Forward
0 new messages