vlc_linux/vlc-3.0.16/modules/gui/qt/menus.cpp
/**
 * @brief Enable all static entries of a menu, disable the others
 * @param menu the menu in which the entries will be disabled
 * @param enable if false, disable all entries
 **/
@brief Enable all static entries of a menu, disable the others
@param menu the menu in which the entries will be disabled
@param enable if false, disable all entries
@brief Enable all static entries of a menu disable the others @param menu the menu in which the entries will be disabled @param enable if false disable all entries
void VLCMenuBar::EnableStaticEntries( QMenu *menu, bool enable = true )
{
    if( !menu ) return;
    QList< QAction* > actions = menu->actions();
    for( int i = 0; i < actions.count(); ++i )
    {
        int actionflags = actions[i]->data().toInt();
        if ( actionflags & ACTION_MANAGED )
            actions[i]->setEnabled(
                ( actionflags & ACTION_ALWAYS_ENABLED )
                ||
                enable
            );
    }
}
void VLCMenuBar :: EnableStaticEntries ( QMenu * menu , bool enable = true ) { if ( ! menu ) return ; QList < QAction * > actions = menu -> actions ( ) ; for ( int i = 0 ; i < actions . count ( ) ; ++ i ) { int actionflags = actions [ i ] -> data ( ) . toInt ( ) ; if ( actionflags & ACTION_MANAGED ) actions [ i ] -> setEnabled ( ( actionflags & ACTION_ALWAYS_ENABLED ) || enable ) ; } }
@brief Enable all static entries of a menu, disable the others
 @param menu the menu in which the entries will be disabled
 @param enable if false, disable all entries
@brief Enable all static entries of a menu disable the others @param menu the menu in which the entries will be disabled @param enable if false disable all entries