本文整理汇总了C++中KActionCollection::takeAction方法的典型用法代码示例。如果您正苦于以下问题:C++ KActionCollection::takeAction方法的具体用法?C++ KActionCollection::takeAction怎么用?C++ KActionCollection::takeAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KActionCollection
的用法示例。
在下文中一共展示了KActionCollection::takeAction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setCanvas
void KisColorSelectorNgDockerWidget::setCanvas(KisCanvas2 *canvas)
{
if (m_canvas) {
m_canvas->disconnect(this);
KActionCollection *ac = m_canvas->viewManager()->actionCollection();
ac->takeAction(ac->action("show_color_history"));
ac->takeAction(ac->action("show_common_colors"));
}
m_canvas = canvas;
m_commonColorsWidget->setCanvas(canvas);
m_colorHistoryWidget->setCanvas(canvas);
m_colorSelectorContainer->setCanvas(canvas);
if (m_canvas && m_canvas->viewManager()) {
if (m_canvas->viewManager()->nodeManager()) {
connect(m_canvas->viewManager()->nodeManager(), SIGNAL(sigLayerActivated(KisLayerSP)), SLOT(reactOnLayerChange()), Qt::UniqueConnection);
}
KActionCollection* actionCollection = canvas->viewManager()->actionCollection();
actionCollection->addAction("show_color_history", m_colorHistoryAction);
actionCollection->addAction("show_common_colors", m_commonColorsAction);
}
reactOnLayerChange();
}