diff options
38 files changed, 121 insertions, 143 deletions
@@ -2344,12 +2344,6 @@ for e in gawk nawk awk; do fi done -# find perl -PERL="/usr/bin/perl" -if "$WHICH" perl >/dev/null 2>&1 && ( perl /dev/null ) >/dev/null 2>&1; then - PERL=`$WHICH perl` -fi - ### skip this if the user just needs help... if [ "$OPT_HELP" != "yes" ]; then diff --git a/mkspecs/features/java.prf b/mkspecs/features/java.prf index 7360103757..411a839ad8 100644 --- a/mkspecs/features/java.prf +++ b/mkspecs/features/java.prf @@ -62,8 +62,8 @@ android:!bundled_jar_file { } else { DEX_CMD = $$SDK_ROOT/platform-tools/dx !exists($$DEX_CMD): DEX_CMD = $$SDK_ROOT/build-tools/$$BUILD_TOOLS_REVISION/dx + !exists($$DEX_CMD): error("The path $$DEX_CMD does not exist. Please set the environment variable ANDROID_BUILD_TOOLS_REVISION to the revision of the build tools installed in your Android SDK.") } - !exists($$DEX_CMD): error("The path $$DEX_CMD does not exist. Please set the environment variable ANDROID_BUILD_TOOLS_REVISION to the revision of the build tools installed in your Android SDK.") QMAKE_LINK_SHLIB_CMD = $$DEX_CMD --dex --output $(TARGET) $$CLASS_DIR } else { QMAKE_LINK_SHLIB_CMD = jar cf $(TARGET) -C $$CLASS_DIR . diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index 67446b2efe..44fbf20f81 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -182,6 +182,7 @@ const char _Optimization[] = "Optimization"; const char _OptimizeReferences[] = "OptimizeReferences"; const char _OutputDirectory[] = "OutputDirectory"; const char _OutputFile[] = "OutputFile"; +const char _PlatformToolSet[] = "PlatformToolSet"; const char _PrecompiledHeader[] = "PrecompiledHeader"; const char _PrecompiledHeaderFile[] = "PrecompiledHeaderFile"; const char _PrecompiledHeaderOutputFile[] = "PrecompiledHeaderOutputFile"; @@ -467,10 +468,6 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProjectSingleConfig &tool) << attrTag("Condition", condition) << valueTag(tool.Configuration.IntermediateDirectory); } - if (tool.Configuration.CompilerVersion >= NET2012) { - xml << tagValue("PlatformToolSet", - platformToolSetVersion(tool.Configuration.CompilerVersion)); - } if ( !tool.Configuration.PrimaryOutput.isEmpty() ) { xml<< tag("TargetName") << attrTag("Condition", condition) @@ -668,10 +665,6 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool) << attrTag("Condition", condition) << valueTag(config.IntermediateDirectory); } - if (config.CompilerVersion >= NET2012) { - xml << tagValue("PlatformToolSet", - platformToolSetVersion(config.CompilerVersion)); - } if (!config.PrimaryOutput.isEmpty()) { xml << tag("TargetName") << attrTag("Condition", condition) @@ -1649,6 +1642,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCConfiguration &tool) xml << tag("PropertyGroup") << attrTag("Condition", generateCondition(tool)) << attrTag("Label", "Configuration") + << attrTagS(_PlatformToolSet, platformToolSetVersion(tool.CompilerVersion)) << attrTagS(_OutputDirectory, tool.OutputDirectory) << attrTagT(_ATLMinimizesCRunTimeLibraryUsage, tool.ATLMinimizesCRunTimeLibraryUsage) << attrTagT(_BuildBrowserInformation, tool.BuildBrowserInformation) @@ -2057,7 +2051,6 @@ QString VCXProjectWriter::platformToolSetVersion(const DotNET version) case NET2012: return "v110"; } - Q_ASSERT(!"This MSVC version does not support the PlatformToolSet tag!"); return QString(); } diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h index c9c4d23aab..9b939feea0 100644 --- a/src/corelib/global/qendian.h +++ b/src/corelib/global/qendian.h @@ -78,7 +78,10 @@ template <typename T> inline void qbswap(const T src, uchar *dest) // If you want to avoid the memcopy, you must write specializations for this function template <typename T> inline void qToUnaligned(const T src, uchar *dest) { - memcpy(dest, &src, sizeof(T)); + // Using sizeof(T) inside memcpy function produces internal compiler error with + // MSVC2008/ARM in tst_endian -> use extra indirection to resolve size of T. + const size_t size = sizeof(T); + memcpy(dest, &src, size); } /* T qFromLittleEndian(const uchar *src) diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index ae291f13cd..d1bd8fbe95 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -52,6 +52,8 @@ #include "qelapsedtimer.h" #include "qcoreapplication_p.h" +#include "qsysinfo.h" + #include <private/qthread_p.h> #include <private/qmutexpool_p.h> @@ -305,8 +307,14 @@ static void resolveTimerAPI() #endif triedResolve = true; #if !defined(Q_OS_WINCE) +# if defined(_MSC_VER) && _MSC_VER >= 1700 + if (QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS8) { // QTBUG-27266, Disable when running MSVC2012-built code on pre-Windows 8 +# else + { +# endif qtimeSetEvent = (ptimeSetEvent)QSystemLibrary::resolve(QLatin1String("winmm"), "timeSetEvent"); qtimeKillEvent = (ptimeKillEvent)QSystemLibrary::resolve(QLatin1String("winmm"), "timeKillEvent"); + } #else qtimeSetEvent = (ptimeSetEvent)QSystemLibrary::resolve(QLatin1String("Mmtimer"), "timeSetEvent"); qtimeKillEvent = (ptimeKillEvent)QSystemLibrary::resolve(QLatin1String("Mmtimer"), "timeKillEvent"); diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri index 91374fe2dd..3c019fc5b5 100644 --- a/src/gui/kernel/kernel.pri +++ b/src/gui/kernel/kernel.pri @@ -31,6 +31,8 @@ HEADERS += \ kernel/qplatformclipboard.h \ kernel/qplatformnativeinterface.h \ kernel/qplatformmenu.h \ + kernel/qshapedpixmapdndwindow_p.h \ + kernel/qsimpledrag_p.h \ kernel/qsurfaceformat.h \ kernel/qguiapplication.h \ kernel/qguiapplication_p.h \ @@ -89,6 +91,8 @@ SOURCES += \ kernel/qplatformclipboard.cpp \ kernel/qplatformnativeinterface.cpp \ kernel/qsessionmanager.cpp \ + kernel/qshapedpixmapdndwindow.cpp \ + kernel/qsimpledrag.cpp \ kernel/qsurfaceformat.cpp \ kernel/qguiapplication.cpp \ kernel/qwindow.cpp \ diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index e82e30df80..e4f45ebb6e 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -49,6 +49,7 @@ #include <QtGui/private/qpixmap_raster_p.h> #include <qpa/qplatformscreen_p.h> #include <private/qdnd_p.h> +#include <private/qsimpledrag_p.h> QT_BEGIN_NAMESPACE @@ -99,7 +100,11 @@ QPlatformClipboard *QPlatformIntegration::clipboard() const */ QPlatformDrag *QPlatformIntegration::drag() const { - return 0; + static QSimpleDrag *drag = 0; + if (!drag) { + drag = new QSimpleDrag; + } + return drag; } #endif diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp index d23cfde172..4c0d68e7c1 100644 --- a/src/gui/kernel/qplatformwindow.cpp +++ b/src/gui/kernel/qplatformwindow.cpp @@ -510,15 +510,21 @@ QRect QPlatformWindow::initialGeometry(const QWindow *w, } } if (w->isTopLevel() && qt_window_private(const_cast<QWindow*>(w))->positionAutomatic) { - const QWindow *tp = w->transientParent(); - if (tp) { - // A transient window should be centered w.r.t. its transient parent. - rect.moveCenter(tp->geometry().center()); - } else { - // Center the window on the screen. (Only applicable on platforms - // which do not provide a better way.) - QPlatformScreen *scr = QPlatformScreen::platformScreenForWindow(w); - rect.moveCenter(scr->availableGeometry().center()); + if (const QPlatformScreen *platformScreen = QPlatformScreen::platformScreenForWindow(w)) { + const QRect availableGeometry = platformScreen->availableGeometry(); + // Center unless the geometry ( + unknown window frame) is too large for the screen). + if (rect.height() < (availableGeometry.height() * 8) / 9 + && rect.width() < (availableGeometry.width() * 8) / 9) { + const QWindow *tp = w->transientParent(); + if (tp) { + // A transient window should be centered w.r.t. its transient parent. + rect.moveCenter(tp->geometry().center()); + } else { + // Center the window on the screen. (Only applicable on platforms + // which do not provide a better way.) + rect.moveCenter(availableGeometry.center()); + } + } } } return rect; diff --git a/src/platformsupport/dnd/qshapedpixmapdndwindow.cpp b/src/gui/kernel/qshapedpixmapdndwindow.cpp index b3e64b01d0..b3e64b01d0 100644 --- a/src/platformsupport/dnd/qshapedpixmapdndwindow.cpp +++ b/src/gui/kernel/qshapedpixmapdndwindow.cpp diff --git a/src/platformsupport/dnd/qshapedpixmapdndwindow_p.h b/src/gui/kernel/qshapedpixmapdndwindow_p.h index 20674b6b19..20674b6b19 100644 --- a/src/platformsupport/dnd/qshapedpixmapdndwindow_p.h +++ b/src/gui/kernel/qshapedpixmapdndwindow_p.h diff --git a/src/platformsupport/dnd/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp index f2ff177055..f6912a2d57 100644 --- a/src/platformsupport/dnd/qsimpledrag.cpp +++ b/src/gui/kernel/qsimpledrag.cpp @@ -62,7 +62,7 @@ #include <private/qguiapplication_p.h> #include <private/qdnd_p.h> -#include <QtPlatformSupport/private/qshapedpixmapdndwindow_p.h> +#include <private/qshapedpixmapdndwindow_p.h> QT_BEGIN_NAMESPACE diff --git a/src/platformsupport/dnd/qsimpledrag_p.h b/src/gui/kernel/qsimpledrag_p.h index 10237b36d7..36ea4c1ec5 100644 --- a/src/platformsupport/dnd/qsimpledrag_p.h +++ b/src/gui/kernel/qsimpledrag_p.h @@ -56,7 +56,7 @@ class QEventLoop; class QDropData; class QShapedPixmapWindow; -class QBasicDrag : public QPlatformDrag, public QObject +class Q_GUI_EXPORT QBasicDrag : public QPlatformDrag, public QObject { public: virtual ~QBasicDrag(); @@ -99,7 +99,7 @@ private: QShapedPixmapWindow *m_drag_icon_window; }; -class QSimpleDrag : public QBasicDrag +class Q_GUI_EXPORT QSimpleDrag : public QBasicDrag { public: QSimpleDrag(); diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp index cd3f935c5b..edb5f66c5b 100644 --- a/src/gui/painting/qbackingstore.cpp +++ b/src/gui/painting/qbackingstore.cpp @@ -98,10 +98,12 @@ void QBackingStore::flush(const QRegion ®ion, QWindow *win, const QPoint &off if (!win) win = window(); +#ifdef QBACKINGSTORE_DEBUG if (win && win->isTopLevel() && !qt_window_private(win)->receivedExpose) { qWarning().nospace() << "QBackingStore::flush() called with non-exposed window " << win << ", behavior is undefined"; } +#endif d_ptr->platformBackingStore->flush(win, region, offset); } diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 72c6e035d9..3f496a4ffc 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1579,10 +1579,7 @@ QGLContextPrivate::QGLContextPrivate(QGLContext *context) { group = new QGLContextGroup(context); - if (qApp) { - texture_destroyer = new QGLTextureDestroyer; - texture_destroyer->moveToThread(qApp->thread()); - } + texture_destroyer = new QGLTextureDestroyer; } QGLContextPrivate::~QGLContextPrivate() diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index ff9baf8971..484c3ea2d9 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -335,25 +335,16 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(GLuint) QT_BEGIN_NAMESPACE -class Q_OPENGL_EXPORT QGLTextureDestroyer : public QObject +class Q_OPENGL_EXPORT QGLTextureDestroyer { - Q_OBJECT public: - QGLTextureDestroyer() : QObject() { - connect(this, SIGNAL(freeTexture(QGLContext *, QPlatformPixmap *, quint32)), - this, SLOT(freeTexture_slot(QGLContext *, QPlatformPixmap *, quint32))); - } - void emitFreeTexture(QGLContext *context, QPlatformPixmap *boundPixmap, GLuint id) { - emit freeTexture(context, boundPixmap, id); + void emitFreeTexture(QGLContext *context, QPlatformPixmap *, GLuint id) { + if (context->contextHandle()) + (new QOpenGLSharedResourceGuard(context->contextHandle(), id, freeTextureFunc))->free(); } -Q_SIGNALS: - void freeTexture(QGLContext *context, QPlatformPixmap *boundPixmap, quint32 id); - -private slots: - void freeTexture_slot(QGLContext *context, QPlatformPixmap *boundPixmap, quint32 id) { - Q_UNUSED(boundPixmap); - QGLShareContextScope scope(context); +private: + static void freeTextureFunc(QOpenGLFunctions *, GLuint id) { glDeleteTextures(1, &id); } }; diff --git a/src/platformsupport/dnd/dnd.pri b/src/platformsupport/dnd/dnd.pri deleted file mode 100644 index 47feb81ef2..0000000000 --- a/src/platformsupport/dnd/dnd.pri +++ /dev/null @@ -1,6 +0,0 @@ -HEADERS += \ - $$PWD/qsimpledrag_p.h \ - $$PWD/qshapedpixmapdndwindow_p.h -SOURCES += \ - $$PWD/qsimpledrag.cpp \ - $$PWD/qshapedpixmapdndwindow.cpp diff --git a/src/platformsupport/platformsupport.pro b/src/platformsupport/platformsupport.pro index 4cb1f2c1bf..da87f395fd 100644 --- a/src/platformsupport/platformsupport.pro +++ b/src/platformsupport/platformsupport.pro @@ -9,7 +9,6 @@ PRECOMPILED_HEADER = ../corelib/global/qt_pch.h include(cfsocketnotifier/cfsocketnotifier.pri) include(cglconvenience/cglconvenience.pri) -include(dnd/dnd.pri) include(eglconvenience/eglconvenience.pri) include(eventdispatchers/eventdispatchers.pri) include(fbconvenience/fbconvenience.pri) diff --git a/src/plugins/platforms/cocoa/qcocoadrag.h b/src/plugins/platforms/cocoa/qcocoadrag.h index 6e29fd1a78..80259df600 100644 --- a/src/plugins/platforms/cocoa/qcocoadrag.h +++ b/src/plugins/platforms/cocoa/qcocoadrag.h @@ -45,7 +45,7 @@ #include <Cocoa/Cocoa.h> #include <QtGui> #include <qpa/qplatformdrag.h> -#include <QtPlatformSupport/private/qsimpledrag_p.h> +#include <private/qsimpledrag_p.h> #include <QtGui/private/qdnd_p.h> diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm index 18e17a340d..25ece7349c 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.mm +++ b/src/plugins/platforms/cocoa/qcocoamenu.mm @@ -177,7 +177,7 @@ static inline QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *getMenuLoader() } QKeyEvent accel_ev(QEvent::ShortcutOverride, (keyCode & (~Qt::KeyboardModifierMask)), - Qt::KeyboardModifiers(keyCode & Qt::KeyboardModifierMask)); + Qt::KeyboardModifiers(modifiers & Qt::KeyboardModifierMask)); accel_ev.ignore(); QCoreApplication::sendEvent(object, &accel_ev); if (accel_ev.isAccepted()) { diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm index b112e40549..e280cf4581 100644 --- a/src/plugins/platforms/cocoa/qcocoamenubar.mm +++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm @@ -136,6 +136,17 @@ void QCocoaMenuBar::syncMenu(QPlatformMenu *menu) QCocoaMenu *cocoaMenu = static_cast<QCocoaMenu *>(menu); Q_FOREACH (QCocoaMenuItem *item, cocoaMenu->items()) cocoaMenu->syncMenuItem(item); + + // If the NSMenu has no visble items, or only separators, we should hide it + // on the menubar. This can happen after syncing the menu items since they + // can be moved to other menus. + BOOL shouldHide = YES; + for (NSMenuItem *item in [cocoaMenu->nsMenu() itemArray]) + if (![item isSeparatorItem] && ![item isHidden]) { + shouldHide = NO; + break; + } + [cocoaMenu->nsMenuItem() setHidden:shouldHide]; } void QCocoaMenuBar::handleReparent(QWindow *newParentWindow) diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm index 1255f75eb7..1e2b593a08 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm +++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm @@ -241,7 +241,8 @@ NSMenuItem *QCocoaMenuItem::sync() mergeItem = [loader quitMenuItem]; break; default: - m_textSynced = true; + if (!m_text.isEmpty()) + m_textSynced = true; break; } break; @@ -264,7 +265,7 @@ NSMenuItem *QCocoaMenuItem::sync() m_native = nil; // create item below m_merged = false; } - } else { + } else if (!m_text.isEmpty()) { m_textSynced = true; // NoRole, and that was set explicitly. So, nothing to do anymore. } diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 0dec048a9d..f8d0eafcb3 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -823,6 +823,9 @@ NSWindow * QCocoaWindow::createNSWindow() if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) { // Make popup winows show on the same desktop as the parent full-screen window. [window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary]; + + if ((type & Qt::Popup) == Qt::Popup) + [window setAnimationBehavior:NSWindowAnimationBehaviorUtilityWindow]; } #endif window->m_cocoaPlatformWindow = this; diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index ee6a9616a6..5c5da830ac 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -897,7 +897,6 @@ static QTouchDevice *touchDevice = 0; ulong timestamp = [nsevent timestamp] * 1000; ulong nativeModifiers = [nsevent modifierFlags]; Qt::KeyboardModifiers modifiers = [QNSView convertKeyModifiers: nativeModifiers]; - NSString *charactersIgnoringModifiers = [nsevent charactersIgnoringModifiers]; NSString *characters = [nsevent characters]; // [from Qt 4 impl] There is no way to get the scan code from carbon. But we cannot @@ -909,19 +908,11 @@ static QTouchDevice *touchDevice = 0; EventRef eventRef = EventRef([nsevent eventRef]); GetEventParameter(eventRef, kEventParamKeyCode, typeUInt32, 0, sizeof(nativeVirtualKey), 0, &nativeVirtualKey); - QChar ch; - int keyCode; - if ([charactersIgnoringModifiers length] > 0) { // convert the first character into a key code - if ((modifiers & Qt::ControlModifier) && ([characters length] != 0)) { - ch = QChar([characters characterAtIndex:0]); - } else { - ch = QChar([charactersIgnoringModifiers characterAtIndex:0]); - } + QChar ch = QChar::ReplacementCharacter; + int keyCode = Qt::Key_unknown; + if ([characters length] != 0) { + ch = QChar([characters characterAtIndex:0]); keyCode = [self convertKeyCode:ch]; - } else { - // might be a dead key - ch = QChar::ReplacementCharacter; - keyCode = Qt::Key_unknown; } // we will send a key event unless the input method sets m_sendKeyEvent to false @@ -931,7 +922,7 @@ static QTouchDevice *touchDevice = 0; if (eventType == QEvent::KeyPress) { // ignore text for the U+F700-U+F8FF range. This is used by Cocoa when // delivering function keys (e.g. arrow keys, backspace, F1-F35, etc.) - if ([charactersIgnoringModifiers length] == 1 && (ch.unicode() < 0xf700 || ch.unicode() > 0xf8ff)) + if (ch.unicode() < 0xf700 || ch.unicode() > 0xf8ff) text = QCFString::toQString(characters); if (m_composingText.isEmpty()) diff --git a/src/plugins/platforms/cocoa/qt_mac_p.h b/src/plugins/platforms/cocoa/qt_mac_p.h index 0906431986..808ca9194b 100644 --- a/src/plugins/platforms/cocoa/qt_mac_p.h +++ b/src/plugins/platforms/cocoa/qt_mac_p.h @@ -111,21 +111,6 @@ public: } }; -// Class for chaining to gether a bunch of fades. It pretty much is only used for qmenu fading. -class QMacWindowFader -{ - QWidgetList m_windowsToFade; - float m_duration; - Q_DISABLE_COPY(QMacWindowFader) -public: - QMacWindowFader(); // PLEASE DON'T CALL THIS. - static QMacWindowFader *currentFader(); - void registerWindowToFade(QWidget *window); - void setFadeDuration(float durationInSecs) { m_duration = durationInSecs; } - float fadeDuration() const { return m_duration; } - void performFade(); -}; - class Q_WIDGETS_EXPORT QMacCocoaAutoReleasePool { private: diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp index 072f60dff8..feb05e3093 100644 --- a/src/plugins/platforms/qnx/qqnxintegration.cpp +++ b/src/plugins/platforms/qnx/qqnxintegration.cpp @@ -89,7 +89,7 @@ #include <QtGui/QOpenGLContext> #endif -#include <QtPlatformSupport/private/qsimpledrag_p.h> +#include <private/qsimpledrag_p.h> #include <QtCore/QDebug> #include <QtCore/QHash> diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 73df3ec032..814892b43a 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -552,11 +552,15 @@ QVariant QWindowsIntegration::styleHint(QPlatformIntegration::StyleHint hint) co break; case QPlatformIntegration::UseRtlExtensions: return QVariant(d->m_context.useRTLExtensions()); +#ifdef Q_OS_WINCE case QPlatformIntegration::SynthesizeMouseFromTouchEvents: // We do not want Qt to synthesize mouse events as Windows also does that. // Alternatively, Windows-generated touch mouse events can be identified and // ignored by checking GetMessageExtraInfo() for MI_WP_SIGNATURE (0xFF515700). return false; +#endif // Q_OS_WINCE + default: + break; } return QPlatformIntegration::styleHint(hint); } diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp index fd00a07d6c..5c096b7eca 100644 --- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp +++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp @@ -157,9 +157,19 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd, QtWindows::WindowsEventType et, MSG msg, LRESULT *result) { + enum { signatureMask = 0xffffff00, miWpSignature = 0xff515700 }; + if (et == QtWindows::MouseWheelEvent) return translateMouseWheelEvent(window, hwnd, msg, result); +#ifndef Q_OS_WINCE + // Check for events synthesized from touch. Lower byte is touch index, 0 means pen. + const LPARAM extraInfo = GetMessageExtraInfo(); + const bool fromTouch = (extraInfo & signatureMask) == miWpSignature && (extraInfo & 0xff); + if (fromTouch) + return false; +#endif // !Q_OS_WINCE + const QPoint winEventPosition(GET_X_LPARAM(msg.lParam), GET_Y_LPARAM(msg.lParam)); if (et & QtWindows::NonClientEventFlag) { const QPoint globalPosition = winEventPosition; diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 8ce6dcc9e7..9d817c2043 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -503,15 +503,6 @@ QWindowsWindow::WindowData const QWindowCreationContextPtr context(new QWindowCreationContext(w, rect, data.customMargins, style, exStyle)); QWindowsContext::instance()->setWindowCreationContext(context); - QRect screenGeometry; - if (QScreen *screen = w->screen()) - screenGeometry = screen->availableVirtualGeometry(); - - if (context->frameX < screenGeometry.left()) - context->frameX = screenGeometry.left(); - if (context->frameY < screenGeometry.top()) - context->frameY = screenGeometry.top(); - if (QWindowsContext::verboseWindows) qDebug().nospace() << "CreateWindowEx: " << w << *this diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp index db736cef4e..4961e0377c 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.cpp +++ b/src/plugins/platforms/xcb/qxcbdrag.cpp @@ -57,8 +57,8 @@ #include <qpa/qwindowsysteminterface.h> -#include <QtPlatformSupport/private/qshapedpixmapdndwindow_p.h> -#include <QtPlatformSupport/private/qsimpledrag_p.h> +#include <private/qshapedpixmapdndwindow_p.h> +#include <private/qsimpledrag_p.h> QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/xcb/qxcbdrag.h b/src/plugins/platforms/xcb/qxcbdrag.h index 5678c2d303..5648f70d9e 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.h +++ b/src/plugins/platforms/xcb/qxcbdrag.h @@ -43,7 +43,7 @@ #define QXCBDRAG_H #include <qpa/qplatformdrag.h> -#include <QtPlatformSupport/private/qsimpledrag_p.h> +#include <private/qsimpledrag_p.h> #include <qxcbobject.h> #include <xcb/xcb.h> #include <qlist.h> diff --git a/src/tools/qdoc/codemarker.cpp b/src/tools/qdoc/codemarker.cpp index e39ff203a5..c7d9c5b339 100644 --- a/src/tools/qdoc/codemarker.cpp +++ b/src/tools/qdoc/codemarker.cpp @@ -397,8 +397,11 @@ void CodeMarker::insert(FastSection &fastSection, bool irrelevant = false; bool inheritedMember = false; if (!node->relates()) { - if (node->parent() != fastSection.parent_) { // && !node->parent()->isAbstract()) { - if ((node->parent()->subType() != Node::QmlClass) || !node->parent()->isAbstract()) { + InnerNode* p = node->parent(); + if (p->subType() == Node::QmlPropertyGroup) + p = p->parent(); + if (p != fastSection.parent_) { // && !node->parent()->isAbstract()) { + if (p->subType() != Node::QmlClass || !p->isAbstract()) { //if (node->type() != Node::QmlProperty) { inheritedMember = true; } diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp index eea1845e17..dd87e889bf 100644 --- a/src/tools/qdoc/ditaxmlgenerator.cpp +++ b/src/tools/qdoc/ditaxmlgenerator.cpp @@ -3138,7 +3138,7 @@ void DitaXmlGenerator::generateOverviewList(const Node* relative) // If we encounter a group definition page, we add all // the pages in that group to the list for that group. foreach (Node* member, docNode->members()) { - if (member->type() != Node::Document) + if (member->isInternal() || member->type() != Node::Document) continue; DocNode* page = static_cast<DocNode*>(member); if (page) { @@ -3155,7 +3155,7 @@ void DitaXmlGenerator::generateOverviewList(const Node* relative) // If we encounter a page that belongs to a group then // we add that page to the list for that group. const DocNode* gn = qdb_->getGroup(group); - if (gn) + if (gn && !docNode->isInternal()) docNodeMap[gn].insert(sortKey, docNode); } } diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 2dc4c1e6c6..7e1467f300 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -2644,7 +2644,7 @@ void HtmlGenerator::generateOverviewList(const Node *relative) // If we encounter a group definition page, we add all // the pages in that group to the list for that group. foreach (Node *member, docNode->members()) { - if (member->type() != Node::Document) + if (member->isInternal() || member->type() != Node::Document) continue; DocNode *page = static_cast<DocNode *>(member); if (page) { @@ -2661,7 +2661,7 @@ void HtmlGenerator::generateOverviewList(const Node *relative) // If we encounter a page that belongs to a group then // we add that page to the list for that group. const DocNode* gn = qdb_->getGroup(group); - if (gn) + if (gn && !docNode->isInternal()) docNodeMap[gn].insert(sortKey, docNode); } } diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp index e627cf859e..2184e302ae 100644 --- a/src/tools/qdoc/node.cpp +++ b/src/tools/qdoc/node.cpp @@ -862,9 +862,12 @@ Node* InnerNode::findChildNodeByNameAndType(const QString& name, Type type) if (type == Function) return primaryFunctionMap.value(name); else { - Node *node = childMap.value(name); - if (node && node->type() == type) - return node; + QList<Node*> nodes = childMap.values(name); + for (int i=0; i<nodes.size(); ++i) { + Node* node = nodes.at(i); + if (node->type() == type) + return node; + } } return 0; } diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp index daba2cc78a..5f2ebdfd07 100644 --- a/src/tools/qdoc/qdocindexfiles.cpp +++ b/src/tools/qdoc/qdocindexfiles.cpp @@ -1183,8 +1183,13 @@ void QDocIndexFiles::generateIndexSections(QXmlStreamWriter& writer, It is just a place holder for a collection of QML property nodes. Recurse to its children, which are the QML property nodes. + + Do the same thing for collision nodes - we want children + of collision nodes in the index, but leaving out the + parent collision page will make searching for nodes easier. */ - if (child->subType() == Node::QmlPropertyGroup) { + if (child->subType() == Node::QmlPropertyGroup || + child->subType() == Node::Collision) { const InnerNode* pgn = static_cast<const InnerNode*>(child); foreach (Node* c, pgn->childNodes()) { generateIndexSections(writer, c, generateInternalNodes); diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index b7f39d45dd..a8fba4fb68 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -3366,7 +3366,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter if (const QStyleOptionToolButton *tb = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) { QStyleOptionToolButton myTb = *tb; myTb.state &= ~State_AutoRaise; - if (w && qobject_cast<QToolBar *>(w->parentWidget())) { + if (QStyleHelper::hasAncestor(opt->styleObject, QAccessible::ToolBar)) { QRect cr = tb->rect; int shiftX = 0; int shiftY = 0; @@ -3405,7 +3405,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter if (tb->toolButtonStyle != Qt::ToolButtonIconOnly) { needText = true; if (tb->toolButtonStyle == Qt::ToolButtonTextUnderIcon) { - QMainWindow *mw = qobject_cast<QMainWindow *>(w->window()); + QMainWindow *mw = w ? qobject_cast<QMainWindow *>(w->window()) : 0; if (mw && mw->unifiedTitleAndToolBarOnMac()) { pr.setHeight(pixmap.size().height() / pixmap.devicePixelRatio()); cr.adjust(0, pr.bottom() + 1, 0, 1); diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 33d2e01ed7..7c72c5c456 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -420,25 +420,17 @@ void QMenuPrivate::hideUpToMenuBar() if (QMenu *m = qobject_cast<QMenu*>(caused)) { caused = m->d_func()->causedPopup.widget; if (!m->d_func()->tornoff) - hideMenu(m, fadeMenus); + hideMenu(m); if (!fadeMenus) // Mac doesn't clear the action until after hidden. m->d_func()->setCurrentAction(0); } else { caused = 0; } } -#if defined(Q_WS_MAC) - if (fadeMenus) { - QEventLoop eventLoop; - QTimer::singleShot(int(MenuFadeTimeInSec * 1000), &eventLoop, SLOT(quit())); - QMacWindowFader::currentFader()->performFade(); - eventLoop.exec(); - } -#endif } setCurrentAction(0); } -void QMenuPrivate::hideMenu(QMenu *menu, bool justRegister) +void QMenuPrivate::hideMenu(QMenu *menu) { if (!menu) return; @@ -462,27 +454,10 @@ void QMenuPrivate::hideMenu(QMenu *menu, bool justRegister) eventLoop.exec(); } - // Fade out. - if (menu->style()->styleHint(QStyle::SH_Menu_FadeOutOnHide)) { - // ### Qt 4.4: - // Should be something like: q->transitionWindow(Qt::FadeOutTransition, MenuFadeTimeInSec); - // Hopefully we'll integrate qt/research/windowtransitions into main before 4.4. - // Talk to Richard, Trenton or Bjoern. -#if defined(Q_WS_MAC) - if (justRegister) { - QMacWindowFader::currentFader()->setFadeDuration(MenuFadeTimeInSec); - QMacWindowFader::currentFader()->registerWindowToFade(menu); - } else { - macWindowFade(qt_mac_window_for(menu), MenuFadeTimeInSec); - } - -#endif // Q_WS_MAC - } aboutToHide = false; menu->blockSignals(false); #endif // QT_NO_EFFECTS - if (!justRegister) - menu->close(); + menu->close(); } void QMenuPrivate::popupAction(QAction *action, int delay, bool activateFirst) diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h index 15f3c92127..71a3fca237 100644 --- a/src/widgets/widgets/qmenu_p.h +++ b/src/widgets/widgets/qmenu_p.h @@ -189,7 +189,7 @@ public: virtual QList<QPointer<QWidget> > calcCausedStack() const; QMenuCaused causedPopup; void hideUpToMenuBar(); - void hideMenu(QMenu *menu, bool justRegister = false); + void hideMenu(QMenu *menu); //index mappings inline QAction *actionAt(int i) const { return q_func()->actions().at(i); } |