本文整理汇总了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);
}
}
示例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();
}
示例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 );
}
}