• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ removeAction函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Finalise

	//==========================================================================
	bool Finalise(IComponentContext& contextManager) override
	{
		projectManager_.getBase<ProjectManager>()->fini();
		projectManager_ = nullptr;
		auto uiApplication = contextManager.queryInterface<IUIApplication>();
		assert(uiApplication != nullptr);
		uiApplication->removeAction(*newProject_);
		uiApplication->removeAction(*openProject_);
		uiApplication->removeAction(*saveProject_);
		uiApplication->removeAction(*closeProject_);
		if (newProjectDialog_ != nullptr)
		{
			uiApplication->removeWindow(*newProjectDialog_);
			newProjectDialog_ = nullptr;
		}
		if (openProjectDialog_ != nullptr)
		{
			uiApplication->removeWindow(*openProjectDialog_);
			openProjectDialog_ = nullptr;
		}
		connections_.clear();
		newProject_ = nullptr;
		openProject_ = nullptr;
		saveProject_ = nullptr;
		closeProject_ = nullptr;
		return true;
	}
开发者ID:Aidanboneham,项目名称:wgtf,代码行数:28,代码来源:plg_environment_test.cpp


示例2: removeAction

void Breadcrumb::popAction()
{
    QList<QAction*> actions = this->actions();
    if (actions.isEmpty())
        return;

    removeAction(actions.last());

    // remove separators; 2 because the last one has been removed
    for (int n = actions.length() - 2; n >= 0; --n) {
        if (actions[n]->isSeparator())
            removeAction(actions[n]);
        break;
    }

    // convert last action to current
    actions = this->actions();
    if (actions.isEmpty())
        return;
    QString text = actions.last()->text();
    removeAction(actions.last());
    addCurrent(text);

    actions = this->actions();
    if (actions.length() == 1) { // only the last Top item
        removeAction(actions[0]);
        setVisible(false);
    }
}
开发者ID:Pandahisham,项目名称:outliner,代码行数:29,代码来源:breadcrumb.cpp


示例3: addSoftKeys

void MainWindow::setCustomSoftKeys()
{
    if (toggleButton->isChecked()) {
        infoLabel->setText(tr("Custom softkeys set"));
        addSoftKeys();
        }
    else {
        infoLabel->setText(tr("Custom softkeys removed"));
        removeAction(ok);
        removeAction(cancel);
    }
}
开发者ID:cedrus,项目名称:qt4,代码行数:12,代码来源:softkeys.cpp


示例4: removeAction

void TtoolBar::setAfterAnswer() {
	removeAction(checkAct);
	if (repeatSndAct) {
		removeAction(repeatSndAct);
#if defined (Q_OS_ANDROID)
    flyActions()->removeOne(repeatSndAct);
#endif
  }
	if (tuneForkAct) {
		removeAction(tuneForkAct);
#if defined (Q_OS_ANDROID)
    flyActions()->removeOne(tuneForkAct);
#endif
  }
}
开发者ID:SeeLook,项目名称:nootka,代码行数:15,代码来源:ttoolbar.cpp


示例5: editAction

