From 6c2fc9960ef1f96687025df0c0a6cf2df7dbba03 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 19 Oct 2010 15:55:26 +0200 Subject: Designer: Enable morphing into QTextBrowser. Task-number: QTBUG-14537 --- tools/designer/src/lib/shared/morphmenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } } -- cgit v0.12 From da4d5207f0a97d7e4fcc32e43a6a6e959c8f293a Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 19 Oct 2010 13:25:39 +0200 Subject: Make sure QGraphicsSceneHoverLeave event has non-null widget pointer. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When constructing QGraphicsSceneHoverLeave event out of QEvent::Leave we should set the widget pointer to the graphicsview's viewport, th same as we do for other graphicsscene events like QGraphicsSceneMouseEvent. Reviewed-by: Yoann Lopes Reviewed-by: Bjørn Erik Nilsen --- src/corelib/kernel/qcoreevent.h | 1 + src/gui/graphicsview/qgraphicsscene.cpp | 14 +++---- src/gui/graphicsview/qgraphicsscene_p.h | 2 +- src/gui/graphicsview/qgraphicsview.cpp | 3 ++ tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 55 ++++++++++++++++++++++++++ 5 files changed, 67 insertions(+), 8 deletions(-) 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/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(event->d)); break; case QEvent::GraphicsSceneHelp: helpEvent(static_cast(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(viewport->parent()); // Send HoverLeave events to all existing hover items, topmost first. - QGraphicsView *senderWidget = qobject_cast(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(viewport()); QApplication::sendEvent(d->scene, event); break; #ifndef QT_NO_TOOLTIP diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index af02c55..433cb26 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(event)->widget(); + } else if (event->type() == QEvent::GraphicsSceneHoverLeave) { + receivedLeaveEvent = true; + leaveWidget = static_cast(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.mapToGlobal(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" -- cgit v0.12 From 065c1e4fd2029dbe7485a884d3cc2d06584a29bb Mon Sep 17 00:00:00 2001 From: Zeno Albisser Date: Fri, 15 Oct 2010 14:12:10 +0200 Subject: make QFileDialog completer return proper dirnames in root This bug was introduced with fa46fa236b5f4a9a5677da2e7464a6b9f8b7b5f3 Reviewed-by: Joao --- src/gui/dialogs/qfiledialog.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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(); } -- cgit v0.12 From befb7bec1b87d559ef6e72ee5944382a1fe6b39f Mon Sep 17 00:00:00 2001 From: Zeno Albisser Date: Tue, 19 Oct 2010 17:25:08 +0200 Subject: Make QCompleter return current parent instead of invalid index This fixes the issue of showing drive D: when completion is used in QFileDialog to display suggestions for folders to change into in path C:/. Task-number: QTBUG-14072 Reviewed-by: Olivier Goffart --- src/gui/util/qcompleter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v0.12 From 6a14ae66503266d812374e25548a455e26c7608d Mon Sep 17 00:00:00 2001 From: Oliver Gutbrod Date: Wed, 20 Oct 2010 13:53:07 +0200 Subject: SPI_GETPLATFORMTYPE not defined for Windows Embedded 7 Reviewed-by: Joerg Bornemann --- src/corelib/io/qfsfileengine_win.cpp | 4 ++++ src/gui/kernel/qguifunctions_wince.cpp | 3 +++ 2 files changed, 7 insertions(+) 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 +#ifndef SPI_GETPLATFORMTYPE +#define SPI_GETPLATFORMTYPE 257 +#endif + #ifndef _INTPTR_T_DEFINED #ifdef _WIN64 typedef __int64 intptr_t; 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); -- cgit v0.12 From 4ff077342a6721622d44f3e9435f0190c18d08bb Mon Sep 17 00:00:00 2001 From: Oliver Gutbrod Date: Wed, 20 Oct 2010 13:58:01 +0200 Subject: WM_GESTURE and WM_GESTURENOTIFY are not defined together for Windows Embedded 7 Reviewed-by: Joerg Bornemann --- src/corelib/kernel/qeventdispatcher_win.cpp | 2 ++ 1 file changed, 2 insertions(+) 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 -- cgit v0.12 From de7963fb4aff704b7ee5fb0bcecdec8abc228cdb Mon Sep 17 00:00:00 2001 From: Oliver Gutbrod Date: Wed, 20 Oct 2010 14:03:13 +0200 Subject: defines GID_* for Windows Embedded 7 Reviewed-by: Joerg Bornemann --- src/gui/kernel/qapplication_win.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 # endif -# include +# if !defined(Q_WS_WINCE) +# include +# 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 -- cgit v0.12 From d493a575565f5ccbe755a95df60f657d0a384f6c Mon Sep 17 00:00:00 2001 From: Oliver Gutbrod Date: Wed, 20 Oct 2010 14:04:28 +0200 Subject: windef.h needs to be include before types.h for Windows Embedded 7 Reviewed-by: Joerg Bornemann --- src/3rdparty/md5/md5.cpp | 1 + src/gui/widgets/qmenu.h | 4 ++++ 2 files changed, 5 insertions(+) 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 /* for stupid systems */ #else +#include #include #endif 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 #endif +#ifdef Q_WS_WINCE +#include // for HMENU +#endif + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -- cgit v0.12 From 3e41a4418c7e4aae1f1b86311d3002f615cce237 Mon Sep 17 00:00:00 2001 From: Oliver Gutbrod Date: Wed, 20 Oct 2010 14:05:20 +0200 Subject: enums are defined as typedefs for Windows Embedded 7 Reviewed-by: Joerg Bornemann --- src/plugins/bearer/platformdefs_win.h | 3 +++ 1 file changed, 3 insertions(+) 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 { -- cgit v0.12 From 6d00e879847f62a7cb36454f78d4616b44144ae7 Mon Sep 17 00:00:00 2001 From: Oliver Gutbrod Date: Wed, 20 Oct 2010 14:09:08 +0200 Subject: removed shlobj.h to prevent different redefinitions for Windows Embedded 7 Reviewed-by: Joerg Bornemann --- src/gui/dialogs/qfiledialog_win.cpp | 1 - 1 file changed, 1 deletion(-) 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 #include bool qt_priv_ptr_valid = false; #else -- cgit v0.12 From 28acb60009e0c40116da4897d21bcb47ef9663ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 19 Oct 2010 11:01:53 +0200 Subject: configure: Don't use character class when looking for QMAKE_CONF_COMPILER MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Alexis Ménard --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 5539851..bc53bae 100755 --- a/configure +++ b/configure @@ -3161,7 +3161,7 @@ else CFG_FRAMEWORK=no fi -QMAKE_CONF_COMPILER=`getQMakeConf "$XQMAKESPEC" | grep "\(^\|\s\)QMAKE_CXX[^_A-Z0-9]" | sed "s,.* *= *\(.*\)$,\1," | tail -1` +QMAKE_CONF_COMPILER=`getQMakeConf "$XQMAKESPEC" | grep "\(^\| \)QMAKE_CXX[^_A-Z0-9]" | sed "s,.* *= *\(.*\)$,\1," | tail -1` TEST_COMPILER="$CXX" [ -z "$TEST_COMPILER" ] && TEST_COMPILER=$QMAKE_CONF_COMPILER -- cgit v0.12 From 1d4bf2d8a4c44f7d91dcde95b54cdd85e4b9b665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 19 Oct 2010 16:23:35 +0200 Subject: Handle Objective-C/C++ sources in SOURCES gracefully We look though SOURCES for Objective-C/C++ source files and if we find any we warn the user and move the offending file to OBJECTIVE_SOURCES. We also don't generate implicit rules for .mm files anymore, since that's not supported by qmake and will break in mysterious ways. Reviewed-by: Marius Storm-Olsen --- mkspecs/features/mac/objective_c.prf | 25 +++++++++++++++++-------- src/3rdparty/webkit/WebCore/WebCore.pro | 6 +++--- src/qbase.pri | 1 - 3 files changed, 20 insertions(+), 12 deletions(-) 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/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/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 -- cgit v0.12 From 15f52e00e50784d39bd2ffe8a2924aecbc0ce2cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 13 Oct 2010 20:33:03 +0200 Subject: Add mkspecs for Clang on Linux and Mac OS X Pass "-platform unsupported/[macx|linux]-clang" and make sure you have a fairly recent trunk-build of Clang (r116737 or above). The platform is currently unsupported and there may be failing test. You have been warned. Reviewed-by: Marius Storm-Olsen --- mkspecs/common/clang.conf | 14 ++++ mkspecs/unsupported/linux-clang/qmake.conf | 19 +++++ mkspecs/unsupported/linux-clang/qplatformdefs.h | 102 ++++++++++++++++++++++++ mkspecs/unsupported/macx-clang/Info.plist.app | 20 +++++ mkspecs/unsupported/macx-clang/Info.plist.lib | 18 +++++ mkspecs/unsupported/macx-clang/qmake.conf | 21 +++++ mkspecs/unsupported/macx-clang/qplatformdefs.h | 97 ++++++++++++++++++++++ 7 files changed, 291 insertions(+) create mode 100644 mkspecs/common/clang.conf create mode 100644 mkspecs/unsupported/linux-clang/qmake.conf create mode 100644 mkspecs/unsupported/linux-clang/qplatformdefs.h create mode 100644 mkspecs/unsupported/macx-clang/Info.plist.app create mode 100644 mkspecs/unsupported/macx-clang/Info.plist.lib create mode 100644 mkspecs/unsupported/macx-clang/qmake.conf create mode 100644 mkspecs/unsupported/macx-clang/qplatformdefs.h 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/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..867688d --- /dev/null +++ b/mkspecs/unsupported/linux-clang/qplatformdefs.h @@ -0,0 +1,102 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $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 + + +// We are hot - unistd.h should have turned on the specific APIs we requested + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef QT_NO_IPV6IFNAME +#include +#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 @@ + + + + + CFBundleIconFile + @ICON@ + CFBundlePackageType + APPL + CFBundleGetInfoString + Created by Qt/QMake + CFBundleSignature + @TYPEINFO@ + CFBundleExecutable + @EXECUTABLE@ + CFBundleIdentifier + com.yourcompany.@EXECUTABLE@ + NOTE + This file was generated by Qt/QMake. + + 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 @@ + + + + + CFBundlePackageType + FMWK + CFBundleShortVersionString + @SHORT_VERSION@ + CFBundleGetInfoString + Created by Qt/QMake + CFBundleSignature + @TYPEINFO@ + CFBundleExecutable + @LIBRARY@ + NOTE + Please, do NOT change this file -- It was generated by Qt/QMake. + + 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 + + +// We are hot - unistd.h should have turned on the specific APIs we requested + + +#include +#include +#include +#include +#include +#include +#define QT_NO_LIBRARY_UNLOAD + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef QT_NO_IPV6IFNAME +#include +#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 -- cgit v0.12 From 66f8bc3b8e2648ee9c0c26c25bc5112ed7d603eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 21 Oct 2010 12:11:18 +0200 Subject: Fix linux-clang license header --- mkspecs/unsupported/linux-clang/qplatformdefs.h | 38 ++++++++++++------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/mkspecs/unsupported/linux-clang/qplatformdefs.h b/mkspecs/unsupported/linux-clang/qplatformdefs.h index 867688d..2dd7b80 100644 --- a/mkspecs/unsupported/linux-clang/qplatformdefs.h +++ b/mkspecs/unsupported/linux-clang/qplatformdefs.h @@ -1,16 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** 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$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. +** 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 @@ -20,21 +21,20 @@ ** 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.0, included in the file LGPL_EXCEPTION.txt in this -** package. +** 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. +** +** +** +** +** +** ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. ** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ -- cgit v0.12 From eacd7e9e54b1beba617ddfe760e4e3742634a5b6 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Fri, 22 Oct 2010 14:40:41 +0200 Subject: Fixed a newly added autotest for QGraphicsView hover_leave. This should fix autotests regression on all platforms. There was a very silly typo in the test. --- tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index 433cb26..a53f04d 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -4437,7 +4437,7 @@ void tst_QGraphicsView::hoverLeave() view.show(); QTest::qWaitForWindowShown(&view); - QPoint pos = view.mapToGlobal(view.viewport()->mapToGlobal(view.mapFromScene(item->mapToScene(10, 10)))); + QPoint pos = view.viewport()->mapToGlobal(view.mapFromScene(item->mapToScene(10, 10))); QCursor::setPos(pos); QTest::qWait(200); QVERIFY(item->receivedEnterEvent); -- cgit v0.12