connect( ma->menu(), SIGNAL( aboutToShow() ), this, SLOT( onAboutToShow() ) );
connect( ma->menu(), SIGNAL( aboutToHide() ), this, SLOT( onAboutToHide() ) );
+ connect( ma->menu(), SIGNAL( triggered( QAction* ) ), this, SLOT( onTriggered( QAction* ) ) );
+ connect( ma->menu(), SIGNAL( hovered( QAction* ) ), this, SLOT( onHovered( QAction* ) ) );
MenuNode* node = new MenuNode( pNode, myMenus.insert( gid, ma ).key(), idx, group );
emit menuAboutToHide( m );
}
+/*!
+ \brief Called when the action in menu is triggered
+
+ Emits the signal menuTriggered(QMenu*, QAction*).
+*/
+void QtxActionMenuMgr::onTriggered( QAction* theAction )
+{
+ QMenu* m = ::qobject_cast<QMenu*>( sender() );
+ if( m )
+ emit menuTriggered( m, theAction );
+}
+
+/*!
+ \brief Called when a menu action is highlighted
+
+ Emits the signal menuHovered(QMenu*, QAction*).
+*/
+void QtxActionMenuMgr::onHovered( QAction* theAction )
+{
+ QMenu* m = ::qobject_cast<QMenu*>( sender() );
+ if( m )
+ emit menuHovered( m, theAction );
+}
+
/*!
\brief Called when the corresponding menu object is destroyed.
private slots:
void onAboutToShow();
void onAboutToHide();
+ void onTriggered( QAction* );
+ void onHovered( QAction* );
void onDestroyed( QObject* );
signals:
void menuAboutToShow( QMenu* );
void menuAboutToHide( QMenu* );
+ void menuTriggered( QMenu*, QAction* );
+ void menuHovered( QMenu*, QAction* );
protected:
void setMenuWidget( QWidget* );