void QLCFixtureEditor::slotChannelListContextMenuRequested()
{
    QAction editAction(QIcon(":/edit.png"), tr("Edit"), this);
    QAction copyAction(QIcon(":/editcopy.png"), tr("Copy"), this);
    QAction pasteAction(QIcon(":/editpaste.png"), tr("Paste"), this);
    QAction removeAction(QIcon(":/editdelete.png"), tr("Remove"), this);

    /* Group menu */
    QMenu groupMenu;
    groupMenu.setTitle("Set group");
    QStringListIterator it(QLCChannel::groupList());
    while (it.hasNext() == true)
        groupMenu.addAction(it.next());

    /* Master edit menu */
    QMenu menu;
    menu.setTitle(tr("Channels"));
    menu.addAction(&editAction);
    menu.addAction(&copyAction);
    menu.addAction(&pasteAction);
    menu.addSeparator();
    menu.addAction(&removeAction);
    menu.addSeparator();
    menu.addMenu(&groupMenu);

    if (m_channelList->currentItem() == NULL)
    {
        copyAction.setEnabled(false);
        removeAction.setEnabled(false);
    }

    if (_app->copyChannel() == NULL)
        pasteAction.setEnabled(false);

    QAction* selectedAction = menu.exec(QCursor::pos());
    if (selectedAction == NULL)
        return;
    else if (selectedAction->text() == tr("Edit"))
        slotEditChannel();
    else if (selectedAction->text() == tr("Copy"))
        slotCopyChannel();
    else if (selectedAction->text() == tr("Paste"))
        slotPasteChannel();
    else if (selectedAction->text() == tr("Remove"))
        slotRemoveChannel();
    else
    {
        /* Group menu hook */
        QLCChannel* ch = NULL;
        QTreeWidgetItem* node = NULL;

        ch = currentChannel();
        if (ch != NULL)
            ch->setGroup(QLCChannel::stringToGroup(selectedAction->text()));
        node = m_channelList->currentItem();
        if (node != NULL)
            node->setText(CH_COL_GRP, selectedAction->text());
        setModified();
    }
}
开发者ID:ChrisLaurie,项目名称:qlcplus,代码行数:60,代码来源:fixtureeditor.cpp


示例6: KXmlGuiWindow

SelectActionTest::SelectActionTest(QWidget *parent)
    : KXmlGuiWindow(parent)
    , m_comboSelect(new KSelectAction("Combo Selection", this))
    , m_buttonSelect(new KSelectAction("Button Selection", this))
{
    actionCollection()->addAction("combo", m_comboSelect);
    actionCollection()->addAction("button", m_buttonSelect);
    for (int i = 0; i < 7; ++i) {
      QAction* action = m_comboSelect->addAction(QString ("Combo Action %1").arg(i));
      connect(action, SIGNAL(triggered(bool)), SLOT(slotActionTriggered(bool)));
      action = m_buttonSelect->addAction(QString ("Action %1").arg(i));
      connect(action, SIGNAL(triggered(bool)), SLOT(slotActionTriggered(bool)));
    }

    m_comboSelect->setToolBarMode(KSelectAction::ComboBoxMode);
    m_comboSelect->setWhatsThis("What's this?");
    connect(m_comboSelect, SIGNAL(triggered(QAction*)), SLOT(triggered(QAction*)));
    connect(m_comboSelect, SIGNAL(triggered(int)), SLOT(triggered(int)));
    connect(m_comboSelect, SIGNAL(triggered(const QString&)), SLOT(triggered(const QString&)));

    m_buttonSelect->setToolBarMode(KSelectAction::MenuMode);
    m_buttonSelect->setWhatsThis("What's this?");
    connect(m_buttonSelect, SIGNAL(triggered(QAction*)), SLOT(triggered(QAction*)));
    connect(m_buttonSelect, SIGNAL(triggered(int)), SLOT(triggered(int)));
    connect(m_buttonSelect, SIGNAL(triggered(const QString&)), SLOT(triggered(const QString&)));

    menuBar()->addAction(m_comboSelect);
    menuBar()->addAction(m_buttonSelect);
    menuBar()->addAction("Add an action", this, SLOT(addAction()));
    menuBar()->addAction("Remove an action", this, SLOT(removeAction()));

    QToolBar* toolBar = addToolBar("Test");
    toolBar->addAction(m_comboSelect);
    toolBar->addAction(m_buttonSelect);
}
开发者ID:vasi,项目名称:kdelibs,代码行数:35,代码来源:kselectactiontest.cpp


示例7: contextMenu

