当前位置: 首页>>代码示例>>C++>>正文


C++ KAction::unplugAll方法代码示例

本文整理汇总了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);
}
开发者ID:,项目名称:,代码行数:58,代码来源:

示例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 );
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:47,代码来源:khtmlimage.cpp


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