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


C++ QObject::removeEventFilter方法代码示例

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


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

示例1: removeFromView

void medViewEventFilter::removeFromView(medAbstractView * view)
{
    if ( m_views.contains(view)) {
        QObject * filterObj = medViewEventFilter::objectToFilter(view);
        filterObj->removeEventFilter( this );
        m_views.remove(view);
        disconnect(view, SIGNAL(destroyed(QObject*)), this, SLOT(onViewDestroyed(QObject*)));
    }
开发者ID:Hakim-F,项目名称:medInria-public,代码行数:8,代码来源:medViewEventFilter.cpp

示例2: removeEventHandler

void EventHub::removeEventHandler( const qt::Object& watched )
{
    QObject* obj = watched.get();
    if( isObjectFiltered( obj ) )
    {
        obj->removeEventFilter( this );
        _filteredObjects.erase( obj );
    }
}
开发者ID:coral-framework,项目名称:coral-qt,代码行数:9,代码来源:EventHub.cpp

示例3: setTargetItem

void ItemBackground::setTargetItem(QGraphicsItem *target)
{
    if (d->target && d->target != target) {
        QObject *obj = 0;
        if (d->target->isWidget()) {
            obj = static_cast<QGraphicsWidget*>(d->target);
            obj->removeEventFilter(this);
        } else {
            d->target->removeSceneEventFilter(this);
            obj = dynamic_cast<QObject *>(d->target);
        }

        if (obj) {
            disconnect(obj, 0, this, 0);
        }
    }

    if (!target) {
        hide();
    }

    bool newTarget = (d->target != target);
    d->target = target;
    if (target) {
        setZValue(target->zValue() - 1);
        if (parentItem() != target->parentItem()) {
            QTransform t = transform();
            setTransform(QTransform());
            QRectF geom = mapToScene(geometry()).boundingRect();
            setGeometry(mapFromScene(geom).boundingRect());
            setTransform(t);
        }

        QRectF rect = target->boundingRect();
        rect.moveTopLeft(mapToParent(mapFromScene(target->mapToScene(QPointF(0, 0)))));

        setTarget(rect);


        if (newTarget) {
            QObject *obj = 0;
            if (target->isWidget()) {
                obj = static_cast<QGraphicsWidget*>(target);
                obj->installEventFilter(this);
            } else {
                d->target->installSceneEventFilter(this);
                obj = dynamic_cast<QObject *>(target);
            }

            if (obj) {
                connect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(targetDestroyed(QObject*)));
            }
        }
    }
}
开发者ID:vasi,项目名称:kdelibs,代码行数:55,代码来源:itembackground.cpp

示例4:

void KisInputManager::Private::CanvasSwitcher::removeCanvas(KisCanvas2 *canvas)
{
    QObject *widget = canvas->canvasWidget();

    canvasResolver.remove(widget);

    if (d->eventsReceiver == widget) {
        d->q->setupAsEventFilter(0);
    }

    widget->removeEventFilter(this);
}
开发者ID:Developer626,项目名称:krita,代码行数:12,代码来源:kis_input_manager_p.cpp

示例5: setEnabled

/*!
  \brief En/disable the magnifier

  When enabled is true an event filter is installed for
  the observed widget, otherwise the event filter is removed.

  \param on true or false
  \sa isEnabled(), eventFilter()
*/
void QwtMagnifier::setEnabled( bool on )
{
    if ( d_data->isEnabled != on )
    {
        d_data->isEnabled = on;

        QObject *o = parent();
        if ( o )
        {
            if ( d_data->isEnabled )
                o->installEventFilter( this );
            else
                o->removeEventFilter( this );
        }
    }
}
开发者ID:Azaddien,项目名称:simulator-for-quadcopter,代码行数:25,代码来源:qwt_magnifier.cpp


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