void HistoryDialog::contextMenu(QPoint point)
{
  mContextIndex = ui->tableView->indexAt(point);;

  QMenu contextMenu(ui->tableView);

  QAction copyAction((mContextIndex.column() == 0) ? tr("Copy Path") : tr("Copy URL"), &contextMenu);
  connect(&copyAction, SIGNAL(triggered()), this, SLOT(copy()));
  contextMenu.addAction(&copyAction);

  QAction deleteAction(tr("Delete from imgur.com"), &contextMenu);
  QAction locationAction(tr("Open Location"), &contextMenu);

  QAction removeAction(tr("Remove history entry"), &contextMenu);

  if (mContextIndex.data().toString().isEmpty()) {
    copyAction.setEnabled(false);
    deleteAction.setEnabled(false);
  }

  if (mContextIndex.column() == 0) {
    connect(&locationAction, SIGNAL(triggered()), this, SLOT(location()));
    contextMenu.addAction(&locationAction);
  }
  else {
    connect(&deleteAction, SIGNAL(triggered()), this, SLOT(deleteImage()));
    contextMenu.addAction(&deleteAction);
  }

  connect(&removeAction, SIGNAL(triggered()), this, SLOT(removeHistoryEntry()));
  contextMenu.addAction(&removeAction);
  contextMenu.exec(QCursor::pos());
}
开发者ID:MEXXIO,项目名称:Lightscreen,代码行数:33,代码来源:historydialog.cpp


示例8: actions

CoverArtLabel::~CoverArtLabel()
{
    QList< QAction* > artActions = actions();
    foreach( QAction *act, artActions )
        removeAction( act );
    if ( p_item ) input_item_Release( p_item );
}
开发者ID:IAPark,项目名称:vlc,代码行数:7,代码来源:interface_widgets.cpp


示例9: ACS_TRACE

void BACIComponent::removeCallbackAndAction(int callbackID)
{
  ACS_TRACE("baci::BACIComponent::removeCallbackAndAction");

  removeAction(callbackID);
  removeCallback(callbackID);
}
开发者ID:jbarriosc,项目名称:ACS,代码行数:7,代码来源:baciBACIComponent.cpp


示例10: removeAction

void MessageWidget::removeAllActions()
{
     QList<QAction *> acts=actions();
     for (QAction *a: acts) {
         removeAction(a);
     }
}
开发者ID:padertux,项目名称:cantata,代码行数:7,代码来源:messagewidget.cpp


示例11: assert

void QtDockRegion::removeView(IView& view)
{
	auto qMainWindow = qtWindow_.window();
	if (qMainWindow == nullptr)
	{
		return;
	}

	auto findIt = dockWidgetMap_.find(&view);
	if (findIt == dockWidgetMap_.end())
	{
		return;
	}

	// TODO: save dockWidget state
	auto dockWidget = std::move(findIt->second.first);
	auto action = std::move(findIt->second.second);
	dockWidgetMap_.erase(findIt);

	auto application = get<IUIApplication>();
	assert(application != nullptr);
	application->removeAction(*action);
	action = nullptr;

	assert(dockWidget != nullptr);
	dockWidget->setWidget(nullptr);
	qMainWindow->removeDockWidget(dockWidget.get());
	// call this function to let IView control the qWidget's life-cycle again.
	auto qtFramework = get<IQtFramework>();
	assert(qtFramework != nullptr);
	qtFramework->retainQWidget(view);
	dockWidget = nullptr;
}
开发者ID:Aidanboneham,项目名称:wgtf,代码行数:33,代码来源:qt_dock_region.cpp


示例12: removeAction

void WindowMenu::onAboutToShow()
{
   QWidget* win = QApplication::activeWindow();
   pMinimize_->setEnabled(win);
   pZoom_->setEnabled(win && win->maximumSize() != win->minimumSize());
   pBringAllToFront_->setEnabled(win);


   for (int i = windows_.size() - 1; i >= 0; i--)
   {
      QAction* pAction = windows_[i];
      removeAction(pAction);
      windows_.removeAt(i);
      pAction->deleteLater();
   }

   QWidgetList topLevels = QApplication::topLevelWidgets();
   for (int i = 0; i < topLevels.size(); i++)
   {
      QWidget* pWindow = topLevels.at(i);
      if (!pWindow->isVisible())
         continue;

      QAction* pAction = new QAction(pWindow->windowTitle(), pWindow);
      pAction->setData(QVariant::fromValue(pWindow));
      pAction->setCheckable(true);
      if (pWindow->isActiveWindow())
         pAction->setChecked(true);
      insertAction(pWindowPlaceholder_, pAction);
      connect(pAction, SIGNAL(triggered()),
              this, SLOT(showWindow()));

      windows_.append(pAction);
   }
}
开发者ID:Sophrinix,项目名称:rstudio,代码行数:35,代码来源:DesktopMenuCallback.cpp


