From 78f2ae9c13db383e8aa4f303d0c9ba2c80239c38 Mon Sep 17 00:00:00 2001 From: Eckhart Koppen Date: Mon, 14 Feb 2011 12:00:41 +0200 Subject: Updated QtGui and QtCore DEF files Added new functions needed for QtDeclarative Reviewed-by: TrustMe --- src/s60installs/bwins/QtCoreu.def | 2 ++ src/s60installs/bwins/QtGuiu.def | 4 ++++ src/s60installs/eabi/QtCoreu.def | 2 ++ src/s60installs/eabi/QtGuiu.def | 4 ++++ 4 files changed, 12 insertions(+) diff --git a/src/s60installs/bwins/QtCoreu.def b/src/s60installs/bwins/QtCoreu.def index a2692f7..dd7d588 100644 --- a/src/s60installs/bwins/QtCoreu.def +++ b/src/s60installs/bwins/QtCoreu.def @@ -4603,4 +4603,6 @@ EXPORTS ??XQPoint@@QAEAAV0@N@Z @ 4602 NONAME ; class QPoint & QPoint::operator*=(double) ??XQPoint@@QAEAAV0@H@Z @ 4603 NONAME ; class QPoint & QPoint::operator*=(int) ?hasError@QXmlStreamWriter@@QBE_NXZ @ 4604 NONAME ; bool QXmlStreamWriter::hasError(void) const + ?revision@QMetaProperty@@QBEHXZ @ 4605 NONAME ; int QMetaProperty::revision(void) const + ?revision@QMetaMethod@@QBEHXZ @ 4606 NONAME ; int QMetaMethod::revision(void) const diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index 322d88b..057238c 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -13142,4 +13142,8 @@ EXPORTS ?viewportSize@QScrollPrepareEvent@@QBE?AVQSizeF@@XZ @ 13141 NONAME ; class QSizeF QScrollPrepareEvent::viewportSize(void) const ?staticMetaObject@QScroller@@2UQMetaObject@@B @ 13142 NONAME ; struct QMetaObject const QScroller::staticMetaObject ?staticMetaObject@QFlickGesture@@2UQMetaObject@@B @ 13143 NONAME ; struct QMetaObject const QFlickGesture::staticMetaObject + ?isDragEnabled@QTextControl@@QBE_NXZ @ 13144 NONAME ; bool QTextControl::isDragEnabled(void) const + ?setWordSelectionEnabled@QTextControl@@QAEX_N@Z @ 13145 NONAME ; void QTextControl::setWordSelectionEnabled(bool) + ?setDragEnabled@QTextControl@@QAEX_N@Z @ 13146 NONAME ; void QTextControl::setDragEnabled(bool) + ?isWordSelectionEnabled@QTextControl@@QBE_NXZ @ 13147 NONAME ; bool QTextControl::isWordSelectionEnabled(void) const diff --git a/src/s60installs/eabi/QtCoreu.def b/src/s60installs/eabi/QtCoreu.def index 0488d0c..207447f 100644 --- a/src/s60installs/eabi/QtCoreu.def +++ b/src/s60installs/eabi/QtCoreu.def @@ -3804,4 +3804,6 @@ EXPORTS _ZN23QCoreApplicationPrivate18symbianCommandLineEv @ 3803 NONAME _ZNK16QXmlStreamWriter8hasErrorEv @ 3804 NONAME _ZNK13QElapsedTimer12nsecsElapsedEv @ 3805 NONAME + _ZNK11QMetaMethod8revisionEv @ 3806 NONAME + _ZNK13QMetaProperty8revisionEv @ 3807 NONAME diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def index 8064fa3..e52b504 100644 --- a/src/s60installs/eabi/QtGuiu.def +++ b/src/s60installs/eabi/QtGuiu.def @@ -12333,4 +12333,8 @@ EXPORTS _ZTV19QScrollPrepareEvent @ 12332 NONAME _ZTV19QScrollerProperties @ 12333 NONAME _ZTV9QScroller @ 12334 NONAME + _ZN12QTextControl14setDragEnabledEb @ 12335 NONAME + _ZN12QTextControl23setWordSelectionEnabledEb @ 12336 NONAME + _ZNK12QTextControl13isDragEnabledEv @ 12337 NONAME + _ZNK12QTextControl22isWordSelectionEnabledEv @ 12338 NONAME -- cgit v0.12 From b8dd212347560a8c360e31135ef43669cb4ca3e5 Mon Sep 17 00:00:00 2001 From: mread Date: Tue, 1 Feb 2011 08:52:05 +0000 Subject: Idle detector thread improvements The idle detector thread was creating its own heap, which was rather unnnecesary as it doesn't actually allocate any objects. Now it shares the main thread's heap. It was also unnamed, which makes life harder when there is a crash. The debugger is given information about all threads in a crash. When a thread is unnamed, you can't easily tell if its relevant to the crash or not. Now it is called "IdleDetectorThread". Task-number: QTBUG-17073 Reviewed-by: axis --- src/corelib/kernel/qeventdispatcher_symbian.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index 8872045..d6ab618a 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -657,7 +657,7 @@ public: : m_state(STATE_RUN), m_stop(false) { qt_symbian_throwIfError(m_lock.CreateLocal(0)); - TInt err = m_idleDetectorThread.Create(KNullDesC(), &idleDetectorThreadFunc, 1024, NULL, this); + TInt err = m_idleDetectorThread.Create(KNullDesC(), &idleDetectorThreadFunc, 1024, &User::Allocator(), this); if (err != KErrNone) m_lock.Close(); qt_symbian_throwIfError(err); @@ -692,6 +692,7 @@ public: private: static TInt idleDetectorThreadFunc(TAny* self) { + User::RenameThread(_L("IdleDetectorThread")); static_cast(self)->IdleLoop(); return KErrNone; } -- cgit v0.12 From 1ee9a0865bffd2dc1edc850995ab7ae8da7e1f34 Mon Sep 17 00:00:00 2001 From: mread Date: Thu, 3 Feb 2011 10:29:28 +0000 Subject: Using QElapesedTimer for Symbian idle detector QElapsedTimer is used instead of QTime for event timing in Symbian's idle detector. Task-number: QTBUG-10120 Reviewed-by: Shane Kearns --- src/corelib/kernel/qeventdispatcher_symbian.cpp | 2 +- src/corelib/kernel/qeventdispatcher_symbian_p.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index d6ab618a..53796be 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -810,7 +810,7 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla m_interrupt = false; #ifdef QT_SYMBIAN_PRIORITY_DROP - QTime eventTimer; + QElapsedTimer eventTimer; #endif while (1) { diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h index b785aea..bdb6dce 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian_p.h +++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h @@ -63,6 +63,7 @@ #include #include #include +#include #include @@ -284,7 +285,7 @@ private: int m_delay; int m_avgEventTime; - QTime m_lastIdleRequestTimer; + QElapsedTimer m_lastIdleRequestTimer; }; #ifdef QT_DEBUG -- cgit v0.12 From f8810c52ff754630ee99711fe7a479f8e4967dfa Mon Sep 17 00:00:00 2001 From: mread Date: Thu, 3 Feb 2011 14:51:48 +0000 Subject: Using a better flag to control the fast allocator The Qt fast allocator should be used on any Symbian platform where it is not supplied by euser. But it's better if the code is not there when euser provides the fast allocator as euser's implementation will be better maintained. The previous flag SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS was only associated with euser's fast allocator in S60 10.1. __SYMBIAN_KERNEL_HYBRID_HEAP__ is more accurately associated with it in the new MCL. Task-number: QTBUG-15901 Reviewed-by: Miikka Heikkinen --- src/corelib/arch/symbian/qt_hybridheap_symbian_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h b/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h index 4eff0f3..d1ce705 100644 --- a/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h +++ b/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h @@ -43,8 +43,9 @@ #define QT_HYBRIDHEAP_SYMBIAN_H #include +#include -#if !defined(SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS) && !defined(__WINS__) +#if !defined(__SYMBIAN_KERNEL_HYBRID_HEAP__) && !defined(__WINS__) //Enable the (backported) new allocator. When it is available in OS, //this flag should be disabled for that OS version onward #define QT_USE_NEW_SYMBIAN_ALLOCATOR -- cgit v0.12 From cbd778fd823383ec97c4bd27671367da29770f60 Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Wed, 9 Feb 2011 10:59:07 +0200 Subject: Phonon MMF backend enabled in configuration and deployment --- config.profiles/symbian/bld.inf | 2 +- config.profiles/symbian/qt.iby | 4 ++-- config.profiles/symbian/qt.pkg | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/config.profiles/symbian/bld.inf b/config.profiles/symbian/bld.inf index d2d959b..ddb5157 100644 --- a/config.profiles/symbian/bld.inf +++ b/config.profiles/symbian/bld.inf @@ -78,5 +78,5 @@ translations/qt_zh_tw_symbian.ts /epoc32/include/platform/qt/translations/qt_zh_ PRJ_EXTENSIONS START EXTENSION qt/qtconfig OPTION QT_ROOT .. -OPTION OPTIONS -opensource -confirm-license -openvg -opengl-es-2 -script -no-scripttools -no-webkit -make make -graphicssystem openvg -no-phonon-backend -usedeffiles -dont-process -nomake examples -nomake demos -nomake tools -audio-backend -fpu softvfp+vfpv2 +OPTION OPTIONS -opensource -confirm-license -openvg -opengl-es-2 -script -no-scripttools -no-webkit -make make -graphicssystem openvg -phonon -phonon-backend -usedeffiles -dont-process -nomake examples -nomake demos -nomake tools -audio-backend -fpu softvfp+vfpv2 END \ No newline at end of file diff --git a/config.profiles/symbian/qt.iby b/config.profiles/symbian/qt.iby index 2b3be0a..7431cfa 100644 --- a/config.profiles/symbian/qt.iby +++ b/config.profiles/symbian/qt.iby @@ -43,8 +43,8 @@ file=ABI_DIR\BUILD_DIR\qsvgicon.dll SHARED_LIB_DIR\qsvgicon.dll // This is commented out by default, as normally Helix backend will be used. // If the Helix backend is present, it will override MMF backend, so make sure to remove it from // image creation in addition to uncommenting the following lines if you want to use MMF backend. -//file=ABI_DIR\BUILD_DIR\phonon_mmf.dll SHARED_LIB_DIR\phonon_mmf.dll -//data=\epoc32\data\z\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin +file=ABI_DIR\BUILD_DIR\phonon_mmf.dll SHARED_LIB_DIR\phonon_mmf.dll +data=\epoc32\data\z\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin // QtMultimedia audio backend file=ABI_DIR\BUILD_DIR\qaudio.dll SHARED_LIB_DIR\qaudio.dll diff --git a/config.profiles/symbian/qt.pkg b/config.profiles/symbian/qt.pkg index 7bd1c59..6ef51ce 100644 --- a/config.profiles/symbian/qt.pkg +++ b/config.profiles/symbian/qt.pkg @@ -62,7 +62,12 @@ "/epoc32/data/z/resource/qt/plugins/graphicssystems/qglgraphicssystem.qtplugin" - "!:\resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin" "/epoc32/release/armv5/urel/qsvgicon.dll" - "!:\sys\bin\qsvgicon.dll" "/epoc32/data/z/resource/qt/plugins/iconengines/qsvgicon.qtplugin" - "!:\resource\qt\plugins\iconengines\qsvgicon.qtplugin" -"/epoc32/data/z/resource/qt/plugins/bearer/qsymbianbearer.qtplugin" - "c:\resource\qt\plugins\bearer\qsymbianbearer.qtplugin" +"/epoc32/data/z/resource/qt/plugins/bearer/qsymbianbearer.qtplugin" - "!:\resource\qt\plugins\bearer\qsymbianbearer.qtplugin" + +; Phonon MMF plugin +"/epoc32/release/armv5/urel/phonon_mmf.dll" - "!:\sys\bin\phonon_mmf.dll" +"/epoc32/data/z/resource/qt/plugins/phonon_backend/phonon_mmf.qtplugin" - "!:\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin" + "/epoc32/release/armv5/urel/qts60plugin_5_0.dll" - "!:\sys\bin\qts60plugin_5_0.dll" -- cgit v0.12 From 385423699baaec001417cf672b75c54b43ebb9ce Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 10 Feb 2011 13:34:20 +0100 Subject: fix QMAKE_COPY_DIR for mingw+sh Task-number: QTBUG-17315 --- mkspecs/win32-g++/qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf index 2d9833b..65ae590 100644 --- a/mkspecs/win32-g++/qmake.conf +++ b/mkspecs/win32-g++/qmake.conf @@ -77,7 +77,7 @@ QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain QMAKE_DIR_SEP = / QMAKE_QMAKE ~= s,\\\\,/, QMAKE_COPY = cp - QMAKE_COPY_DIR = xcopy /s /q /y /i + QMAKE_COPY_DIR = cp -r QMAKE_MOVE = mv QMAKE_DEL_FILE = rm QMAKE_MKDIR = mkdir -- cgit v0.12 From 9c1f0a1a80cf67a9e6f6d44eff8a946bc7a22c91 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 10 Feb 2011 14:39:41 +0200 Subject: Fix QFileDialog Symbian native file dialog filename filtering. Now QFileDialog static functions that use Symbian native file dialog should find the same files as non-native QFileDialog for any given filename filter. Task-number: QTBUG-17298 Reviewed-by: Janne Koskinen --- src/gui/dialogs/qfiledialog_symbian.cpp | 52 ++++++++++++--------------------- 1 file changed, 19 insertions(+), 33 deletions(-) diff --git a/src/gui/dialogs/qfiledialog_symbian.cpp b/src/gui/dialogs/qfiledialog_symbian.cpp index b8ea5e5..ed98950 100644 --- a/src/gui/dialogs/qfiledialog_symbian.cpp +++ b/src/gui/dialogs/qfiledialog_symbian.cpp @@ -54,6 +54,9 @@ QT_BEGIN_NAMESPACE +extern QStringList qt_make_filter_list(const QString &filter); // defined in qfiledialog.cpp +extern QStringList qt_clean_filter_list(const QString &filter); // defined in qfiledialog.cpp + enum DialogMode { DialogOpen, DialogSave, DialogFolder }; #if defined(Q_WS_S60) && defined(SYMBIAN_VERSION_SYMBIAN3) class CExtensionFilter : public MAknFileFilter @@ -61,56 +64,39 @@ class CExtensionFilter : public MAknFileFilter public: void setFilter(const QString filter) { - filterList.clear(); - if (filter.left(2) == QLatin1String("*.")) { - //Filter has only extensions - filterList << filter.split(QLatin1String(" ")); - return; - } else { - //Extensions are in parenthesis and there may be several filters - QStringList separatedFilters(filter.split(QLatin1String(";;"))); - for (int i = 0; i < separatedFilters.size(); i++) { - if (separatedFilters.at(i).contains(QLatin1String("(*)"))) { - filterList << QLatin1String("(*)"); - return; - } - } - QRegExp rx(QLatin1String("\\(([^\\)]*)\\)")); - int pos = 0; - while ((pos = rx.indexIn(filter, pos)) != -1) { - filterList << rx.cap(1).split(QLatin1String(" ")); - pos += rx.matchedLength(); - } + QStringList unparsedFiltersList = qt_make_filter_list(filter); + QStringList filterList; + filterRxList.clear(); + + foreach (QString unparsedFilter, unparsedFiltersList) { + filterList << qt_clean_filter_list(unparsedFilter); + } + foreach (QString currentFilter, filterList) { + QRegExp filterRx(currentFilter, Qt::CaseInsensitive, QRegExp::Wildcard); + filterRxList << filterRx; } } TBool Accept(const TDesC &/*aDriveAndPath*/, const TEntry &aEntry) const { - if (aEntry.IsDir()) - return ETrue; - //If no filter for files, all can be accepted - if (filterList.isEmpty()) + if (filterRxList.isEmpty()) return ETrue; - if (filterList == QStringList(QLatin1String("(*)"))) + if (aEntry.IsDir()) return ETrue; - for (int i = 0; i < filterList.size(); ++i) { - QString extension = filterList.at(i); - //remove '*' from the beginning of the extension - if (extension.at(0) == QLatin1Char('*')) - extension = extension.mid(1); - + foreach (QRegExp rx, filterRxList) { QString fileName = qt_TDesC2QString(aEntry.iName); - if (fileName.endsWith(extension)) + if (rx.exactMatch(fileName)) return ETrue; } + return EFalse; } private: - QStringList filterList; + QList filterRxList; }; #endif -- cgit v0.12 From e5152123c7fea830c522916a2bb9c16583d5f666 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 10 Feb 2011 15:01:58 +0100 Subject: My 4.7.2 changes --- dist/changes-4.7.2 | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/dist/changes-4.7.2 b/dist/changes-4.7.2 index 03a5408..17a066f 100644 --- a/dist/changes-4.7.2 +++ b/dist/changes-4.7.2 @@ -39,8 +39,8 @@ Optimizations QtCore ------ - - foo - * bar + - QStateMachine + * [QTBUG-14491] Fix compilation on AIX 5.3 with gcc. QtGui ----- @@ -73,8 +73,23 @@ QtOpenGL QtScript -------- - - foo - * bar + - QScriptContext + * [QTBUG-17137] Fix crash when generating backtrace involving a + built-in (ECMA) function. + - QScriptEngine + * [QTBUG-16987] Ensure QScriptProgram objects are invalidated + when engine is destroyed. + * [QTBUG-16828] Fix alignment issue causing crashes on platforms + with only 4-byte-aligned malloc'ed memory (e.g. Symbian debug + builds). + * [QTBUG-15144] Fix GC-related crash in QScriptValue::setData(). + * [QTBUG-15079] Fix crash when QScriptClass property getter + returns an invalid value. + * [QTBUG-13440] Fix bug that caused Math.random() not to + produce random values. + - QScriptValue + * [QTBUG-14801] Fix crash in QScriptValue::construct() when + the function throws a non-Object value. QtSql ----- @@ -171,6 +186,11 @@ Qt for Symbian - QLineEdit * [QTBUG-16238] Fix one character displacement for cursor in line edits. + - QtScript + * [QTBUG-16685] Fix crash in JavaScript stack allocator. + * [QTBUG-15847] Add compiler optimizations. + * [QTBUG-14293] Enhanced JavaScript heap allocator. + - qmake & mkspecs * [QT-4193] Only add ICON for application projects in symbianpkgrules.pri * [QTBUG-13159] Allow pkg_prerules and pkg_postrules to be targeted to separate files. -- cgit v0.12 From 6415f2814ae30d162e335d1ffd6d093b12701f03 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 14 Feb 2011 09:32:26 +0100 Subject: Cocoa/Alien: bugfix corner cases with popups and enter/leave It turns out that we sometimes hit a strange bug with enter/leave events when a popup is showing. If you righpress to show the popup, and then move the mouse outside the window, we get a continues series of leave events. This patch separates more the native vs alien logic for dispatching enter/leave to accommondate this problem --- src/gui/kernel/qcocoaapplicationdelegate_mac.mm | 4 +++ src/gui/kernel/qcocoaview_mac.mm | 2 ++ src/gui/kernel/qt_cocoa_helpers_mac.mm | 33 ++++++++++++------------- src/gui/kernel/qwidget_mac.mm | 7 +++++- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm index 6d7bc19..77cd890 100644 --- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm +++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm @@ -91,6 +91,7 @@ QT_BEGIN_NAMESPACE extern void onApplicationChangedActivation(bool); // qapplication_mac.mm extern void qt_release_apple_event_handler(); //qapplication_mac.mm extern QPointer qt_last_mouse_receiver; // qapplication_mac.cpp +extern QPointer qt_last_native_mouse_receiver; // qt_cocoa_helpers_mac.mm extern QPointer qt_button_down; // qapplication_mac.cpp QT_END_NAMESPACE @@ -268,6 +269,8 @@ static void cleanupCocoaApplicationDelegate() qt_mac_getTargetForMouseEvent(0, QEvent::Enter, qlocal, qglobal, 0, &widgetUnderMouse); QApplicationPrivate::dispatchEnterLeave(widgetUnderMouse, 0); qt_last_mouse_receiver = widgetUnderMouse; + qt_last_native_mouse_receiver = widgetUnderMouse ? + (widgetUnderMouse->internalWinId() ? widgetUnderMouse : widgetUnderMouse->nativeParentWidget()) : 0; } } @@ -282,6 +285,7 @@ static void cleanupCocoaApplicationDelegate() if (!QWidget::mouseGrabber()) QApplicationPrivate::dispatchEnterLeave(0, qt_last_mouse_receiver); qt_last_mouse_receiver = 0; + qt_last_native_mouse_receiver = 0; qt_button_down = 0; } diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index f0ae886..3d87a9e 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -78,6 +78,7 @@ QT_BEGIN_NAMESPACE extern void qt_mac_update_cursor(); // qcursor_mac.mm extern bool qt_sendSpontaneousEvent(QObject *, QEvent *); // qapplication.cpp extern QPointer qt_last_mouse_receiver; // qapplication_mac.cpp +extern QPointer qt_last_native_mouse_receiver; // qt_cocoa_helpers_mac.mm extern OSViewRef qt_mac_nativeview_for(const QWidget *w); // qwidget_mac.mm extern OSViewRef qt_mac_effectiveview_for(const QWidget *w); // qwidget_mac.mm extern QPointer qt_button_down; //qapplication_mac.cpp @@ -461,6 +462,7 @@ static int qCocoaViewCount = 0; if (widgetUnderMouse == 0) { QApplicationPrivate::dispatchEnterLeave(0, qt_last_mouse_receiver); qt_last_mouse_receiver = 0; + qt_last_native_mouse_receiver = 0; } } } diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index e50bdd3..c8132e8 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -1064,7 +1064,7 @@ QWidget *qt_mac_getTargetForMouseEvent( // Resolve the widget under the mouse: QWidget *widgetUnderMouse = 0; - if (popup || qt_button_down || !nativeWidget) { + if (popup || qt_button_down || !nativeWidget || !nativeWidget->isVisible()) { // Using QApplication::widgetAt for finding the widget under the mouse // is most safe, since it ignores cocoas own mouse down redirections (which // we need to be prepared for when using nativeWidget as starting point). @@ -1139,6 +1139,8 @@ QWidget *qt_mac_getTargetForMouseEvent( return target; } +QPointer qt_last_native_mouse_receiver = 0; + static inline void qt_mac_checkEnterLeaveForNativeWidgets(QWidget *maybeEnterWidget) { // Dispatch enter/leave for the cases where QApplicationPrivate::sendMouseEvent do @@ -1149,29 +1151,25 @@ static inline void qt_mac_checkEnterLeaveForNativeWidgets(QWidget *maybeEnterWid if (qt_button_down || QWidget::mouseGrabber()) return; - if ((maybeEnterWidget == qt_last_mouse_receiver) && qt_last_mouse_receiver) - return; + if ((maybeEnterWidget == qt_last_native_mouse_receiver) && qt_last_native_mouse_receiver) + return; if (maybeEnterWidget) { - if (!qt_last_mouse_receiver) { + if (!qt_last_native_mouse_receiver) { // case 3 QApplicationPrivate::dispatchEnterLeave(maybeEnterWidget, 0); - qt_last_mouse_receiver = maybeEnterWidget; - } else if (qt_last_mouse_receiver->internalWinId() && maybeEnterWidget->internalWinId()) { + qt_last_native_mouse_receiver = maybeEnterWidget->internalWinId() ? maybeEnterWidget : maybeEnterWidget->nativeParentWidget(); + } else if (maybeEnterWidget->internalWinId()) { // case 1 - if (qt_last_mouse_receiver->isVisible()) { - QApplicationPrivate::dispatchEnterLeave(maybeEnterWidget, qt_last_mouse_receiver); - qt_last_mouse_receiver = maybeEnterWidget; - } + QApplicationPrivate::dispatchEnterLeave(maybeEnterWidget, qt_last_native_mouse_receiver); + qt_last_native_mouse_receiver = maybeEnterWidget->internalWinId() ? maybeEnterWidget : maybeEnterWidget->nativeParentWidget(); } // else at lest one of the widgets are alien, so enter/leave will be handled in QApplicationPrivate } else { - if (qt_last_mouse_receiver && qt_last_mouse_receiver->internalWinId()) { + if (qt_last_native_mouse_receiver) { // case 2 - QApplicationPrivate::dispatchEnterLeave(0, qt_last_mouse_receiver); - // This seems to be the only case where we need to update qt_last_mouse_receiver - // from the mac specific code. Otherwise, QApplicationPrivate::sendMouseEvent - // will handle it: + QApplicationPrivate::dispatchEnterLeave(0, qt_last_native_mouse_receiver); qt_last_mouse_receiver = 0; + qt_last_native_mouse_receiver = 0; } } } @@ -1276,8 +1274,9 @@ bool qt_mac_handleMouseEvent(NSEvent *event, QEvent::Type eventType, Qt::MouseBu if (eventType == QEvent::MouseButtonRelease) { // A mouse button was released, which means that the implicit grab was // released. We therefore need to re-check if should send (delayed) enter leave events: - // qt_button_down has now become NULL since the call at the top of the function. - widgetToGetMouse = qt_mac_getTargetForMouseEvent(0, QEvent::None, localPoint, globalPoint, nativeWidget, &widgetUnderMouse); + // qt_button_down has now become NULL since the call at the top of the function. Also, since + // the relase might have closed a window, we dont give the nativeWidget hint + qt_mac_getTargetForMouseEvent(0, QEvent::None, localPoint, globalPoint, nativeWidget, &widgetUnderMouse); qt_mac_checkEnterLeaveForNativeWidgets(widgetUnderMouse); } diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 3ba12cd..9a5a5f1 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -186,6 +186,7 @@ extern void qt_mac_event_release(QWidget *w); //qapplication_mac.mm extern void qt_event_request_showsheet(QWidget *); //qapplication_mac.mm extern void qt_event_request_window_change(QWidget *); //qapplication_mac.mm extern QPointer qt_last_mouse_receiver; //qapplication_mac.mm +extern QPointer qt_last_native_mouse_receiver; //qt_cocoa_helpers_mac.mm extern IconRef qt_mac_create_iconref(const QPixmap &); //qpixmap_mac.cpp extern void qt_mac_set_cursor(const QCursor *, const QPoint &); //qcursor_mac.mm extern void qt_mac_update_cursor(); //qcursor_mac.mm @@ -3524,6 +3525,8 @@ void QWidgetPrivate::show_sys() qt_mac_getTargetForMouseEvent(0, QEvent::Enter, qlocal, qglobal, 0, &widgetUnderMouse); QApplicationPrivate::dispatchEnterLeave(widgetUnderMouse, qt_last_mouse_receiver); qt_last_mouse_receiver = widgetUnderMouse; + qt_last_native_mouse_receiver = widgetUnderMouse ? + (widgetUnderMouse->internalWinId() ? widgetUnderMouse : widgetUnderMouse->nativeParentWidget()) : 0; } #endif @@ -3676,8 +3679,10 @@ void QWidgetPrivate::hide_sys() QPoint qlocal, qglobal; QWidget *widgetUnderMouse = 0; qt_mac_getTargetForMouseEvent(0, QEvent::Leave, qlocal, qglobal, 0, &widgetUnderMouse); - QApplicationPrivate::dispatchEnterLeave(widgetUnderMouse, qt_last_mouse_receiver); + QApplicationPrivate::dispatchEnterLeave(widgetUnderMouse, qt_last_native_mouse_receiver); qt_last_mouse_receiver = widgetUnderMouse; + qt_last_native_mouse_receiver = widgetUnderMouse ? + (widgetUnderMouse->internalWinId() ? widgetUnderMouse : widgetUnderMouse->nativeParentWidget()) : 0; } #endif -- cgit v0.12 From 53e589563f4adc51983703e6119c762bd81f584b Mon Sep 17 00:00:00 2001 From: Eckhart Koppen Date: Tue, 15 Feb 2011 08:00:50 +0200 Subject: Removed timestamp setting and checking for Symbian header export For Symbian, headers get always exported, and timestamps are not needed. Reviewed-by: TrustMe --- config.profiles/symbian/headerexport | 62 ++++++++++-------------------------- 1 file changed, 16 insertions(+), 46 deletions(-) diff --git a/config.profiles/symbian/headerexport b/config.profiles/symbian/headerexport index e9e6f3b..d9f99e5 100644 --- a/config.profiles/symbian/headerexport +++ b/config.profiles/symbian/headerexport @@ -3,7 +3,7 @@ # # Synchronizes Qt header files - internal development tool. # -# Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +# Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). # Contact: Nokia Corporation (qt-info@nokia.com) # ###################################################################### @@ -315,17 +315,16 @@ sub classNames { } ###################################################################### -# Syntax: syncHeader(header, iheader, copy, timestamp) +# Syntax: syncHeader(header, iheader, copy) # Params: header, string, filename to create "symlink" for # iheader, string, destination name of symlink # copy, forces header to be a copy of iheader -# timestamp, the requested modification time if copying # # Purpose: Syncronizes header to iheader # Returns: 1 if successful, else 0. ###################################################################### sub syncHeader { - my ($header, $iheader, $copy, $ts) = @_; + my ($header, $iheader, $copy) = @_; $iheader =~ s=\\=/=g; $header =~ s=\\=/=g; return copyFile($iheader, $header) if($copy); @@ -339,7 +338,6 @@ sub syncHeader { open HEADER, ">$header" || die "Could not open $header for writing!\n"; print HEADER "#include \"$iheader_out\"\n"; close HEADER; - utime(time, $ts, $header) or die "$iheader, $header"; return 1; } return 0; @@ -453,48 +451,21 @@ sub fileCompare { sub copyFile { my ($file,$ifile, $copy,$knowdiff,$filecontents,$ifilecontents) = @_; - # Bi-directional synchronization + open( I, "< " . $file ) || die "Could not open $file for reading"; local $/; binmode I; $filecontents = ; close I; - if ( open(I, "< " . $ifile) ) { - local $/; - binmode I; - $ifilecontents = ; - close I; - $copy = fileCompare($file, $ifile); - $knowdiff = 0, - } else { - $copy = -1; - $knowdiff = 1; - } - if ( $knowdiff || ($filecontents ne $ifilecontents) ) { - if ( $copy > 0 && !$oneway) { - my $file_dir = dirname($file); - mkpath $file_dir, !$quiet unless(-e $file_dir); - open(O, "> " . $file) || die "Could not open $file for writing (no write permission?)"; - local $/; - binmode O; - print O $ifilecontents; - close O; - utime time, (stat($ifile))[9], $file; - return 1; - } elsif ( $copy < 0 ) { - my $ifile_dir = dirname($ifile); - mkpath $ifile_dir, !$quiet unless(-e $ifile_dir); - open(O, "> " . $ifile) || die "Could not open $ifile for writing (no write permission?)"; - local $/; - binmode O; - print O $filecontents; - close O; - utime time, (stat($file))[9], $ifile; - return 1; - } - } - return 0; + my $ifile_dir = dirname($ifile); + mkpath $ifile_dir, !$quiet unless(-e $ifile_dir); + open(O, "> " . $ifile) || die "Could not open $ifile for writing (no write permission?)"; + local $/; + binmode O; + print O $filecontents; + close O; + return 1; } ###################################################################### @@ -848,7 +819,6 @@ foreach my $lib (@modules_to_sync) { print "SYMBOL: $_\n"; } } else { - my $ts = (stat($iheader))[9]; #find out all the places it goes.. my @headers; if ($public_header) { @@ -887,18 +857,18 @@ foreach my $lib (@modules_to_sync) { # class =~ s,::,/,g; # } $class_lib_map_contents .= "QT_CLASS_LIB($full_class, $lib, $header_base)\n"; - $header_copies++ if(syncHeader("$out_basedir/$out_subdir/$lib/$class", "$out_basedir/$out_subdir/$lib/$header", 0, $ts)); + $header_copies++ if(syncHeader("$out_basedir/$out_subdir/$lib/$class", "$out_basedir/$out_subdir/$lib/$header", 0)); # KDE-Compat headers for Phonon if ($lib eq "phonon") { - $header_copies++ if (syncHeader("$out_basedir/$out_subdir/phonon_compat/Phonon/$class", "$out_basedir/$out_subdir/$lib/$header", 0, $ts)); + $header_copies++ if (syncHeader("$out_basedir/$out_subdir/phonon_compat/Phonon/$class", "$out_basedir/$out_subdir/$lib/$header", 0)); } } } elsif ($create_private_headers) { @headers = ( "$out_basedir/$out_subdir/$lib/private/$header" ); } foreach(@headers) { #sync them - $header_copies++ if(syncHeader($_, $iheader, $copy_headers, $ts)); + $header_copies++ if(syncHeader($_, $iheader, $copy_headers)); } if($public_header) { @@ -1132,7 +1102,7 @@ if($check_includes) { } } } - } } +} exit 0; -- cgit v0.12