当前位置: 首页>>代码示例>>C++>>正文


C++ KMenu::setTitle方法代码示例

本文整理汇总了C++中KMenu::setTitle方法的典型用法代码示例。如果您正苦于以下问题:C++ KMenu::setTitle方法的具体用法?C++ KMenu::setTitle怎么用?C++ KMenu::setTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KMenu的用法示例。


在下文中一共展示了KMenu::setTitle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addActionsTo

void KonqCopyToMenu::addActionsTo(QMenu* menu)
{
    KMenu* mainCopyMenu = new KonqCopyToMainMenu(menu, d, Copy);
    mainCopyMenu->setTitle(i18nc("@title:menu", "Copy To"));
    mainCopyMenu->menuAction()->setObjectName( QLatin1String("copyTo_submenu" )); // for the unittest
    menu->addMenu(mainCopyMenu);

    if (!d->m_readOnly) {
        KMenu* mainMoveMenu = new KonqCopyToMainMenu(menu, d, Move);
        mainMoveMenu->setTitle(i18nc("@title:menu", "Move To"));
        mainMoveMenu->menuAction()->setObjectName( QLatin1String("moveTo_submenu" )); // for the unittest
        menu->addMenu(mainMoveMenu);
    }
}
开发者ID:mafrez,项目名称:plasma-desktop,代码行数:14,代码来源:konq_copytomenu.cpp

示例2: KMenu

void
BlockAnalyzer::contextMenuEvent( QContextMenuEvent * )
{
    KMenu *menu = new KMenu( this );
    menu->setTitle( i18n( "Framerate" ) );

    QAction *a = menu->addAction( i18n("50 fps"), this, SLOT( set50fps() ) );
    if( timeout() == 50 ) a->setChecked( true );

    a = menu->addAction( i18n("33 fps"), this, SLOT( set33fps() ) );
    if( timeout() == 33 ) a->setChecked( true );
    
    a = menu->addAction( i18n("25 fps"), this, SLOT( set25fps() ) );
    if( timeout() == 25 ) a->setChecked( true );
    
    a = menu->addAction( i18n("20 fps"), this, SLOT( set20fps() ) );
    if( timeout() == 20 ) a->setChecked( true );
    
    a = menu->addAction( i18n("10 fps"), this, SLOT( set10fps() ) );
    if( timeout() == 10 ) a->setChecked( true );

#if defined HAVE_LIBVISUAL
    menu->addSeparator();
    menu->addAction( Amarok::actionCollection()->action( "visualizations" ) );
#endif
    menu->exec();
}
开发者ID:weiligang512,项目名称:apue-test,代码行数:27,代码来源:blockanalyzer.cpp

示例3: slotMouseClicked

void Amor::slotMouseClicked(const QPoint &pos)
{
    bool restartTimer = mTimer->isActive();

    // Stop the animation while the menu is open.
    if( restartTimer ) {
        mTimer->stop();
    }

    if( !mMenu ) {
        KHelpMenu* help = new KHelpMenu( 0, KGlobal::mainComponent().aboutData(), false );
        KMenu* helpMenu = help->menu();
#ifdef __GNUC__
#warning the following is kinda dirty and should be done by KHelpMenu::menu() I think. (hermier)
#endif
        helpMenu->setIcon( SmallIcon( QLatin1String( "help-contents" ) ) );
        helpMenu->setTitle( i18nc( "@action:inmenu Amor", "&Help" ) );

        mMenu = new KMenu( 0 );
        mMenu->addTitle( QLatin1String( "Amor" ) ); // I really don't want this i18n'ed
        mMenu->addAction( SmallIcon( QLatin1String ("configure" ) ), i18nc( "@action:inmenu Amor", "&Configure..." ), this, SLOT(slotConfigure()) );
        mMenu->addSeparator();
        mMenu->addMenu( helpMenu );
        mMenu->addAction( SmallIcon( QLatin1String( "application-exit" ) ), i18nc( "@action:inmenu Amor", "&Quit" ), kapp, SLOT(quit()) );
    }

    mMenu->exec( pos );

    if( restartTimer ) {
        mTimer->setSingleShot( true );
        mTimer->start( 1000 );
    }
}
开发者ID:Feniks13r,项目名称:amor,代码行数:33,代码来源:amor.cpp


注:本文中的KMenu::setTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。