示例13: id

bool HistoryChatView::onContextMenu(ChatView *view, QMenu *menu, const QWebHitTestResult &result)
{
  ChatId id(view->id());
  if (id.type() != ChatId::ChannelId && id.type() != ChatId::UserId)
    return false;

  const QWebElement block = result.enclosingBlockElement();
  if (!block.hasClass("blocks") || block.hasClass("removed"))
    return false;

  const QWebElement container = block.parent();
  const qint64 mdate          = container.attribute(LS("data-mdate")).toLongLong();

  if (!mdate)
    return false;

  id.init(container.attribute(LS("id")).toLatin1());
  id.setDate(mdate);
  if (id.type() != ChatId::MessageId)
    return false;

  const int permissions = this->permissions(HistoryDB::get(id));
  if (permissions == NoPermissions)
    return false;

  if (permissions & Remove) {
    QVariantList data;
    data << view->id() << (id.hasOid() ? ChatId::toBase32(id.oid().byteArray()) : id.toString());

    menu->insertAction(menu->actions().first(), removeAction(data));
  }
  return true;
}
开发者ID:youngdev,项目名称:schat,代码行数:33,代码来源:HistoryChatView.cpp


示例14: while

// --------------------------------------------------------------------------------------------------------
void KikiEvent::removeAllActions ()
{
    while (actions.empty() == false)
    {
        removeAction(actions.back());
    }
}
开发者ID:Frizlab,项目名称:kiki,代码行数:8,代码来源:KikiEvent.cpp


示例15: Q_UNUSED

void LayerAclMenu::rowsRemoved(const QModelIndex &parent, int start, int end)
{
	Q_UNUSED(parent);
	for(int i=start;i<=end;++i) {
		removeAction(_users.takeAt(start));
	}
}
开发者ID:Rambo2015,项目名称:Drawpile,代码行数:7,代码来源:layeraclmenu.cpp


示例16: actions

CoverArtLabel::~CoverArtLabel()
{
    QList< QAction* > artActions = actions();
    foreach( QAction *act, artActions )
        removeAction( act );
    if ( p_item ) vlc_gc_decref( p_item );
}
开发者ID:BloodExecutioner,项目名称:vlc,代码行数:7,代码来源:interface_widgets.cpp


示例17: viewport

void DisassemblyView::showContextMenu(QPoint const & pos)
{
  QMenu menu;
  QPoint globalPos = viewport()->mapToGlobal(pos);

  medusa::Address CurAddr;
  std::list<QAction *> DynActs;
  if (convertPositionToAddress(pos, CurAddr))
  {
    auto SpecActions = medusa::Action::GetSpecificActions(*_core, CurAddr);
    for (auto spAct : SpecActions)
    {
      auto pUiAct = new UiAction(this, spAct, QKeySequence(), this);
      addAction(pUiAct);
      DynActs.push_back(pUiAct);
    }
  }

  menu.addActions(actions());
  menu.exec(globalPos);

  for (auto pAct : DynActs)
  {
    removeAction(pAct);
    delete pAct;
  }
}
开发者ID:GrimDerp,项目名称:medusa,代码行数:27,代码来源:DisassemblyView.cpp


示例18: removeAction

