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


C++ KAction::toolTip方法代码示例

本文整理汇总了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));
        }
    }
}
开发者ID:aarontc,项目名称:kde-workspace,代码行数:14,代码来源:interface.cpp

示例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);
      }
  }
}
开发者ID:serghei,项目名称:kde3-kdevelop,代码行数:28,代码来源:core.cpp

示例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()) );
}
开发者ID:franhaufer,项目名称:k3b,代码行数:37,代码来源:k3bvideodvdrippingview.cpp


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