本文整理汇总了C++中KAction::toolTip方法的典型用法代码示例。如果您正苦于以下问题:C++ KAction::toolTip方法的具体用法?C++ KAction::toolTip怎么用?C++ KAction::toolTip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KAction
的用法示例。
在下文中一共展示了KAction::toolTip方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateSystemActivityToolTip
void Interface::updateSystemActivityToolTip()
{
/* Set the tooltip for the Show System Activity button to include the global shortcut */
KRunnerApp *krunnerApp = KRunnerApp::self();
KAction *showSystemActivityAction = dynamic_cast<KAction *>(krunnerApp->actionCollection()->action(QLatin1String( "Show System Activity" )));
if (showSystemActivityAction) {
QString shortcut = showSystemActivityAction->globalShortcut().toString();
if (shortcut.isEmpty()) {
m_activityButton->setToolTip( showSystemActivityAction->toolTip() );
} else {
m_activityButton->setToolTip( i18nc("tooltip, shortcut", "%1 (%2)", showSystemActivityAction->toolTip(), shortcut));
}
}
}
示例2: setupShourtcutTips
void Core::setupShourtcutTips(KXMLGUIClient * client)
{
QPtrList<KXMLGUIClient> clients;
if (client != 0)
clients.append(client);
else
clients = TopLevel::getInstance()->main()->guiFactory()->clients();
for( QPtrListIterator<KXMLGUIClient> it(clients); it.current(); ++it ) {
KActionCollection *actionCollection = (*it)->actionCollection();
for (int i = 0; i < actionCollection->count(); i++) {
KAction *action = actionCollection->action(i);
QString tooltip = action->toolTip();
if (tooltip.isEmpty())
tooltip = action->text().remove('&');
else {
int i = tooltip.findRev('(');
if (i > 0) tooltip = tooltip.left(i).stripWhiteSpace();
}
QString shortcut = action->shortcutText();
if (!shortcut.isEmpty())
tooltip += " (" + shortcut + ")";
action->setToolTip(tooltip);
}
}
}
示例3: KActionCollection
void K3b::VideoDVDRippingView::initActions()
{
d->actionCollection = new KActionCollection( this );
KAction* actionCheck = new KAction( this );
connect( actionCheck, SIGNAL(triggered()), this, SLOT(slotCheck()) );
actionCollection()->addAction( "check_tracks", actionCheck );
KAction* actionUncheck = new KAction( this );
connect( actionUncheck, SIGNAL(triggered()), this, SLOT(slotUncheck()) );
actionCollection()->addAction( "uncheck_tracks", actionUncheck );
KAction* actionStartRip = new KAction( KIcon( "tools-rip-video-dvd" ), i18n("Start Ripping"), this );
actionStartRip->setToolTip( i18n("Open the Video DVD ripping dialog") );
actionStartRip->setStatusTip(actionStartRip->toolTip());
actionStartRip->setWhatsThis( i18n("<p>Rips single titles from a video DVD "
"into a compressed format such as XviD. Menu structures are completely ignored."
"<p>If you intend to copy the plain Video DVD vob files from the DVD "
"(including decryption) for further processing with another application, "
"please use \"Show files\" button."
"<p>If you intend to make a copy of the entire Video DVD including all menus "
"and extras it is recommended to use the K3b Copy tool.") );
connect( actionStartRip, SIGNAL(triggered()), this, SLOT(slotStartRipping()) );
actionCollection()->addAction( "start_rip", actionStartRip );
KAction* actionSelectAll = KStandardAction::selectAll( d->view, SLOT(selectAll()), actionCollection() );
// setup the popup menu
d->popupMenu = new KMenu( this );
d->popupMenu->addAction( actionCheck );
d->popupMenu->addAction( actionUncheck );
d->popupMenu->addSeparator();
d->popupMenu->addAction( actionSelectAll );
d->popupMenu->addSeparator();
d->popupMenu->addAction( actionStartRip );
connect( d->popupMenu, SIGNAL(aboutToShow()), this, SLOT(slotContextMenuAboutToShow()) );
}