diff options
26 files changed, 415 insertions, 25 deletions
diff --git a/mkspecs/common/clang.conf b/mkspecs/common/clang.conf new file mode 100644 index 0000000..f8ab0fe --- /dev/null +++ b/mkspecs/common/clang.conf @@ -0,0 +1,14 @@ +# +# Qmake configuration for Clang on Linux and Mac +# + +QMAKE_CC = clang +QMAKE_CXX = clang++ + +CONFIG += clang_pch_style +QMAKE_PCH_OUTPUT_EXT = .pch + +QMAKE_CFLAGS_PRECOMPILE = -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} +QMAKE_CFLAGS_USE_PRECOMPILE = -Xclang -include-pch -Xclang ${QMAKE_PCH_OUTPUT} +QMAKE_CXXFLAGS_PRECOMPILE = -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} +QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE diff --git a/mkspecs/features/mac/objective_c.prf b/mkspecs/features/mac/objective_c.prf index 0df7013..ca693ba 100644 --- a/mkspecs/features/mac/objective_c.prf +++ b/mkspecs/features/mac/objective_c.prf @@ -1,13 +1,22 @@ +for(source, SOURCES) { + contains(source,.*\\.mm?$) { + warning(Objective-C source \'$$source\' found in SOURCES but should be in OBJECTIVE_SOURCES) + SOURCES -= $$source + OBJECTIVE_SOURCES += $$source + } +} + isEmpty(QMAKE_OBJECTIVE_CC):QMAKE_OBJECTIVE_CC = $$QMAKE_CC - QMAKE_OBJECTIVE_CFLAGS = $$QMAKE_CFLAGS - QMAKE_OBJECTIVE_CFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON - QMAKE_OBJECTIVE_CFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF - QMAKE_OBJECTIVE_CFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG - QMAKE_OBJECTIVE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE - QMAKE_OBJECTIVE_CFLAGS_X86 = $$QMAKE_CFLAGS_X86 - QMAKE_OBJECTIVE_CFLAGS_PPC = $$QMAKE_CFLAGS_PPC - QMAKE_OBJECTIVE_CFLAGS_HIDESYMS = $$QMAKE_CXXFLAGS_HIDESYMS + +QMAKE_OBJECTIVE_CFLAGS = $$QMAKE_CFLAGS +QMAKE_OBJECTIVE_CFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON +QMAKE_OBJECTIVE_CFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF +QMAKE_OBJECTIVE_CFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG +QMAKE_OBJECTIVE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE +QMAKE_OBJECTIVE_CFLAGS_X86 = $$QMAKE_CFLAGS_X86 +QMAKE_OBJECTIVE_CFLAGS_PPC = $$QMAKE_CFLAGS_PPC +QMAKE_OBJECTIVE_CFLAGS_HIDESYMS = $$QMAKE_CXXFLAGS_HIDESYMS OBJECTIVE_C_OBJECTS_DIR = $$OBJECTS_DIR isEmpty(OBJECTIVE_C_OBJECTS_DIR):OBJECTIVE_C_OBJECTS_DIR = . diff --git a/mkspecs/unsupported/linux-clang/qmake.conf b/mkspecs/unsupported/linux-clang/qmake.conf new file mode 100644 index 0000000..65eba7b --- /dev/null +++ b/mkspecs/unsupported/linux-clang/qmake.conf @@ -0,0 +1,19 @@ +# +# qmake configuration for linux-clang +# + +MAKEFILE_GENERATOR = UNIX +TARGET_PLATFORM = unix +TEMPLATE = app +CONFIG += qt warn_on release incremental link_prl +QT += core gui + +QMAKE_INCREMENTAL_STYLE = sublib + +include(../../common/linux.conf) +include(../../common/clang.conf) +include(../../common/gcc-base-unix.conf) + +QMAKE_LFLAGS += -ccc-gcc-name g++ + +load(qt_config) diff --git a/mkspecs/unsupported/linux-clang/qplatformdefs.h b/mkspecs/unsupported/linux-clang/qplatformdefs.h new file mode 100644 index 0000000..2dd7b80 --- /dev/null +++ b/mkspecs/unsupported/linux-clang/qplatformdefs.h @@ -0,0 +1,102 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMDEFS_H +#define QPLATFORMDEFS_H + +// Get Qt defines/settings + +#include "qglobal.h" + +// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs + +// 1) need to reset default environment if _BSD_SOURCE is defined +// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 +// 3) it seems older glibc need this to include the X/Open stuff +#ifndef _GNU_SOURCE +# define _GNU_SOURCE +#endif + +#include <unistd.h> + + +// We are hot - unistd.h should have turned on the specific APIs we requested + +#include <features.h> +#include <pthread.h> +#include <dirent.h> +#include <fcntl.h> +#include <grp.h> +#include <pwd.h> +#include <signal.h> +#include <dlfcn.h> + +#include <sys/types.h> +#include <sys/ioctl.h> +#include <sys/ipc.h> +#include <sys/time.h> +#include <sys/shm.h> +#include <sys/socket.h> +#include <sys/stat.h> +#include <sys/wait.h> +#include <netinet/in.h> +#ifndef QT_NO_IPV6IFNAME +#include <net/if.h> +#endif + +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../../common/posix/qplatformdefs.h" + +#undef QT_SOCKLEN_T + +#if defined(__GLIBC__) && (__GLIBC__ >= 2) +#define QT_SOCKLEN_T socklen_t +#else +#define QT_SOCKLEN_T int +#endif + +#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) +#define QT_SNPRINTF ::snprintf +#define QT_VSNPRINTF ::vsnprintf +#endif + + +#endif // QPLATFORMDEFS_H diff --git a/mkspecs/unsupported/macx-clang/Info.plist.app b/mkspecs/unsupported/macx-clang/Info.plist.app new file mode 100644 index 0000000..393b615 --- /dev/null +++ b/mkspecs/unsupported/macx-clang/Info.plist.app @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd"> +<plist version="0.9"> +<dict> + <key>CFBundleIconFile</key> + <string>@ICON@</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleGetInfoString</key> + <string>Created by Qt/QMake</string> + <key>CFBundleSignature</key> + <string>@TYPEINFO@</string> + <key>CFBundleExecutable</key> + <string>@EXECUTABLE@</string> + <key>CFBundleIdentifier</key> + <string>com.yourcompany.@EXECUTABLE@</string> + <key>NOTE</key> + <string>This file was generated by Qt/QMake.</string> +</dict> +</plist> diff --git a/mkspecs/unsupported/macx-clang/Info.plist.lib b/mkspecs/unsupported/macx-clang/Info.plist.lib new file mode 100644 index 0000000..97609ed --- /dev/null +++ b/mkspecs/unsupported/macx-clang/Info.plist.lib @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd"> +<plist version="0.9"> +<dict> + <key>CFBundlePackageType</key> + <string>FMWK</string> + <key>CFBundleShortVersionString</key> + <string>@SHORT_VERSION@</string> + <key>CFBundleGetInfoString</key> + <string>Created by Qt/QMake</string> + <key>CFBundleSignature</key> + <string>@TYPEINFO@</string> + <key>CFBundleExecutable</key> + <string>@LIBRARY@</string> + <key>NOTE</key> + <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string> +</dict> +</plist> diff --git a/mkspecs/unsupported/macx-clang/qmake.conf b/mkspecs/unsupported/macx-clang/qmake.conf new file mode 100644 index 0000000..17892e8 --- /dev/null +++ b/mkspecs/unsupported/macx-clang/qmake.conf @@ -0,0 +1,21 @@ +# +# qmake configuration for Clang on OS X +# + +MAKEFILE_GENERATOR = UNIX +TARGET_PLATFORM = macx +TEMPLATE = app +CONFIG += qt warn_on release app_bundle incremental global_init_link_order lib_version_first plugin_no_soname link_prl +QT += core gui +QMAKE_INCREMENTAL_STYLE = sublib + +include(../../common/mac.conf) +include(../../common/clang.conf) +include(../../common/gcc-base-mac.conf) + +QMAKE_OBJCFLAGS_PRECOMPILE = -x objective-c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} +QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE +QMAKE_OBJCXXFLAGS_PRECOMPILE = -x objective-c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} +QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE + +load(qt_config) diff --git a/mkspecs/unsupported/macx-clang/qplatformdefs.h b/mkspecs/unsupported/macx-clang/qplatformdefs.h new file mode 100644 index 0000000..72f3ac7 --- /dev/null +++ b/mkspecs/unsupported/macx-clang/qplatformdefs.h @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMDEFS_H +#define QPLATFORMDEFS_H + +// Get Qt defines/settings + +#include "qglobal.h" + +// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs + +#include <unistd.h> + + +// We are hot - unistd.h should have turned on the specific APIs we requested + + +#include <pthread.h> +#include <dirent.h> +#include <fcntl.h> +#include <grp.h> +#include <pwd.h> +#include <signal.h> +#define QT_NO_LIBRARY_UNLOAD + +#include <sys/types.h> +#include <sys/ioctl.h> +#include <sys/ipc.h> +#include <sys/time.h> +#include <sys/shm.h> +#include <sys/socket.h> +#include <sys/stat.h> +#include <sys/wait.h> +#include <netinet/in.h> +#ifndef QT_NO_IPV6IFNAME +#include <net/if.h> +#endif + +#include "../../common/posix/qplatformdefs.h" + +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_IGNORE + +#define QT_OPEN_LARGEFILE 0 + +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) +#define QT_SOCKLEN_T socklen_t +#else +#define QT_SOCKLEN_T int +#endif + +#define QT_SIGNAL_IGNORE (void (*)(int))1 + +#define QT_SNPRINTF ::snprintf +#define QT_VSNPRINTF ::vsnprintf + +#endif // QPLATFORMDEFS_H diff --git a/src/3rdparty/md5/md5.cpp b/src/3rdparty/md5/md5.cpp index f32903c..ac296b5 100644 --- a/src/3rdparty/md5/md5.cpp +++ b/src/3rdparty/md5/md5.cpp @@ -24,6 +24,7 @@ #ifndef _WIN32_WCE #include <sys/types.h> /* for stupid systems */ #else +#include <windef.h> #include <types.h> #endif diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index 981dba2..63bde2f 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -2180,11 +2180,11 @@ contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) { mac { SOURCES += \ - plugins/mac/PluginPackageMac.cpp \ - plugins/mac/PluginViewMac.mm + plugins/mac/PluginPackageMac.cpp OBJECTIVE_SOURCES += \ platform/text/mac/StringImplMac.mm \ - platform/mac/WebCoreNSStringExtras.mm + platform/mac/WebCoreNSStringExtras.mm \ + plugins/mac/PluginViewMac.mm INCLUDEPATH += platform/mac # Note: XP_MACOSX is defined in npapi.h } else { diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index c27a424..3f11c39 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -69,6 +69,10 @@ #define SECURITY_WIN32 #include <security.h> +#ifndef SPI_GETPLATFORMTYPE +#define SPI_GETPLATFORMTYPE 257 +#endif + #ifndef _INTPTR_T_DEFINED #ifdef _WIN64 typedef __int64 intptr_t; diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h index 9d3513a..4c91aaf 100644 --- a/src/corelib/kernel/qcoreevent.h +++ b/src/corelib/kernel/qcoreevent.h @@ -328,6 +328,7 @@ private: friend class QETWidget; friend class QGraphicsView; friend class QGraphicsViewPrivate; + friend class QGraphicsScene; friend class QGraphicsScenePrivate; #ifndef QT_NO_GESTURES friend class QGestureManager; diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index 153ccdf..a14a42c 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -78,6 +78,8 @@ extern uint qGlobalPostedEventsCount(); #ifndef QT_NO_GESTURES #ifndef WM_GESTURE # define WM_GESTURE 0x0119 +#endif +#ifndef WM_GESTURENOTIFY # define WM_GESTURENOTIFY 0x011A #endif #endif // QT_NO_GESTURES diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 624610b..1b9d127 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -3261,7 +3261,10 @@ QString QFSCompleter::pathFromIndex(const QModelIndex &index) const if (currentLocation == QDir::separator()) return path.mid(currentLocation.length()); #endif - return path.mid(currentLocation.length() + 1); + if (currentLocation.endsWith('/')) + return path.mid(currentLocation.length()); + else + return path.mid(currentLocation.length()+1); } return index.data(QFileSystemModel::FilePathRole).toString(); } diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp index 98860c4..feec804 100644 --- a/src/gui/dialogs/qfiledialog_win.cpp +++ b/src/gui/dialogs/qfiledialog_win.cpp @@ -60,7 +60,6 @@ #endif #ifdef Q_WS_WINCE -#include <shlobj.h> #include <commdlg.h> bool qt_priv_ptr_valid = false; #else diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 5b1da9e..981fbbc 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -3461,7 +3461,8 @@ bool QGraphicsScene::event(QEvent *event) break; } case QEvent::Leave: - d->leaveScene(); + // hackieshly unpacking the viewport pointer from the leave event. + d->leaveScene(reinterpret_cast<QWidget *>(event->d)); break; case QEvent::GraphicsSceneHelp: helpEvent(static_cast<QGraphicsSceneHelpEvent *>(event)); @@ -3933,20 +3934,19 @@ bool QGraphicsScenePrivate::dispatchHoverEvent(QGraphicsSceneHoverEvent *hoverEv Handles all actions necessary to clean up the scene when the mouse leaves the view. */ -void QGraphicsScenePrivate::leaveScene() +void QGraphicsScenePrivate::leaveScene(QWidget *viewport) { - Q_Q(QGraphicsScene); #ifndef QT_NO_TOOLTIP QToolTip::hideText(); #endif + QGraphicsView *view = qobject_cast<QGraphicsView *>(viewport->parent()); // Send HoverLeave events to all existing hover items, topmost first. - QGraphicsView *senderWidget = qobject_cast<QGraphicsView *>(q->sender()); QGraphicsSceneHoverEvent hoverEvent; - hoverEvent.setWidget(senderWidget); + hoverEvent.setWidget(viewport); - if (senderWidget) { + if (view) { QPoint cursorPos = QCursor::pos(); - hoverEvent.setScenePos(senderWidget->mapToScene(senderWidget->mapFromGlobal(cursorPos))); + hoverEvent.setScenePos(view->mapToScene(viewport->mapFromGlobal(cursorPos))); hoverEvent.setLastScenePos(hoverEvent.scenePos()); hoverEvent.setScreenPos(cursorPos); hoverEvent.setLastScreenPos(hoverEvent.screenPos()); diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h index f28dfe9..2818fb2 100644 --- a/src/gui/graphicsview/qgraphicsscene_p.h +++ b/src/gui/graphicsview/qgraphicsscene_p.h @@ -201,7 +201,7 @@ public: bool dispatchHoverEvent(QGraphicsSceneHoverEvent *hoverEvent); bool itemAcceptsHoverEvents_helper(const QGraphicsItem *item) const; - void leaveScene(); + void leaveScene(QWidget *viewport); void cloneDragDropEvent(QGraphicsSceneDragDropEvent *dest, QGraphicsSceneDragDropEvent *source); diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 2db29b9..0d39bb5 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -2790,6 +2790,9 @@ bool QGraphicsView::viewportEvent(QEvent *event) d->scene->d_func()->removePopup(d->scene->d_func()->popupWidgets.first()); } d->useLastMouseEvent = false; + // a hack to pass a viewport pointer to the scene inside the leave event + Q_ASSERT(event->d == 0); + event->d = reinterpret_cast<QEventPrivate *>(viewport()); QApplication::sendEvent(d->scene, event); break; #ifndef QT_NO_TOOLTIP diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index a32a957..1dab738 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -115,12 +115,25 @@ extern void qt_wince_hide_taskbar(HWND hwnd); //defined in qguifunctions_wince.c # if defined(Q_WS_WINCE) # include <bldver.h> # endif -# include <winable.h> +# if !defined(Q_WS_WINCE) +# include <winable.h> +# endif +#endif + +#ifndef QT_NO_GESTURES +# ifndef GID_ZOOM +# define GID_ZOOM 3 +# define GID_TWOFINGERTAP 6 +# define GID_PRESSANDTAP 7 +# define GID_ROLLOVER GID_PRESSANDTAP +# endif #endif #ifndef WM_TOUCH # define WM_TOUCH 0x0240 +#endif +#ifndef TOUCHEVENTF_MOVE # define TOUCHEVENTF_MOVE 0x0001 # define TOUCHEVENTF_DOWN 0x0002 # define TOUCHEVENTF_UP 0x0004 diff --git a/src/gui/kernel/qguifunctions_wince.cpp b/src/gui/kernel/qguifunctions_wince.cpp index 6e2ed76..572698e 100644 --- a/src/gui/kernel/qguifunctions_wince.cpp +++ b/src/gui/kernel/qguifunctions_wince.cpp @@ -112,6 +112,9 @@ struct AygSIPINFO #ifndef SPI_GETSIPINFO #define SPI_GETSIPINFO 225 #endif +#ifndef SPI_GETPLATFORMTYPE +#define SPI_GETPLATFORMTYPE 257 +#endif typedef BOOL (*AygInitDialog)(AygSHINITDLGINFO*); typedef BOOL (*AygFullScreen)(HWND, DWORD); diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp index e718212..fdd0fc5 100644 --- a/src/gui/util/qcompleter.cpp +++ b/src/gui/util/qcompleter.cpp @@ -220,7 +220,7 @@ QModelIndex QCompletionModel::mapToSource(const QModelIndex& index) const { Q_D(const QCompletionModel); if (!index.isValid()) - return QModelIndex(); + return engine->curParent; int row; QModelIndex parent = engine->curParent; diff --git a/src/gui/widgets/qmenu.h b/src/gui/widgets/qmenu.h index 7708e05..77f3b1a 100644 --- a/src/gui/widgets/qmenu.h +++ b/src/gui/widgets/qmenu.h @@ -51,6 +51,10 @@ #include <QtGui/qpixmap.h> #endif +#ifdef Q_WS_WINCE +#include <windef.h> // for HMENU +#endif + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE diff --git a/src/plugins/bearer/platformdefs_win.h b/src/plugins/bearer/platformdefs_win.h index 1a10ba7..68343cf 100644 --- a/src/plugins/bearer/platformdefs_win.h +++ b/src/plugins/bearer/platformdefs_win.h @@ -53,6 +53,7 @@ QT_BEGIN_NAMESPACE #define NS_NLA 15 +#ifndef NLA_NAMESPACE_GUID enum NLA_BLOB_DATA_TYPE { NLA_RAW_DATA = 0, NLA_INTERFACE = 1, @@ -115,6 +116,8 @@ struct NLA_BLOB { } ICS; } data; }; +#endif // NLA_NAMESPACE_GUID + #endif enum NDIS_MEDIUM { diff --git a/src/qbase.pri b/src/qbase.pri index 30f3337..933b91e 100644 --- a/src/qbase.pri +++ b/src/qbase.pri @@ -8,7 +8,6 @@ isEmpty(QT_MAJOR_VERSION) { } else { VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} } -mac:!contains(QMAKE_EXT_C, .mm):QMAKE_EXT_C += .mm #load up the headers info CONFIG += qt_install_headers diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index af02c55..a53f04d 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -244,6 +244,7 @@ private slots: void QTBUG_4151_clipAndIgnore(); void QTBUG_5859_exposedRect(); void QTBUG_7438_cursor(); + void hoverLeave(); public slots: void dummySlot() {} @@ -4394,5 +4395,59 @@ void tst_QGraphicsView::QTBUG_7438_cursor() #endif } +class GraphicsItemWithHover : public QGraphicsRectItem +{ +public: + GraphicsItemWithHover() + : receivedEnterEvent(false), receivedLeaveEvent(false), + enterWidget(0), leaveWidget(0) + { + setRect(0, 0, 100, 100); + setAcceptHoverEvents(true); + } + + bool sceneEvent(QEvent *event) + { + if (event->type() == QEvent::GraphicsSceneHoverEnter) { + receivedEnterEvent = true; + enterWidget = static_cast<QGraphicsSceneHoverEvent *>(event)->widget(); + } else if (event->type() == QEvent::GraphicsSceneHoverLeave) { + receivedLeaveEvent = true; + leaveWidget = static_cast<QGraphicsSceneHoverEvent *>(event)->widget(); + } + return QGraphicsRectItem::sceneEvent(event); + } + + bool receivedEnterEvent; + bool receivedLeaveEvent; + QWidget *enterWidget; + QWidget *leaveWidget; +}; + +void tst_QGraphicsView::hoverLeave() +{ + QGraphicsScene scene; + QGraphicsView view(&scene); + GraphicsItemWithHover *item = new GraphicsItemWithHover; + scene.addItem(item); + + // move the cursor out of the way + QCursor::setPos(1,1); + + view.show(); + QTest::qWaitForWindowShown(&view); + + QPoint pos = view.viewport()->mapToGlobal(view.mapFromScene(item->mapToScene(10, 10))); + QCursor::setPos(pos); + QTest::qWait(200); + QVERIFY(item->receivedEnterEvent); + QCOMPARE(item->enterWidget, view.viewport()); + + QCursor::setPos(0,0); + QTest::qWait(200); + QVERIFY(item->receivedLeaveEvent); + QCOMPARE(item->leaveWidget, view.viewport()); +} + QTEST_MAIN(tst_QGraphicsView) #include "tst_qgraphicsview.moc" diff --git a/tools/designer/src/lib/shared/morphmenu.cpp b/tools/designer/src/lib/shared/morphmenu.cpp index 80eac0c..eb5bc87 100644 --- a/tools/designer/src/lib/shared/morphmenu.cpp +++ b/tools/designer/src/lib/shared/morphmenu.cpp @@ -193,7 +193,7 @@ static QStringList classesOfCategory(MorphCategory cat) << QLatin1String("QSpinBox") << QLatin1String("QDoubleSpinBox"); break; case MorphTextEdit: - l << QLatin1String("QTextEdit") << QLatin1String("QPlainTextEdit"); + l << QLatin1String("QTextEdit") << QLatin1String("QPlainTextEdit") << QLatin1String("QTextBrowser"); break; } } |