本文整理汇总了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*)));
}
示例2: removeEventHandler
void EventHub::removeEventHandler( const qt::Object& watched )
{
QObject* obj = watched.get();
if( isObjectFiltered( obj ) )
{
obj->removeEventFilter( this );
_filteredObjects.erase( obj );
}
}
示例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*)));
}
}
}
}
示例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);
}
示例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 );
}
}
}