// main loop
void CCActionManager::update(float dt)
{
    dt = 1/60.0f;
    for (tHashElement *elt = m_pTargets; elt != NULL; )
    {
        m_pCurrentTarget = elt;
        m_bCurrentTargetSalvaged = false;

        if (! m_pCurrentTarget->paused)
        {
            // The 'actions' CCMutableArray may change while inside this loop.
            for (m_pCurrentTarget->actionIndex = 0; m_pCurrentTarget->actionIndex < m_pCurrentTarget->actions->num;
                m_pCurrentTarget->actionIndex++)
            {
                m_pCurrentTarget->currentAction = (CCAction*)m_pCurrentTarget->actions->arr[m_pCurrentTarget->actionIndex];
                if (m_pCurrentTarget->currentAction == NULL)
                {
                    continue;
                }

                m_pCurrentTarget->currentActionSalvaged = false;

                m_pCurrentTarget->currentAction->step(dt);

                if (m_pCurrentTarget->currentActionSalvaged)
                {
                    // The currentAction told the node to remove it. To prevent the action from
                    // accidentally deallocating itself before finishing its step, we retained
                    // it. Now that step is done, it's safe to release it.
                    m_pCurrentTarget->currentAction->release();
                } else
                if (m_pCurrentTarget->currentAction->isDone())
                {
                    m_pCurrentTarget->currentAction->stop();

                    CCAction *pAction = m_pCurrentTarget->currentAction;
                    // Make currentAction nil to prevent removeAction from salvaging it.
                    m_pCurrentTarget->currentAction = NULL;
                    removeAction(pAction);
                }

                m_pCurrentTarget->currentAction = NULL;
            }
        }

        // elt, at this moment, is still valid
        // so it is safe to ask this here (issue #490)
        elt = (tHashElement*)(elt->hh.next);

        // only delete currentTarget if no actions were scheduled during the cycle (issue #481)
        if (m_bCurrentTargetSalvaged && m_pCurrentTarget->actions->num == 0)
        {
            deleteHashElement(m_pCurrentTarget);
        }
    }

    // issue #635
    m_pCurrentTarget = NULL;
}
开发者ID:AojiaoZero,项目名称:CrossApp,代码行数:60,代码来源:CCActionManager.cpp


示例19: LOG_DEBUG

GVariant* GnomeGrabber::Impl::onShellMethodCall(std::string const& method, GVariant* parameters)
{
  LOG_DEBUG(logger) << "Called method '" << method << "'";

  if (method == "GrabAccelerators")
  {
    if (g_variant_is_of_type(parameters, G_VARIANT_TYPE("(a(su))")))
    {
      GVariant* variant;
      GVariantBuilder builder;
      GVariantIter* iterator;
      gchar const* accelerator;
      guint flags;

      g_variant_builder_init(&builder, G_VARIANT_TYPE("au"));
      g_variant_get(parameters, "(a(su))", &iterator);

      while (g_variant_iter_next(iterator, "(&su)", &accelerator, &flags))
        g_variant_builder_add(&builder, "u", grabAccelerator(accelerator, flags));

      g_variant_iter_free(iterator);
      variant = g_variant_builder_end(&builder);
      return g_variant_new_tuple(&variant, 1);
    }
    else
      LOG_WARN(logger) << "Expected arguments of type (a(su))";
  }
  else if (method == "GrabAccelerator")
  {
    if (g_variant_is_of_type(parameters, G_VARIANT_TYPE("(su)")))
    {
      GVariant* variant;
      gchar const* accelerator;
      guint flags;

      g_variant_get(parameters, "(&su)", &accelerator, &flags);
      variant = g_variant_new_uint32(grabAccelerator(accelerator, flags));
      return g_variant_new_tuple(&variant, 1);
    }
    else
      LOG_WARN(logger) << "Expected arguments of type (su)";
  }
  else if (method == "UngrabAccelerator")
  {
    if (g_variant_is_of_type(parameters, G_VARIANT_TYPE("(u)")))
    {
      GVariant* variant;
      guint action;

      g_variant_get(parameters, "(u)", &action);
      variant = g_variant_new_boolean(removeAction(action));
      return g_variant_new_tuple(&variant, 1);
    }
    else
      LOG_WARN(logger) << "Expected arguments of type (u)";
  }

  return nullptr;
}
开发者ID:jonjahren,项目名称:unity,代码行数:59,代码来源:GnomeKeyGrabber.cpp


示例20: removeAction

void ToolBar::removeSpinBox()
{
    if (spinboxAction)
        removeAction(spinboxAction);

    addSpinBoxAction->setEnabled(true);
    removeSpinBoxAction->setEnabled(false);
}
开发者ID:BGmot,项目名称:Qt,代码行数:8,代码来源:toolbar.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ removeChild函数代码示例发布时间:2022-05-30
下一篇:
C++ remote_get函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap