本文整理汇总了C++中KActionMenu::addSeparator方法的典型用法代码示例。如果您正苦于以下问题:C++ KActionMenu::addSeparator方法的具体用法?C++ KActionMenu::addSeparator怎么用?C++ KActionMenu::addSeparator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KActionMenu
的用法示例。
在下文中一共展示了KActionMenu::addSeparator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupToolbar
void FileBrowserWidget::setupToolbar()
{
KActionCollection *coll = m_dirOperator->actionCollection();
m_toolbar->addAction(coll->action("back"));
m_toolbar->addAction(coll->action("forward"));
KAction *action = new KAction(this);
action->setIcon(SmallIcon("document-open"));
action->setText(i18n("Open selected"));
connect(action, SIGNAL(triggered()), this, SLOT(emitFileSelectedSignal()));
m_toolbar->addAction(action);
// section for settings menu
KActionMenu *optionsMenu = new KActionMenu(KIcon("configure"), i18n("Options"), this);
optionsMenu->setDelayed(false);
optionsMenu->addAction(m_dirOperator->actionCollection()->action("short view"));
optionsMenu->addAction(m_dirOperator->actionCollection()->action("detailed view"));
optionsMenu->addAction(m_dirOperator->actionCollection()->action("tree view"));
optionsMenu->addAction(m_dirOperator->actionCollection()->action("detailed tree view"));
optionsMenu->addSeparator();
optionsMenu->addAction(m_dirOperator->actionCollection()->action("show hidden"));
m_toolbar->addSeparator();
m_toolbar->addAction(optionsMenu);
}
示例2: setupToolbar
void FileBrowserWidget::setupToolbar()
{
KActionCollection *coll = m_dirOperator->actionCollection();
m_toolbar->addAction(coll->action("back"));
m_toolbar->addAction(coll->action("forward"));
QAction *action = new QAction(this);
action->setIcon(QIcon::fromTheme("document-open"));
action->setText(i18n("Open selected"));
connect(action, SIGNAL(triggered()), this, SLOT(emitFileSelectedSignal()));
m_toolbar->addAction(action);
QAction *showOnlyLaTexFilesAction = new QAction(this);
showOnlyLaTexFilesAction->setText(i18n("Show LaTeX Files Only"));
showOnlyLaTexFilesAction->setCheckable(true);
showOnlyLaTexFilesAction->setChecked(KileConfig::showLaTeXFilesOnly());
connect(showOnlyLaTexFilesAction, SIGNAL(triggered(bool)), this, SLOT(toggleShowLaTeXFilesOnly(bool)));
// section for settings menu
KActionMenu *optionsMenu = new KActionMenu(QIcon::fromTheme("configure"), i18n("Options"), this);
optionsMenu->setDelayed(false);
optionsMenu->addAction(m_dirOperator->actionCollection()->action("short view"));
optionsMenu->addAction(m_dirOperator->actionCollection()->action("detailed view"));
optionsMenu->addAction(m_dirOperator->actionCollection()->action("tree view"));
optionsMenu->addAction(m_dirOperator->actionCollection()->action("detailed tree view"));
optionsMenu->addSeparator();
optionsMenu->addAction(showOnlyLaTexFilesAction);
optionsMenu->addAction(m_dirOperator->actionCollection()->action("show hidden"));
m_toolbar->addSeparator();
m_toolbar->addAction(optionsMenu);
}