diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-10 18:58:48 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-10 18:58:48 (GMT) |
commit | 0551521be2df929089f892dacce5bd64bc99096d (patch) | |
tree | 80ce18b7a620df94c2271beedb974271561bfba7 /src/gui/kernel | |
parent | 3dc18b19ee2a02b93cc509a9162bf0a3900c6fd0 (diff) | |
parent | e26cba5c15ae02ae0fba9b73ed90c9b1f7b5286b (diff) | |
download | Qt-0551521be2df929089f892dacce5bd64bc99096d.zip Qt-0551521be2df929089f892dacce5bd64bc99096d.tar.gz Qt-0551521be2df929089f892dacce5bd64bc99096d.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
Bearer management: Fix compilation with namespace.
fetch next token after class definition opening
delay next token fetching when opening namespace
don't let operator overloads confuse us
don't try to show source when no locations are given
Implement a private API for setting title widgets
Fix the bug for QSettings on Windows, to store qint32/quint32, qint64/quint64 in Windows registry.
fix CRLF
Added private API to install an x11EventFilter
NTLM code: Save domain in different variable
Update the error handling of invalid hostnames in QUrl.
Remove unsupported code from qobject.h for MSVC < .NET 2003
Properly implement qobject_cast for const pointers.
Revert "Doc: fixing page name bug caused by 07bbace404078dcfd82eff717daa97299b8ba52c changing qml elements page"
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication_x11.cpp | 28 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 9 |
2 files changed, 33 insertions, 4 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 7495f6d..e7b7ed8 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -400,11 +400,39 @@ QTabletDeviceDataList *qt_tablet_devices() extern bool qt_tabletChokeMouse; #endif +typedef bool(*QX11FilterFunction)(XEvent *event); + +Q_GLOBAL_STATIC(QList<QX11FilterFunction>, x11Filters) + +Q_GUI_EXPORT void qt_installX11EventFilter(QX11FilterFunction func) +{ + Q_ASSERT(func); + + if (QList<QX11FilterFunction> *list = x11Filters()) + list->append(func); +} + +Q_GUI_EXPORT void qt_removeX11EventFilter(QX11FilterFunction func) +{ + Q_ASSERT(func); + + if (QList<QX11FilterFunction> *list = x11Filters()) + list->removeOne(func); +} + + static bool qt_x11EventFilter(XEvent* ev) { long unused; if (qApp->filterEvent(ev, &unused)) return true; + if (const QList<QX11FilterFunction> *list = x11Filters()) { + for (QList<QX11FilterFunction>::const_iterator it = list->constBegin(); it != list->constEnd(); ++it) { + if ((*it)(ev)) + return true; + } + } + return qApp->x11EventFilter(ev); } diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 1979c84..159c45d 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2375,7 +2375,8 @@ void QWidgetPrivate::recreateMacWindow() HIViewRemoveFromSuperview(myView); determineWindowClass(); createWindow_sys(); - if (QMainWindowLayout *mwl = qobject_cast<QMainWindowLayout *>(q->layout())) { + + if (QMainWindowLayout *mwl = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q))) { mwl->updateHIToolBarStatus(); } @@ -2912,7 +2913,7 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) // We do this down below for wasCreated, so avoid doing this twice // (only for performance, it gets called a lot anyway). if (!wasCreated) { - if (QMainWindowLayout *mwl = qobject_cast<QMainWindowLayout *>(q->layout())) { + if (QMainWindowLayout *mwl = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q))) { mwl->updateHIToolBarStatus(); } } @@ -2937,7 +2938,7 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) // If we were a unified window, We just transfered our toolbars out of the unified toolbar. // So redo the status one more time. It apparently is not an issue with Cocoa. if (q->isWindow()) { - if (QMainWindowLayout *mwl = qobject_cast<QMainWindowLayout *>(q->layout())) { + if (QMainWindowLayout *mwl = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q))) { mwl->updateHIToolBarStatus(); } } @@ -5138,7 +5139,7 @@ void QWidgetPrivate::macUpdateMetalAttribute() return; recreateMacWindow(); #else - QMainWindowLayout *layout = qobject_cast<QMainWindowLayout *>(q->layout()); + QMainWindowLayout *layout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q)); if (q->testAttribute(Qt::WA_MacBrushedMetal)) { if (layout) layout->updateHIToolBarStatus(); |