本文整理汇总了C++中KMenu::setIcon方法的典型用法代码示例。如果您正苦于以下问题:C++ KMenu::setIcon方法的具体用法?C++ KMenu::setIcon怎么用?C++ KMenu::setIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KMenu
的用法示例。
在下文中一共展示了KMenu::setIcon方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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 );
}
}