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


C++ KPopupMenu类代码示例

本文整理汇总了C++中KPopupMenu的典型用法代码示例。如果您正苦于以下问题:C++ KPopupMenu类的具体用法?C++ KPopupMenu怎么用?C++ KPopupMenu使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了KPopupMenu类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Q_UNUSED

void KstDataManagerI::contextMenu(QListViewItem *i, const QPoint& p, int col) {
  Q_UNUSED(col)
  KstObjectItem *koi = static_cast<KstObjectItem*>(i);
  KstBaseCurve *c;

  if (koi->rtti() == RTTI_OBJ_OBJECT || koi->rtti() == RTTI_OBJ_DATA_VECTOR) {
    KPopupMenu *m = new KPopupMenu(this);

    m->setTitle(koi->text(0));

    int id = m->insertItem(i18n("&Edit..."), this, SLOT(edit_I()));
    //m->setItemEnabled(id, RTTI_OBJ_VECTOR != koi->rtti());

    if (koi->rtti() == RTTI_OBJ_DATA_VECTOR) {
      id = m->insertItem(i18n("&Make Curve..."), koi, SLOT(makeCurve()));
    } else if ((c = dynamic_cast<KstBaseCurve*>(koi->dataObject().data()))) {
      KPopupMenu *addMenu = new KPopupMenu(this);
      KPopupMenu *removeMenu = new KPopupMenu(this);
      PlotMap.clear();
      id = 100;
      bool haveAdd = false, haveRemove = false;
      for (KstPlot *p = KST::plotList.first(); p; p = KST::plotList.next()) {
        if (!p->Curves.contains(c)) {
          addMenu->insertItem(p->tagName(), koi, SLOT(addToPlot(int)), 0, id);
          haveAdd = true;
        } else {
开发者ID:,项目名称:,代码行数:26,代码来源:

示例2: KPopupMenu

void VariablesListView::slotContextMenuRequested(QListViewItem* item, const QPoint& p, int)
{
  //   if(col != NameCol) return;
  enum { CopyVarItem, CopyValueItem };
  
  KPopupMenu* menu = new KPopupMenu(this);
  menu->insertItem("Copy variable", CopyVarItem);
  menu->insertItem("Copy value", CopyValueItem);
 
  int selection = menu->exec(p);
  if(selection == -1)
  {
    delete menu;
    return;
  }
  
  QClipboard* clip = kapp->clipboard();
  VariablesListViewItem* converted =
      dynamic_cast<VariablesListViewItem*>(item);
  
  switch(selection)
  {
    case CopyVarItem:
      clip->setText(converted->variable()->toString(), QClipboard::Clipboard);
      break;
    case CopyValueItem:
      clip->setText(converted->variable()->value()->toString(), QClipboard::Clipboard);
      break;
  }

  delete menu;
      
}
开发者ID:thiago-silva,项目名称:protoeditor,代码行数:33,代码来源:variableslistview.cpp

示例3: showPopup

void ServiceLoader::showPopup(const QString &popup, const QPoint &point)
{
  KPopupMenu *p = popups[popup];
  if(p){
    p->exec(point);
  }
}
开发者ID:iegor,项目名称:kdesktop,代码行数:7,代码来源:serviceloader.cpp

示例4: DCOPObject

knazar::knazar()
    : DCOPObject( "DCOPNazarIface" ), KSystemTray( 0, "knazar" )
{
	// Insert TrayIcon
	trayIcon = KSystemTray::loadIcon( "knazar" );
	setPixmap( trayIcon );

	// Initialize and Register KNazar DCOP Interface so any KDE program can make Nazar easily
	if ( !kapp->dcopClient()->isRegistered() )
	{
		kapp->dcopClient()->registerAs( "knazar" );
		kapp->dcopClient()->setDefaultObject( objId() );
	}


	// Build PopupMenu
	KPopupMenu* menu = contextMenu();

	( new KAction( i18n( "Protect" ), "ledgreen", 0, this, SLOT( protect_from_harmfull_looks() ), this ) )->plug( menu );
	( new KAction( i18n( "Release" ), "ledred", 0, this, SLOT( release_the_protection() ), this ) )->plug( menu );
	menu->insertSeparator();
	( new KAction( i18n( "About" ), "about", 0, this, SLOT( about() ), this ) )->plug( menu );

	// Initialize variables
	protection_working = true;
	number_of_attacks = defated_attacks = 0;
	QToolTip::add( this, i18n( "knazar - No Harmfull look allowed!" ));
}
开发者ID:Tayyib,项目名称:uludag,代码行数:28,代码来源:knazar.cpp

示例5: showPopupMenu

/*!
    \fn SnippetWidget::showPopupMenu( QListViewItem * item, const QPoint & p, int )
    Shows the Popup-Menu depending item is a valid pointer
*/
void SnippetWidget::showPopupMenu( QListViewItem * item, const QPoint & p, int )
{
	KPopupMenu popup;

	SnippetItem * selectedItem = static_cast<SnippetItem *>(item);
	if ( item ) {
		popup.insertTitle( selectedItem->getName() );

		popup.insertItem( i18n("Add Item..."), this, SLOT( slotAdd() ) );
		popup.insertItem( i18n("Add Group..."), this, SLOT( slotAddGroup() ) );
        if (dynamic_cast<SnippetGroup*>(item)) {
            popup.insertItem( i18n("Edit..."), this, SLOT( slotEditGroup() ) );
        } else {
            popup.insertItem( i18n("Edit..."), this, SLOT( slotEdit() ) );
        }
		popup.insertItem( i18n("Remove"), this, SLOT( slotRemove() ) );

	} else {
		popup.insertTitle(i18n("Code Snippets"));

		popup.insertItem( i18n("Add Group..."), this, SLOT( slotAddGroup() ) );
	}

	popup.exec(p);
}
开发者ID:serghei,项目名称:kde3-kdevelop,代码行数:29,代码来源:snippet_widget.cpp

示例6: UIServerSystemTray

 UIServerSystemTray(UIServer *uis) : KSystemTray(uis)
 {
     KPopupMenu *pop = contextMenu();
     pop->insertItem(i18n("Settings..."), uis, SLOT(slotConfigure()));
     pop->insertItem(i18n("Remove"), uis, SLOT(slotRemoveSystemTrayIcon()));
     setPixmap(loadIcon("filesave"));
     // actionCollection()->action("file_quit")->setEnabled(true);
     KStdAction::quit(uis, SLOT(slotQuit()), actionCollection());
 }
开发者ID:,项目名称:,代码行数:9,代码来源:

示例7: showContextMenu

void MDWEnum::showContextMenu()
{
    if( m_mixerwidget == NULL )
	return;

    KPopupMenu *menu = m_mixerwidget->getPopup();

    QPoint pos = QCursor::pos();
    menu->popup( pos );
}
开发者ID:serghei,项目名称:kde3-kdemultimedia,代码行数:10,代码来源:mdwenum.cpp

示例8: KPopupMenu

KPopupMenu *ClassToolWidget::createPopup()
{
    KPopupMenu *popup = contextItem? contextItem->createPopup() : 0;
    if (!popup) {
        popup = new KPopupMenu(this);
	popup->insertTitle(i18n("Class Tool"));
    }

    return popup;
}
开发者ID:serghei,项目名称:kde3-kdevelop,代码行数:10,代码来源:classtoolwidget.cpp

示例9: mouseLeave

void KasLoadItem::showMenuAt( QPoint p )
{
    mouseLeave();
    kasbar()->updateMouseOver();

    KasTasker *bar = dynamic_cast<KasTasker *> (KasItem::kasbar());
    if ( !bar )
	return;

    KPopupMenu *menu = bar->contextMenu();
    menu->exec( p );
}
开发者ID:,项目名称:,代码行数:12,代码来源:

示例10: popupMenu

void GrepViewWidget::popupMenu(QListBoxItem*, const QPoint& p)
{
	if(m_curOutput->isRunning()) return;

	KPopupMenu rmbMenu;

	if(KAction *findAction = m_part->actionCollection()->action("edit_grep"))
	{
		rmbMenu.insertTitle(i18n("Find in Files"));
		findAction->plug(&rmbMenu);
		rmbMenu.exec(p);
	}
}
开发者ID:serghei,项目名称:kde3-kdevelop,代码行数:13,代码来源:grepviewwidget.cpp

示例11: SmallIconSet

void
AnalyzerContainer::contextMenuEvent( QContextMenuEvent *e)
{
#if defined HAVE_LIBVISUAL
    KPopupMenu menu;
    menu.insertItem( SmallIconSet( Amarok::icon( "visualizations" ) ), i18n("&Visualizations"), Menu::ID_SHOW_VIS_SELECTOR );

    if( menu.exec( mapToGlobal( e->pos() ) ) == Menu::ID_SHOW_VIS_SELECTOR )
        Menu::instance()->slotActivated( Menu::ID_SHOW_VIS_SELECTOR );
#else
    Q_UNUSED(e);
#endif
}
开发者ID:gms8994,项目名称:amarok-1.4,代码行数:13,代码来源:actionclasses.cpp

示例12: mainWidget

void FavoriteFolderView::contextMenu(QListViewItem *item, const QPoint &point)
{
    KMFolderTree *ft = mainWidget()->folderTree();
    assert(ft);
    KMFolderTreeItem *fti = static_cast<KMFolderTreeItem *>(item);
    mContextMenuItem = fti;
    KPopupMenu contextMenu;
    if(fti && fti->folder())
    {
        contextMenu.insertItem(SmallIconSet("editdelete"), i18n("Remove From Favorites"),
                               this, SLOT(removeFolder()));
        contextMenu.insertItem(SmallIconSet("edit"), i18n("Rename Favorite"), this, SLOT(renameFolder()));
        contextMenu.insertSeparator();

        mainWidget()->action("mark_all_as_read")->plug(&contextMenu);
        if(fti->folder()->folderType() == KMFolderTypeImap || fti->folder()->folderType() == KMFolderTypeCachedImap)
            mainWidget()->action("refresh_folder")->plug(&contextMenu);
        if(fti->folder()->isMailingListEnabled())
            mainWidget()->action("post_message")->plug(&contextMenu);

        contextMenu.insertItem(SmallIconSet("configure_shortcuts"), i18n("&Assign Shortcut..."), fti, SLOT(assignShortcut()));
        contextMenu.insertItem(i18n("Expire..."), fti, SLOT(slotShowExpiryProperties()));
        mainWidget()->action("modify")->plug(&contextMenu);
    }
    else
    {
        contextMenu.insertItem(SmallIconSet("bookmark_add"), i18n("Add Favorite Folder..."),
                               this, SLOT(addFolder()));
    }
    contextMenu.exec(point, 0);
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:31,代码来源:favoritefolderview.cpp

示例13: KPopupMenu

void HistoryDialog::slotRightClick(const QString &url, const QPoint &point)
{
	KPopupMenu *chatWindowPopup = 0L;
	chatWindowPopup = new KPopupMenu();
	
	if ( !url.isEmpty() )
	{
		mURL = url;
		mCopyURLAct->plug( chatWindowPopup );
		chatWindowPopup->insertSeparator();
	}
	mCopyAct->setEnabled( mHtmlPart->hasSelection() );
	mCopyAct->plug( chatWindowPopup );
	
	connect( chatWindowPopup, SIGNAL( aboutToHide() ), chatWindowPopup, SLOT( deleteLater() ) );
	chatWindowPopup->popup(point);
}
开发者ID:woodyplus,项目名称:kde3-kdenetwork,代码行数:17,代码来源:historydialog.cpp

示例14: changeAnalyzer

void
AnalyzerContainer::mousePressEvent( QMouseEvent *e)
{
    if( e->button() == Qt::LeftButton ) {
        AmarokConfig::setCurrentPlaylistAnalyzer( AmarokConfig::currentPlaylistAnalyzer() + 1 );
        changeAnalyzer();
    }
    else if( e->button() == Qt::RightButton ) {
        #if defined HAVE_XMMS || defined HAVE_LIBVISUAL
        KPopupMenu menu;
        menu.insertItem( SmallIconSet( "visualizations" ), i18n("&Visualizations"), Menu::ID_SHOW_VIS_SELECTOR );

        if( menu.exec( mapToGlobal( e->pos() ) ) == Menu::ID_SHOW_VIS_SELECTOR )
            Menu::instance()->slotActivated( Menu::ID_SHOW_VIS_SELECTOR );
        #endif
    }
}
开发者ID:tmarques,项目名称:waheela,代码行数:17,代码来源:actionclasses.cpp

示例15: helpMenu

void KSlovar::addMenu()
{
  KPopupMenu * filemenu = new KPopupMenu;
  m_newDictionary->plug(filemenu);
  m_openDictionary->plug(filemenu);
  filemenu->insertSeparator();
  m_print->plug(filemenu);
  filemenu->insertSeparator();
  m_close->plug(filemenu);
  m_quit->plug(filemenu);

  KPopupMenu *editmenu=new KPopupMenu;
  m_editDictionary->plug(editmenu);
  m_selectAll->plug(editmenu);
  editmenu->insertSeparator();
  m_addPhrase->plug(editmenu);
  m_editPhrase->plug(editmenu);
  m_removePhrase->plug(editmenu);
  editmenu->insertSeparator();
  m_find->plug(editmenu);
  m_findNext->plug(editmenu);
  m_literalSearch->plug(editmenu);
  m_backSearch->plug(editmenu);

  KPopupMenu *gomenu=new KPopupMenu;
  m_back->plug(gomenu);
  m_forward->plug(gomenu);
  m_home->plug(gomenu);

  KPopupMenu *setmenu=new KPopupMenu;
  m_config->plug(setmenu);
  m_conversion->plug(setmenu);
  m_update->plug(setmenu);
  m_wizard->plug(setmenu);

  KPopupMenu *help = helpMenu();

  KMenuBar * menu = menuBar();
  menu->insertItem( i18n( "&File" ), filemenu );
  menu->insertItem(i18n("&Edit"), editmenu);
  menu->insertItem(i18n("&Go"), gomenu);
  menu->insertItem(i18n("&Settings"), setmenu);
  menu->insertItem( i18n( "&Help" ), help );
}
开发者ID:BackupTheBerlios,项目名称:kslovar-svn,代码行数:44,代码来源:kslovar.cpp


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