本文整理汇总了C++中QAbstractEventDispatcher::setEventFilter方法的典型用法代码示例。如果您正苦于以下问题:C++ QAbstractEventDispatcher::setEventFilter方法的具体用法?C++ QAbstractEventDispatcher::setEventFilter怎么用?C++ QAbstractEventDispatcher::setEventFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QAbstractEventDispatcher
的用法示例。
在下文中一共展示了QAbstractEventDispatcher::setEventFilter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
QxtGlobalShortcutPrivate::~QxtGlobalShortcutPrivate()
{
#ifndef Q_WS_MAC
--ref;
if (ref == 0) {
QAbstractEventDispatcher *ed = QAbstractEventDispatcher::instance();
if (ed != 0) {
# if QT_VERSION < QT_VERSION_CHECK(5,0,0)
ed->setEventFilter(prevEventFilter);
# else
ed->removeNativeEventFilter(this);
# endif
}
}
#endif // Q_WS_MAC
}
示例2: QObject
WorkspacesInfo::WorkspacesInfo(QObject *parent) :
QObject(parent),
m_count(0),
m_current(0),
m_rows(0),
m_columns(0),
m_orientation(OrientationHorizontal),
m_startingCorner(CornerTopLeft)
{
WorkspacesInfo::internX11Atoms();
/* Setup an low-level event filter so that we can get X11 events directly,
then ask X11 to notify us of property changes on the root window. This
will include notiication on workspace geometry changes.
*/
QAbstractEventDispatcher *dispatcher = QAbstractEventDispatcher::instance();
oldEventFilter = dispatcher->setEventFilter(WorkspacesInfo::globalEventFilter);
XSelectInput(QX11Info::display(), QX11Info::appRootWindow(), PropertyChangeMask);
updateWorkspaceGeometry();
updateCurrentWorkspace();
}