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


C++ KVBox::setAcceptDrops方法代码示例

本文整理汇总了C++中KVBox::setAcceptDrops方法的典型用法代码示例。如果您正苦于以下问题:C++ KVBox::setAcceptDrops方法的具体用法?C++ KVBox::setAcceptDrops怎么用?C++ KVBox::setAcceptDrops使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KVBox的用法示例。


在下文中一共展示了KVBox::setAcceptDrops方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: actionCollection

KHTMLImage::KHTMLImage( QWidget *parentWidget,
                        QObject *parent, KHTMLPart::GUIProfile prof )
    : KParts::ReadOnlyPart( parent ), m_image( 0 )
{
    KHTMLPart* parentPart = qobject_cast<KHTMLPart*>( parent );
    setComponentData( KHTMLImageFactory::componentData(), prof == KHTMLPart::BrowserViewGUI && !parentPart );

    KVBox *box = new KVBox( parentWidget );
    box->setAcceptDrops( true );

    m_khtml = new KHTMLPart( box, this, prof );
    m_khtml->setAutoloadImages( true );

    // We do not want our subpart to be destroyed when its widget is,
    // since that may cause all KHTMLParts to die when we're dealing
    // with
    m_khtml->setAutoDeletePart( false );

    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 );
    m_ext->setObjectName( "be" );

    m_sbExt = new KParts::StatusBarExtension( this );
    m_sbExt->setObjectName( "sbe" );

    // Remove unnecessary actions.
    delete actionCollection()->action( "setEncoding" );
    delete actionCollection()->action( "viewDocumentSource" );
    delete actionCollection()->action( "selectAll" );

    // forward important signals from the khtml part

    // forward opening requests to parent frame (if existing)
    KHTMLPart *p = qobject_cast<KHTMLPart*>(parent);
    KParts::BrowserExtension *be = p ? p->browserExtension() : m_ext;
    connect(m_khtml->browserExtension(), SIGNAL(openUrlRequestDelayed(KUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)),
               be, SIGNAL(openUrlRequestDelayed(KUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)));

    connect(m_khtml->browserExtension(), SIGNAL(popupMenu(QPoint,KUrl,mode_t,KParts::OpenUrlArguments,KParts::BrowserArguments,KParts::BrowserExtension::PopupFlags,KParts::BrowserExtension::ActionGroupMap)),
            this, SLOT(slotPopupMenu(QPoint,KUrl,mode_t,KParts::OpenUrlArguments,KParts::BrowserArguments,KParts::BrowserExtension::PopupFlags,KParts::BrowserExtension::ActionGroupMap)));

    connect( m_khtml->browserExtension(), SIGNAL(enableAction(const char*,bool)),
             m_ext, SIGNAL(enableAction(const char*,bool)) );

    m_ext->setURLDropHandlingEnabled( true );
}
开发者ID:,项目名称:,代码行数:52,代码来源:


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