本文整理汇总了C++中KPushButton::setDelayedMenu方法的典型用法代码示例。如果您正苦于以下问题:C++ KPushButton::setDelayedMenu方法的具体用法?C++ KPushButton::setDelayedMenu怎么用?C++ KPushButton::setDelayedMenu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KPushButton
的用法示例。
在下文中一共展示了KPushButton::setDelayedMenu方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initUi
void TwitterApiPostWidget::initUi()
{
Choqok::UI::PostWidget::initUi();
KPushButton *btnRe = addButton( "btnReply",i18nc( "@info:tooltip", "Reply" ), "edit-undo" );
QMenu *menu = new QMenu(btnRe);
KAction *actRep = new KAction(KIcon("edit-undo"), i18n("Reply to %1", currentPost().author.userName), menu);
menu->addAction(actRep);
connect( actRep, SIGNAL(triggered(bool)), SLOT(slotReply()) );
connect( btnRe, SIGNAL(clicked(bool)), SLOT(slotReply()) );
KAction *actWrite = new KAction( KIcon("document-edit"), i18n("Write to %1", currentPost().author.userName),
menu );
menu->addAction(actWrite);
connect( actWrite, SIGNAL(triggered(bool)), SLOT(slotWriteTo()) );
if( !currentPost().isPrivate ) {
KAction *actReplytoAll = new KAction(i18n("Reply to all"), menu);
menu->addAction(actReplytoAll);
connect( actReplytoAll, SIGNAL(triggered(bool)), SLOT(slotReplyToAll()) );
}
menu->setDefaultAction(actRep);
btnRe->setDelayedMenu(menu);
if( !currentPost().isPrivate ) {
d->btnFav = addButton( "btnFavorite",i18nc( "@info:tooltip", "Favorite" ), "rating" );
d->btnFav->setCheckable(true);
connect( d->btnFav, SIGNAL(clicked(bool)), SLOT(setFavorite()) );
updateFavStat();
}