本文整理汇总了C++中KActionCollection::addAction方法的典型用法代码示例。如果您正苦于以下问题:C++ KActionCollection::addAction方法的具体用法?C++ KActionCollection::addAction怎么用?C++ KActionCollection::addAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KActionCollection
的用法示例。
在下文中一共展示了KActionCollection::addAction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupActions
void TorrentActivity::setupActions()
{
KActionCollection* ac = part()->actionCollection();
start_all_action = new QAction(QIcon::fromTheme(QStringLiteral("kt-start-all")), i18n("Start All"), this);
start_all_action->setToolTip(i18n("Start all torrents"));
connect(start_all_action, &QAction::triggered, this, &TorrentActivity::startAllTorrents);
ac->addAction(QStringLiteral("start_all"), start_all_action);
stop_all_action = new QAction(QIcon::fromTheme(QStringLiteral("kt-stop-all")), i18n("Stop All"), this);
stop_all_action->setToolTip(i18n("Stop all torrents"));
connect(stop_all_action, &QAction::triggered, this, &TorrentActivity::stopAllTorrents);
ac->addAction(QStringLiteral("stop_all"), stop_all_action);
queue_suspend_action = new KToggleAction(QIcon::fromTheme(QStringLiteral("kt-pause")), i18n("Suspend Torrents"), this);
ac->addAction(QStringLiteral("queue_suspend"), queue_suspend_action);
ac->setDefaultShortcut(queue_suspend_action, QKeySequence(Qt::SHIFT + Qt::Key_P));
queue_suspend_action->setToolTip(i18n("Suspend all running torrents"));
//KF5 queue_suspend_action->setGlobalShortcut(QKeySequence(Qt::ALT + Qt::SHIFT + Qt::Key_P));
connect(queue_suspend_action, &KToggleAction::toggled, this, &TorrentActivity::suspendQueue);
show_group_view_action = new KToggleAction(QIcon::fromTheme(QStringLiteral("view-list-tree")), i18n("Group View"), this);
show_group_view_action->setToolTip(i18n("Show or hide the group view"));
connect(show_group_view_action, &QAction::toggled, this, &TorrentActivity::setGroupViewVisible);
ac->addAction(QStringLiteral("show_group_view"), show_group_view_action);
filter_torrent_action = new QAction(i18n("Filter Torrents"), this);
filter_torrent_action->setToolTip(i18n("Filter torrents based on filter string"));
connect(filter_torrent_action, &QAction::triggered, search_bar, &TorrentSearchBar::showBar);
ac->addAction(QStringLiteral("filter_torrent"), filter_torrent_action);
ac->setDefaultShortcut(filter_torrent_action, QKeySequence(Qt::CTRL + Qt::Key_F));
view->setupActions(ac);
}
示例2: setupActions
void TorrentActivity::setupActions()
{
KActionCollection* ac = part()->actionCollection();
start_all_action = new KAction(KIcon("kt-start-all"), i18n("Start All"), this);
start_all_action->setToolTip(i18n("Start all torrents"));
connect(start_all_action, SIGNAL(triggered()), this, SLOT(startAllTorrents()));
ac->addAction("start_all", start_all_action);
stop_all_action = new KAction(KIcon("kt-stop-all"), i18n("Stop All"), this);
stop_all_action->setToolTip(i18n("Stop all torrents"));
connect(stop_all_action, SIGNAL(triggered()), this, SLOT(stopAllTorrents()));
ac->addAction("stop_all", stop_all_action);
queue_suspend_action = new KToggleAction(KIcon("kt-pause"), i18n("Suspend Torrents"), this);
ac->addAction("queue_suspend", queue_suspend_action);
queue_suspend_action->setToolTip(i18n("Suspend all running torrents"));
queue_suspend_action->setShortcut(KShortcut(Qt::SHIFT + Qt::Key_P));
queue_suspend_action->setGlobalShortcut(KShortcut(Qt::ALT + Qt::SHIFT + Qt::Key_P));
connect(queue_suspend_action, SIGNAL(toggled(bool)), this, SLOT(suspendQueue(bool)));
show_group_view_action = new KToggleAction(KIcon("view-list-tree"), i18n("Group View Visible"), this);
show_group_view_action->setToolTip(i18n("Show or hide the group view"));
connect(show_group_view_action, SIGNAL(toggled(bool)), this, SLOT(setGroupViewVisible(bool)));
ac->addAction("show_group_view", show_group_view_action);
filter_torrent_action = new KAction(i18n("Filter Torrents"), this);
filter_torrent_action->setToolTip(i18n("Filter torrents based on filter string"));
filter_torrent_action->setShortcut(Qt::CTRL + Qt::Key_F);
connect(filter_torrent_action, SIGNAL(triggered(bool)), search_bar, SLOT(showBar()));
ac->addAction("filter_torrent", filter_torrent_action);
view->setupActions(ac);
}
示例3: setupActions
void GUI::setupActions()
{
KActionCollection* ac = actionCollection();
KAction* new_action = KStandardAction::openNew(this, SLOT(createTorrent()), ac);
new_action->setToolTip(i18n("Create a new torrent"));
KAction* open_action = KStandardAction::open(this, SLOT(openTorrent()), ac);
open_action->setToolTip(i18n("Open a torrent"));
paste_action = KStandardAction::paste(this, SLOT(paste()), ac);
open_silently_action = new KAction(KIcon(open_action->icon()), i18n("Open Silently"), this);
open_silently_action->setToolTip(i18n("Open a torrent without asking any questions"));
connect(open_silently_action, SIGNAL(triggered()), this, SLOT(openTorrentSilently()));
ac->addAction("file_open_silently", open_silently_action);
KStandardAction::quit(this, SLOT(quit()), ac);
show_status_bar_action = KStandardAction::showStatusbar(this, SLOT(showStatusBar()), ac);
show_status_bar_action->setIcon(KIcon("kt-show-statusbar"));
show_menu_bar_action = KStandardAction::showMenubar(this, SLOT(showMenuBar()), ac);
KStandardAction::preferences(this, SLOT(showPrefDialog()), ac);
KStandardAction::keyBindings(this, SLOT(configureKeys()), ac);
KStandardAction::configureToolbars(this, SLOT(configureToolbars()), ac);
KStandardAction::configureNotifications(this, SLOT(configureNotifications()), ac);
paste_url_action = new KAction(KIcon("document-open-remote"), i18n("Open URL"), this);
paste_url_action->setToolTip(i18n("Open a URL which points to a torrent, magnet links are supported"));
paste_url_action->setShortcut(KShortcut(Qt::CTRL + Qt::Key_P));
connect(paste_url_action, SIGNAL(triggered()), this, SLOT(pasteURL()));
ac->addAction("paste_url", paste_url_action);
ipfilter_action = new KAction(KIcon("view-filter"), i18n("IP Filter"), this);
ipfilter_action->setToolTip(i18n("Show the list of blocked IP addresses"));
ipfilter_action->setShortcut(KShortcut(Qt::CTRL + Qt::Key_I));
connect(ipfilter_action, SIGNAL(triggered()), this, SLOT(showIPFilter()));
ac->addAction("ipfilter_action", ipfilter_action);
import_action = new KAction(KIcon("document-import"), i18n("Import Torrent"), this);
import_action->setToolTip(i18n("Import a torrent"));
import_action->setShortcut(KShortcut(Qt::SHIFT + Qt::Key_I));
connect(import_action, SIGNAL(triggered()), this, SLOT(import()));
ac->addAction("import", import_action);
show_kt_action = new KAction(KIcon("kt-show-hide"), i18n("Show/Hide KTorrent"), this);
connect(show_kt_action, SIGNAL(triggered()), this, SLOT(showOrHide()));
ac->addAction("show_kt", show_kt_action);
show_kt_action->setGlobalShortcut(KShortcut(Qt::ALT + Qt::SHIFT + Qt::Key_T));
setStandardToolBarMenuEnabled(true);
}
示例4: setupActions
void SearchActivity::setupActions()
{
KActionCollection* ac = part()->actionCollection();
search_action = new KAction(KIcon("edit-find"),i18n("Search"),this);
connect(search_action,SIGNAL(triggered()),this,SLOT(search()));
ac->addAction("search_tab_search",search_action);
find_action = KStandardAction::find(this,SLOT(find()),this);
ac->addAction("search_tab_find",find_action);
home_action = KStandardAction::home(this,SLOT(home()),this);
ac->addAction("search_home",home_action);
}
示例5: mGroupedViews
SwitchViewController::SwitchViewController( AbstractGroupedViews* groupedViews, KXMLGUIClient* guiClient )
: mGroupedViews( groupedViews )
{
KActionCollection* actionCollection = guiClient->actionCollection();
mForwardAction = actionCollection->addAction( KStandardAction::Forward, QStringLiteral("window_next"), this, SLOT(forward()) );
mBackwardAction = actionCollection->addAction( KStandardAction::Back, QStringLiteral("window_previous"), this, SLOT(backward()) );
connect( groupedViews, SIGNAL(added(QList<Kasten::AbstractView*>)), SLOT(updateActions()) );
connect( groupedViews, SIGNAL(removing(QList<Kasten::AbstractView*>)), SLOT(updateActions()) );
connect( groupedViews, SIGNAL(viewFocusChanged(Kasten::AbstractView*)), SLOT(updateActions()) );
updateActions();
}
示例6: initTabWidget
void ActionManagerImpl::initTabWidget(TabWidget* tabWidget)
{
if (d->tabWidget)
return;
else
d->tabWidget = tabWidget;
KActionCollection *coll = actionCollection();
KAction *action = coll->addAction("select_next_tab");
action->setText(i18n("Select Next Tab"));
connect(action, SIGNAL(triggered(bool)), d->tabWidget, SLOT(slotNextTab()));
action->setShortcuts(KShortcut( "Ctrl+Period" ));
action = coll->addAction("select_previous_tab");
action->setText(i18n("Select Previous Tab"));
connect(action, SIGNAL(triggered(bool)), d->tabWidget, SLOT(slotPreviousTab()));
action->setShortcuts(KShortcut( "Ctrl+Comma" ));
action = coll->addAction("tab_detach");
action->setIcon(KIcon("tab-detach"));
action->setText(i18n("Detach Tab"));
connect(action, SIGNAL(triggered(bool)), d->tabWidget, SLOT(slotDetachTab()));
action->setShortcut(QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_B));
action = coll->addAction("tab_copylinkaddress");
action->setText(i18n("Copy Link Address"));
connect(action, SIGNAL(triggered(bool)), d->tabWidget, SLOT(slotCopyLinkAddress()));
action = coll->addAction("tab_remove");
action->setIcon(KIcon("tab-close"));
action->setText(i18n("Close Tab"));
connect(action, SIGNAL(triggered(bool)), d->tabWidget, SLOT(slotCloseTab()));
action->setShortcuts(KStandardShortcut::close());
action = coll->addAction("inc_font_sizes");
action->setIcon(KIcon("format-font-size-more"));
action->setText(i18n("Enlarge Font"));
connect(action, SIGNAL(triggered(bool)), d->tabWidget, SLOT(slotFrameZoomIn()));
action->setShortcut( QKeySequence::ZoomIn );
action = coll->addAction("dec_font_sizes");
action->setIcon(KIcon("format-font-size-less"));
action->setText(i18n("Shrink Font"));
connect(action, SIGNAL(triggered(bool)), d->tabWidget, SLOT(slotFrameZoomOut()));
action->setShortcut( QKeySequence::ZoomOut );
QString actionname;
for (int i=1;i<10;i++) {
actionname.sprintf("activate_tab_%02d", i);
action = new KAction( i18n("Activate Tab %1", i),this );
action->setShortcut( QKeySequence( QString::fromLatin1( "Alt+%1" ).arg( i ) ) );
coll->addAction( actionname, action );
connect( action, SIGNAL(triggered(bool)), d->tabWidget, SLOT(slotActivateTab()) );
}
}
示例7: 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();
}
示例8: reconfigure
WindowGeometry::WindowGeometry()
{
iAmActivated = true;
iAmActive = false;
myResizeWindow = 0L;
#define myResizeString "Window geometry display, %1 and %2 are the new size," \
" %3 and %4 are pixel increments - avoid reformatting or suffixes like 'px'", \
"Width: %1 (%3)\nHeight: %2 (%4)"
#define myCoordString_0 "Window geometry display, %1 and %2 are the cartesian x and y coordinates" \
" - avoid reformatting or suffixes like 'px'", \
"X: %1\nY: %2"
#define myCoordString_1 "Window geometry display, %1 and %2 are the cartesian x and y coordinates," \
" %3 and %4 are the resp. increments - avoid reformatting or suffixes like 'px'", \
"X: %1 (%3)\nY: %2 (%4)"
reconfigure(ReconfigureAll);
QFont fnt; fnt.setBold(true); fnt.setPointSize(12);
for (int i = 0; i < 3; ++i) {
myMeasure[i] = effects->effectFrame(EffectFrameUnstyled, false);
myMeasure[i]->setFont(fnt);
}
myMeasure[0]->setAlignment(Qt::AlignLeft | Qt::AlignTop);
myMeasure[1]->setAlignment(Qt::AlignCenter);
myMeasure[2]->setAlignment(Qt::AlignRight | Qt::AlignBottom);
KActionCollection* actionCollection = new KActionCollection(this);
KAction* a = static_cast< KAction* >(actionCollection->addAction("WindowGeometry"));
a->setText(i18n("Toggle window geometry display (effect only)"));
a->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_F11));
connect(a, SIGNAL(triggered(bool)), this, SLOT(toggle()));
connect(effects, SIGNAL(windowStartUserMovedResized(KWin::EffectWindow*)), this, SLOT(slotWindowStartUserMovedResized(KWin::EffectWindow*)));
connect(effects, SIGNAL(windowFinishUserMovedResized(KWin::EffectWindow*)), this, SLOT(slotWindowFinishUserMovedResized(KWin::EffectWindow*)));
connect(effects, SIGNAL(windowStepUserMovedResized(KWin::EffectWindow*,QRect)), this, SLOT(slotWindowStepUserMovedResized(KWin::EffectWindow*,QRect)));
}
示例9: cut
KAction *create(StandardAction id, const QObject *recvr, const char *slot, QObject *parent)
{
KAction *pAction = 0;
const Info* pInfo = infoPtr(id);
if (pInfo) {
pAction = new KAction(parent);
pAction->setObjectName(pInfo->psName);
KShortcut cut(pInfo->shortcut);
if (!cut.isEmpty())
pAction->setShortcut(cut);
pAction->setText(i18n(pInfo->psText));
pAction->setToolTip(i18n(pInfo->psToolTip));
pAction->setWhatsThis(i18n(pInfo->psWhatsThis));
if (pInfo->psIconName)
pAction->setIcon(KIcon(QLatin1String(pInfo->psIconName)));
}
if (recvr && slot)
QObject::connect(pAction, SIGNAL(triggered(bool)), recvr, slot);
if (pAction) {
KActionCollection *collection = qobject_cast<KActionCollection *>(parent);
if (collection)
collection->addAction(pAction->objectName(), pAction);
}
return pAction;
}
示例10: KActionCollection
MouseMarkEffect::MouseMarkEffect()
{
KActionCollection* actionCollection = new KActionCollection(this);
KAction* a = static_cast< KAction* >(actionCollection->addAction("ClearMouseMarks"));
a->setText(i18n("Clear All Mouse Marks"));
a->setGlobalShortcut(KShortcut(Qt::SHIFT + Qt::META + Qt::Key_F11));
connect(a, SIGNAL(triggered(bool)), this, SLOT(clear()));
a = static_cast< KAction* >(actionCollection->addAction("ClearLastMouseMark"));
a->setText(i18n("Clear Last Mouse Mark"));
a->setGlobalShortcut(KShortcut(Qt::SHIFT + Qt::META + Qt::Key_F12));
connect(a, SIGNAL(triggered(bool)), this, SLOT(clearLast()));
connect(effects, SIGNAL(mouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers)),
this, SLOT(slotMouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers)));
reconfigure(ReconfigureAll);
arrow_start = NULL_POINT;
effects->startMousePolling(); // We require it to detect activation as well
}
示例11: setupActions
void SyndicationPlugin::setupActions()
{
KActionCollection* ac = actionCollection();
add_feed = new KAction(KIcon("kt-add-feeds"), i18n("Add Feed"), this);
ac->addAction("add_feed", add_feed);
remove_feed = new KAction(KIcon("kt-remove-feeds"), i18n("Remove Feed"), this);
ac->addAction("remove_feed", remove_feed);
manage_filters = new KAction(KIcon("view-filter"), i18n("Add/Remove Filters"), this);
ac->addAction("manage_filters", manage_filters);
edit_feed_name = new KAction(KIcon("edit-rename"), i18n("Rename"), this);
ac->addAction("edit_feed_name", edit_feed_name);
add_filter = new KAction(KIcon("kt-add-filters"), i18n("Add Filter"), this);
ac->addAction("add_filter", add_filter);
remove_filter = new KAction(KIcon("kt-remove-filters"), i18n("Remove Filter"), this);
ac->addAction("remove_filter", remove_filter);
edit_filter = new KAction(KIcon("preferences-other"), i18n("Edit Filter"), this);
ac->addAction("edit_filter", edit_filter);
remove_filter->setEnabled(false);
edit_filter->setEnabled(false);
remove_feed->setEnabled(false);
manage_filters->setEnabled(false);
}
示例12: setupActions
void ScriptManager::setupActions()
{
KActionCollection* ac = part()->actionCollection();
add_script = new QAction(QIcon::fromTheme("list-add"), i18n("Add Script"), this);
connect(add_script, SIGNAL(triggered()), this, SIGNAL(addScript()));
ac->addAction("add_script", add_script);
remove_script = new QAction(QIcon::fromTheme("list-remove"), i18n("Remove Script"), this);
connect(remove_script, SIGNAL(triggered()), this, SIGNAL(removeScript()));
ac->addAction("remove_script", remove_script);
run_script = new QAction(QIcon::fromTheme("system-run"), i18n("Run Script"), this);
connect(run_script, SIGNAL(triggered()), this, SLOT(runScript()));
ac->addAction("run_script", run_script);
stop_script = new QAction(QIcon::fromTheme("media-playback-stop"), i18n("Stop Script"), this);
connect(stop_script, SIGNAL(triggered()), this, SLOT(stopScript()));
ac->addAction("stop_script", stop_script);
edit_script = new QAction(QIcon::fromTheme("document-open"), i18n("Edit Script"), this);
connect(edit_script, SIGNAL(triggered()), this, SLOT(editScript()));
ac->addAction("edit_script", edit_script);
properties = new QAction(QIcon::fromTheme("dialog-information"), i18n("Properties"), this);
connect(properties, SIGNAL(triggered()), this, SLOT(showProperties()));
ac->addAction("script_properties", properties);
configure_script = new QAction(QIcon::fromTheme("preferences-other"), i18n("Configure"), this);
connect(configure_script, SIGNAL(triggered()), this, SLOT(configureScript()));
ac->addAction("configure_script", configure_script);
}
示例13: KActionCollection
ThumbnailAsideEffect::ThumbnailAsideEffect()
{
KActionCollection* actionCollection = new KActionCollection( this );
KAction* a = (KAction*)actionCollection->addAction( "ToggleCurrentThumbnail" );
a->setText( i18n("Toggle Thumbnail for Current Window" ));
a->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::META + Qt::Key_T));
connect(a, SIGNAL(triggered(bool)), this, SLOT(toggleCurrentThumbnail()));
reconfigure( ReconfigureAll );
}
示例14: QObject
KompareModelList::KompareModelList( DiffSettings* diffSettings, QWidget* widgetForKIO, QObject* parent, const char* name )
: QObject( parent ),
m_diffProcess( 0 ),
m_diffSettings( diffSettings ),
m_models( 0 ),
m_selectedModel( 0 ),
m_selectedDifference( 0 ),
m_modelIndex( 0 ),
m_info( 0 ),
m_textCodec( 0 ),
m_widgetForKIO( widgetForKIO )
{
kDebug(8101) << "Show me the arguments: " << diffSettings << ", " << widgetForKIO << ", " << parent << ", " << name << endl;
KActionCollection *ac = ((KomparePart*) parent)->actionCollection();
m_applyDifference = ac->addAction( "difference_apply", this, SLOT(slotActionApplyDifference()) );
m_applyDifference->setIcon( KIcon("arrow-right") );
m_applyDifference->setText( i18n("&Apply Difference") );
m_applyDifference->setShortcut( QKeySequence(Qt::Key_Space) );
m_unApplyDifference = ac->addAction( "difference_unapply", this, SLOT(slotActionUnApplyDifference()) );
m_unApplyDifference->setIcon( KIcon("arrow-left") );
m_unApplyDifference->setText( i18n("Un&apply Difference") );
m_unApplyDifference->setShortcut( QKeySequence(Qt::Key_Backspace) );
m_applyAll = ac->addAction( "difference_applyall", this, SLOT(slotActionApplyAllDifferences()) );
m_applyAll->setIcon( KIcon("arrow-right-double") );
m_applyAll->setText( i18n("App&ly All") );
m_applyAll->setShortcut( QKeySequence(Qt::CTRL + Qt::Key_A) );
m_unapplyAll = ac->addAction( "difference_unapplyall", this, SLOT(slotActionUnapplyAllDifferences()) );
m_unapplyAll->setIcon( KIcon("arrow-left-double") );
m_unapplyAll->setText( i18n("&Unapply All") );
m_unapplyAll->setShortcut( QKeySequence(Qt::CTRL + Qt::Key_U) );
m_previousFile = ac->addAction( "difference_previousfile", this, SLOT(slotPreviousModel()) );
m_previousFile->setIcon( KIcon("arrow-up-double") );
m_previousFile->setText( i18n("P&revious File") );
m_previousFile->setShortcut( QKeySequence(Qt::CTRL + Qt::Key_PageUp) );
m_nextFile = ac->addAction( "difference_nextfile", this, SLOT(slotNextModel()) );
m_nextFile->setIcon( KIcon("arrow-down-double") );
m_nextFile->setText( i18n("N&ext File") );
m_nextFile->setShortcut( QKeySequence(Qt::CTRL + Qt::Key_PageDown) );
m_previousDifference = ac->addAction( "difference_previous", this, SLOT(slotPreviousDifference()) );
m_previousDifference->setIcon( KIcon("arrow-up") );
m_previousDifference->setText( i18n("&Previous Difference") );
m_previousDifference->setShortcut( QKeySequence(Qt::CTRL + Qt::Key_Up) );
m_nextDifference = ac->addAction( "difference_next", this, SLOT(slotNextDifference()) );
m_nextDifference->setIcon( KIcon("arrow-down") );
m_nextDifference->setText( i18n("&Next Difference") );
m_nextDifference->setShortcut( QKeySequence(Qt::CTRL + Qt::Key_Down) );
m_previousDifference->setEnabled( false );
m_nextDifference->setEnabled( false );
m_save = KStandardAction::save( this, SLOT(slotSaveDestination()), ac );
m_save->setEnabled( false );
updateModelListActions();
}
示例15: initArticleViewer
void ActionManagerImpl::initArticleViewer(ArticleViewer* articleViewer)
{
if (d->articleViewer)
return;
else
d->articleViewer = articleViewer;
KActionCollection* coll = actionCollection();
KAction* action = 0;
action = KStandardAction::print(articleViewer, SLOT(slotPrint()), actionCollection());
coll->addAction("viewer_print", action);
action = KStandardAction::copy(articleViewer, SLOT(slotCopy()), coll);
coll->addAction("viewer_copy", action);
connect(d->tabWidget, SIGNAL(signalZoomInFrame(int)), d->articleViewer, SLOT(slotZoomIn(int)));
connect(d->tabWidget, SIGNAL(signalZoomOutFrame(int)), d->articleViewer, SLOT(slotZoomOut(int)));
}