本文整理汇总了C++中KAction::unplugAll方法的典型用法代码示例。如果您正苦于以下问题:C++ KAction::unplugAll方法的具体用法?C++ KAction::unplugAll怎么用?C++ KAction::unplugAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KAction
的用法示例。
在下文中一共展示了KAction::unplugAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setInstance
KHTMLImage::KHTMLImage(QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name, KHTMLPart::GUIProfile prof)
: KParts::ReadOnlyPart(parent, name), m_image(0)
{
KHTMLPart *parentPart = ::qt_cast< KHTMLPart * >(parent);
setInstance(KHTMLImageFactory::instance(), prof == KHTMLPart::BrowserViewGUI && !parentPart);
QVBox *box = new QVBox(parentWidget, widgetName);
m_khtml = new KHTMLPart(box, widgetName, this, "htmlimagepart", prof);
m_khtml->setAutoloadImages(true);
m_khtml->widget()->installEventFilter(this);
connect(m_khtml->view(), SIGNAL(finishedLayout()), this, SLOT(restoreScrollPosition()));
setWidget(box);
// VBox can't take focus, so pass it on to sub-widget
box->setFocusProxy(m_khtml->widget());
m_ext = new KHTMLImageBrowserExtension(this, "be");
// Remove unnecessary actions.
KAction *encodingAction = actionCollection()->action("setEncoding");
if(encodingAction)
{
encodingAction->unplugAll();
delete encodingAction;
}
KAction *viewSourceAction = actionCollection()->action("viewDocumentSource");
if(viewSourceAction)
{
viewSourceAction->unplugAll();
delete viewSourceAction;
}
KAction *selectAllAction = actionCollection()->action("selectAll");
if(selectAllAction)
{
selectAllAction->unplugAll();
delete selectAllAction;
}
// forward important signals from the khtml part
// forward opening requests to parent frame (if existing)
KHTMLPart *p = ::qt_cast< KHTMLPart * >(parent);
KParts::BrowserExtension *be = p ? p->browserExtension() : m_ext;
connect(m_khtml->browserExtension(), SIGNAL(openURLRequestDelayed(const KURL &, const KParts::URLArgs &)), be,
SIGNAL(openURLRequestDelayed(const KURL &, const KParts::URLArgs &)));
connect(m_khtml->browserExtension(),
SIGNAL(popupMenu(KXMLGUIClient *, const QPoint &, const KURL &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags, mode_t)),
m_ext,
SIGNAL(popupMenu(KXMLGUIClient *, const QPoint &, const KURL &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags, mode_t)));
connect(m_khtml->browserExtension(), SIGNAL(enableAction(const char *, bool)), m_ext, SIGNAL(enableAction(const char *, bool)));
m_ext->setURLDropHandlingEnabled(true);
}
示例2: setInstance
KHTMLImage::KHTMLImage( QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name )
: KParts::ReadOnlyPart( parent, name )
{
setInstance( KHTMLImageFactory::instance() );
QVBox *box = new QVBox( parentWidget, widgetName );
m_khtml = new KHTMLPart( box, widgetName, this, "htmlimagepart" );
m_khtml->setAutoloadImages( true );
setWidget( box );
// VBox can't take focus, so pass it on to sub-widget
box->setFocusProxy( m_khtml->widget() );
m_ext = new KHTMLImageBrowserExtension( this, "be" );
// Remove unnecessary actions.
KAction *encodingAction = actionCollection()->action( "setEncoding" );
if ( encodingAction )
{
encodingAction->unplugAll();
delete encodingAction;
}
KAction *viewSourceAction= actionCollection()->action( "viewDocumentSource" );
if ( viewSourceAction )
{
viewSourceAction->unplugAll();
delete viewSourceAction;
}
KAction *selectAllAction= actionCollection()->action( "selectAll" );
if ( selectAllAction )
{
selectAllAction->unplugAll();
delete selectAllAction;
}
connect( m_khtml->browserExtension(), SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KURL &, const QString &, mode_t ) ),
m_ext, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KURL &, const QString &, mode_t ) ) );
connect( m_khtml->browserExtension(), SIGNAL( enableAction( const char *, bool ) ),
m_ext, SIGNAL( enableAction( const char *, bool ) ) );
m_ext->setURLDropHandlingEnabled( true );
}