From aacf96f414651c516b11518d9a921d9853d09e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Mon, 22 Jun 2009 14:42:38 +0200 Subject: Add new auto-test QGraphicsItem::childrenBoundingRect2(). Reviewed-by: Andreas --- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index f739499..90c4636 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -170,6 +170,7 @@ private slots: void boundingRects2(); void sceneBoundingRect(); void childrenBoundingRect(); + void childrenBoundingRect2(); void group(); void setGroup(); void nestedGroups(); @@ -2900,6 +2901,16 @@ void tst_QGraphicsItem::childrenBoundingRect() QCOMPARE(parent->childrenBoundingRect(), QRectF(-500, -100, 600, 800)); } +void tst_QGraphicsItem::childrenBoundingRect2() +{ + QGraphicsItemGroup box; + QGraphicsLineItem l1(0, 0, 100, 0, &box); + QGraphicsLineItem l2(100, 0, 100, 100, &box); + QGraphicsLineItem l3(0, 0, 0, 100, &box); + // Make sure lines (zero with/height) are included in the childrenBoundingRect. + QCOMPARE(box.childrenBoundingRect(), QRectF(0, 0, 100, 100)); +} + void tst_QGraphicsItem::group() { QGraphicsScene scene; -- cgit v0.12 From a8a0c956f747cd09ca04cfe8b33d09a8476c6453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Tue, 23 Jun 2009 11:01:15 +0200 Subject: Regression against 4.4 in QRectF::operator|. In 4.4 QRectF handled flat rectangles in the same fashion as QRect does, but that changed with Lars' and Jo's optmizations done in the falcon branch. The difference is that the optimized version only checks whether the width or height is 0, whereas in 4.4 both had to be 0 (isNull()) before we bailed out. This regression also introduced a regression in QGraphicsItem::childrenBoundingRect(). Auto-test included. Task-number: 254995 Reviewed-by: Lars --- src/corelib/tools/qrect.cpp | 62 +++++++++++++++++++----------------------- src/corelib/tools/qrect.h | 2 +- tests/auto/qrect/tst_qrect.cpp | 2 ++ 3 files changed, 31 insertions(+), 35 deletions(-) diff --git a/src/corelib/tools/qrect.cpp b/src/corelib/tools/qrect.cpp index 2082794..b4fe070 100644 --- a/src/corelib/tools/qrect.cpp +++ b/src/corelib/tools/qrect.cpp @@ -2154,48 +2154,42 @@ bool QRectF::contains(const QRectF &r) const QRectF QRectF::operator|(const QRectF &r) const { - qreal l1 = xp; - qreal r1 = xp; - if (w < 0) - l1 += w; - else - r1 += w; - if (l1 == r1) // null rect + if (isNull()) return r; + if (r.isNull()) + return *this; - qreal l2 = r.xp; - qreal r2 = r.xp; - if (r.w < 0) - l2 += r.w; + qreal left = xp; + qreal right = xp; + if (w < 0) + left += w; else - r2 += r.w; - if (l2 == r2) // null rect - return *this; + right += w; - qreal t1 = yp; - qreal b1 = yp; + if (r.w < 0) { + left = qMin(left, r.xp + r.w); + right = qMax(right, r.xp); + } else { + left = qMin(left, r.xp); + right = qMax(right, r.xp + r.w); + } + + qreal top = yp; + qreal bottom = yp; if (h < 0) - t1 += h; + top += h; else - b1 += h; - if (t1 == b1) // null rect - return r; + bottom += h; - qreal t2 = r.yp; - qreal b2 = r.yp; - if (r.h < 0) - t2 += r.h; - else - b2 += r.h; - if (t2 == b2) // null rect - return *this; + if (r.h < 0) { + top = qMin(top, r.yp + r.h); + bottom = qMax(bottom, r.yp); + } else { + top = qMin(top, r.yp); + bottom = qMax(bottom, r.yp + r.h); + } - QRectF tmp; - tmp.xp = qMin(l1, l2); - tmp.yp = qMin(t1, t2); - tmp.w = qMax(r1, r2) - tmp.xp; - tmp.h = qMax(b1, b2) - tmp.yp; - return tmp; + return QRectF(left, top, right - left, bottom - top); } /*! diff --git a/src/corelib/tools/qrect.h b/src/corelib/tools/qrect.h index 0740fe5..efdc24d 100644 --- a/src/corelib/tools/qrect.h +++ b/src/corelib/tools/qrect.h @@ -653,7 +653,7 @@ inline QRectF::QRectF(const QRect &r) } inline bool QRectF::isNull() const -{ return qIsNull(w) && qIsNull(h); } +{ return w == 0. && h == 0.; } inline bool QRectF::isEmpty() const { return w <= 0. || h <= 0.; } diff --git a/tests/auto/qrect/tst_qrect.cpp b/tests/auto/qrect/tst_qrect.cpp index cdb5560..5a91636 100644 --- a/tests/auto/qrect/tst_qrect.cpp +++ b/tests/auto/qrect/tst_qrect.cpp @@ -4125,6 +4125,7 @@ void tst_QRect::unitedRect_data() QTest::newRow("test 13") << QRect() << QRect(10, 10, 10, 10) << QRect(10, 10, 10, 10); QTest::newRow("test 14") << QRect(10, 10, 10, 10) << QRect() << QRect(10, 10, 10, 10); QTest::newRow("test 15") << QRect() << QRect() << QRect(); + QTest::newRow("test 16") << QRect(0, 0, 100, 0) << QRect(0, 0, 0, 100) << QRect(0, 0, 100, 100); } void tst_QRect::unitedRect() @@ -4160,6 +4161,7 @@ void tst_QRect::unitedRectF_data() QTest::newRow("test 13") << QRectF() << QRectF(10, 10, 10, 10) << QRectF(10, 10, 10, 10); QTest::newRow("test 14") << QRectF(10, 10, 10, 10) << QRectF() << QRectF(10, 10, 10, 10); QTest::newRow("test 15") << QRectF() << QRectF() << QRectF(); + QTest::newRow("test 16") << QRectF(0, 0, 100, 0) << QRectF(0, 0, 0, 100) << QRectF(0, 0, 100, 100); } void tst_QRect::unitedRectF() -- cgit v0.12 From 4effe88116bc2a21ec44eea9fbc740283cd73190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 23 Jun 2009 13:15:01 +0200 Subject: Added QPen warning when setting dash pattern with non-positive entries. Task-number: 256720 Reviewed-by: Trond --- src/gui/painting/qpen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qpen.cpp b/src/gui/painting/qpen.cpp index b0da5e2..36059f2 100644 --- a/src/gui/painting/qpen.cpp +++ b/src/gui/painting/qpen.cpp @@ -462,8 +462,8 @@ QVector QPen::dashPattern() const Sets the dash pattern for this pen to the given \a pattern. This implicitly converts the style of the pen to Qt::CustomDashLine. - The pattern must be specified as an even number of entries where - the entries 1, 3, 5... are the dashes and 2, 4, 6... are the + The pattern must be specified as an even number of positive entries + where the entries 1, 3, 5... are the dashes and 2, 4, 6... are the spaces. For example: \table 100% -- cgit v0.12 From 3464a05a94c4e638d91b2151d6aad70f78ea3087 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Mon, 8 Jun 2009 19:38:14 -0700 Subject: Add an error message for building architecture mismatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Snow Leopard defaults to 64-bit if you don't specify an architecture, whereas in the past it defaulted to 32-bit. This isn't a problem for Qt per-se. It *is* a problem if you just build an application that uses Qt but isn't using qmake stuff. To help in those situations, we should error out to let the person know that they need to change their configuration (in any case, the headers are going to complain and they get a much more cryptic message). Reviewed by: Morten Sørvig --- src/corelib/global/qglobal.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index f834bc7..b8a9024 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -279,6 +279,10 @@ namespace QT_NAMESPACE {} # endif #endif +#if defined(Q_OS_MAC64) && !defined(QT_MAC_USE_COCOA) +#error "You are building a 64-bit application, but using a 32-bit version of Qt. Check your build configuration." +#endif + #if defined(Q_OS_MSDOS) || defined(Q_OS_OS2) || defined(Q_OS_WIN) # undef Q_OS_UNIX #elif !defined(Q_OS_UNIX) -- cgit v0.12 From f65ed7b51a573dd8429feecc19c7abe8a0a36114 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Tue, 23 Jun 2009 14:42:32 +0200 Subject: Remove some warnings in the Cocoa build. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After discussing with some of the Objective-C people I have finally got a fair number of the warnings to disappear in both 10.5 and 10.6. I also took the opportunity to remove a bunch of other warnings. Reviewed by: Morten Sørvig --- src/gui/dialogs/qcolordialog_mac.mm | 12 ++++++-- src/gui/dialogs/qfontdialog_mac.mm | 4 ++- src/gui/inputmethod/qmacinputcontext_mac.cpp | 37 ++++++++++++++---------- src/gui/kernel/qcocoaapplicationdelegate_mac.mm | 3 +- src/gui/kernel/qcocoaapplicationdelegate_mac_p.h | 13 +++++++-- src/gui/kernel/qcocoapanel_mac.mm | 6 ++++ src/gui/kernel/qcocoawindow_mac.mm | 4 +++ src/gui/kernel/qcocoawindowdelegate_mac_p.h | 31 +++++++++++++------- src/gui/kernel/qsound_mac.mm | 11 +++++-- src/gui/text/qfontdatabase.cpp | 2 +- src/gui/text/qfontdatabase_mac.cpp | 2 ++ src/gui/util/qsystemtrayicon_mac.mm | 19 ++++++++---- src/gui/widgets/qcocoamenu_mac_p.h | 17 +++++++---- 13 files changed, 113 insertions(+), 48 deletions(-) diff --git a/src/gui/dialogs/qcolordialog_mac.mm b/src/gui/dialogs/qcolordialog_mac.mm index c5cfcc0..06120da 100644 --- a/src/gui/dialogs/qcolordialog_mac.mm +++ b/src/gui/dialogs/qcolordialog_mac.mm @@ -54,11 +54,19 @@ typedef float CGFloat; // Should only not be defined on 32-bit platforms #endif + +#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5 +@protocol NSWindowDelegate +- (void)windowDidResize:(NSNotification *)notification; +- (BOOL)windowShouldClose:(id)window; +@end +#endif + QT_USE_NAMESPACE @class QCocoaColorPanelDelegate; -@interface QCocoaColorPanelDelegate : NSObject { +@interface QCocoaColorPanelDelegate : NSObject { NSColorPanel *mColorPanel; NSView *mStolenContentView; NSButton *mOkButton; @@ -74,8 +82,6 @@ QT_USE_NAMESPACE okButton:(NSButton *)okButton cancelButton:(NSButton *)cancelButton priv:(QColorDialogPrivate *)priv; -- (BOOL)windowShouldClose:(id)window; -- (void)windowDidResize:(NSNotification *)notification; - (void)colorChanged:(NSNotification *)notification; - (void)relayout; - (void)onOkClicked; diff --git a/src/gui/dialogs/qfontdialog_mac.mm b/src/gui/dialogs/qfontdialog_mac.mm index e7d2f43..3dc3c00 100644 --- a/src/gui/dialogs/qfontdialog_mac.mm +++ b/src/gui/dialogs/qfontdialog_mac.mm @@ -78,7 +78,9 @@ const int StyleMask = NSTitledWindowMask | NSClosableWindowMask | NSResizableWin #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5 -@protocol NSWindowDelegate @end +@protocol NSWindowDelegate +- (NSSize)windowWillResize:(NSWindow *)window toSize:(NSSize)proposedFrameSize; +@end #endif diff --git a/src/gui/inputmethod/qmacinputcontext_mac.cpp b/src/gui/inputmethod/qmacinputcontext_mac.cpp index 9ccbe7a..e92c0d3 100644 --- a/src/gui/inputmethod/qmacinputcontext_mac.cpp +++ b/src/gui/inputmethod/qmacinputcontext_mac.cpp @@ -55,13 +55,6 @@ extern bool qt_sendSpontaneousEvent(QObject*, QEvent*); # define typeByteCount typeSInt32 #endif -static QTextFormat qt_mac_compose_format() -{ - QTextCharFormat ret; - ret.setFontUnderline(true); - return ret; -} - QMacInputContext::QMacInputContext(QObject *parent) : QInputContext(parent), composing(false), recursionGuard(false), textDocument(0) { @@ -70,7 +63,7 @@ QMacInputContext::QMacInputContext(QObject *parent) QMacInputContext::~QMacInputContext() { -#ifdef Q_WS_MAC32 +#ifndef QT_MAC_USE_COCOA if(textDocument) DeleteTSMDocument(textDocument); #endif @@ -79,7 +72,7 @@ QMacInputContext::~QMacInputContext() void QMacInputContext::createTextDocument() { -#ifdef Q_WS_MAC32 +#ifndef QT_MAC_USE_COCOA if(!textDocument) { InterfaceTypeList itl = { kUnicodeDocument }; NewTSMDocument(1, itl, &textDocument, SRefCon(this)); @@ -96,7 +89,7 @@ QString QMacInputContext::language() void QMacInputContext::mouseHandler(int pos, QMouseEvent *e) { -#ifdef Q_WS_MAC32 +#ifndef QT_MAC_USE_COCOA if(e->type() != QEvent::MouseButtonPress) return; @@ -105,11 +98,21 @@ void QMacInputContext::mouseHandler(int pos, QMouseEvent *e) if (pos < 0 || pos > currentText.length()) reset(); // ##### handle mouse position +#else + Q_UNUSED(pos); + Q_UNUSED(e); #endif } #if !defined QT_MAC_USE_COCOA +static QTextFormat qt_mac_compose_format() +{ + QTextCharFormat ret; + ret.setFontUnderline(true); + return ret; +} + void QMacInputContext::reset() { if (recursionGuard) @@ -132,12 +135,12 @@ bool QMacInputContext::isComposing() const { return composing; } -#endif +#endif void QMacInputContext::setFocusWidget(QWidget *w) { createTextDocument(); -#ifdef Q_WS_MAC32 +#ifndef QT_MAC_USE_COCOA if(w) ActivateTSMDocument(textDocument); else @@ -147,6 +150,7 @@ void QMacInputContext::setFocusWidget(QWidget *w) } +#ifndef QT_MAC_USE_COCOA static EventTypeSpec input_events[] = { { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent }, { kEventClassTextInput, kEventTextInputOffsetToPos }, @@ -154,11 +158,12 @@ static EventTypeSpec input_events[] = { }; static EventHandlerUPP input_proc_handlerUPP = 0; static EventHandlerRef input_proc_handler = 0; +#endif void QMacInputContext::initialize() { -#ifdef Q_WS_MAC32 +#ifndef QT_MAC_USE_COCOA if(!input_proc_handler) { input_proc_handlerUPP = NewEventHandlerUPP(QMacInputContext::globalEventProcessor); InstallEventHandler(GetApplicationEventTarget(), input_proc_handlerUPP, @@ -171,7 +176,7 @@ QMacInputContext::initialize() void QMacInputContext::cleanup() { -#ifdef Q_WS_MAC32 +#ifndef QT_MAC_USE_COCOA if(input_proc_handler) { RemoveEventHandler(input_proc_handler); input_proc_handler = 0; @@ -186,7 +191,7 @@ QMacInputContext::cleanup() OSStatus QMacInputContext::globalEventProcessor(EventHandlerCallRef, EventRef event, void *) { -#ifdef Q_WS_MAC32 +#ifndef QT_MAC_USE_COCOA QScopedLoopLevelCounter loopLevelCounter(QApplicationPrivate::instance()->threadData); SRefCon refcon = 0; @@ -342,6 +347,8 @@ QMacInputContext::globalEventProcessor(EventHandlerCallRef, EventRef event, void } if(!handled_event) //let the event go through return eventNotHandledErr; +#else + Q_UNUSED(event); #endif return noErr; //we eat the event } diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm index 353d815..ab96d58 100644 --- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm +++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm @@ -259,14 +259,13 @@ static void cleanupCocoaApplicationDelegate() onApplicationChangedActivation(false); } -class QDesktopWidgetImplementation; - (void)applicationDidChangeScreenParameters:(NSNotification *)notification { Q_UNUSED(notification); QDesktopWidgetImplementation::instance()->onResize(); } -- (void)setReflectionDelegate:(NSObject *)oldDelegate +- (void)setReflectionDelegate:(NSObject *)oldDelegate { [oldDelegate retain]; [reflectionDelegate release]; diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac_p.h b/src/gui/kernel/qcocoaapplicationdelegate_mac_p.h index 3931f16..5aa98df 100644 --- a/src/gui/kernel/qcocoaapplicationdelegate_mac_p.h +++ b/src/gui/kernel/qcocoaapplicationdelegate_mac_p.h @@ -97,7 +97,14 @@ QT_FORWARD_DECLARE_CLASS(QApplicationPrivate); #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5 -@protocol NSApplicationDelegate @end +@protocol NSApplicationDelegate +- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender; +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification; +- (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames; +- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender; +- (void)applicationDidBecomeActive:(NSNotification *)notification; +- (void)applicationDidResignActive:(NSNotification *)notification; +@end #endif @@ -106,7 +113,7 @@ QT_FORWARD_DECLARE_CLASS(QApplicationPrivate); QApplicationPrivate *qtPrivate; NSMenu *dockMenu; QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *qtMenuLoader; - id reflectionDelegate; + NSObject *reflectionDelegate; bool inLaunch; } + (QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate)*)sharedDelegate; @@ -115,6 +122,6 @@ QT_FORWARD_DECLARE_CLASS(QApplicationPrivate); - (QApplicationPrivate *)qAppPrivate; - (void)setMenuLoader:(QT_MANGLE_NAMESPACE(QCocoaMenuLoader)*)menuLoader; - (QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *)menuLoader; -- (void)setReflectionDelegate:(NSObject *)oldDelegate; +- (void)setReflectionDelegate:(NSObject *)oldDelegate; @end #endif diff --git a/src/gui/kernel/qcocoapanel_mac.mm b/src/gui/kernel/qcocoapanel_mac.mm index 266cf88..bdc7ecb 100644 --- a/src/gui/kernel/qcocoapanel_mac.mm +++ b/src/gui/kernel/qcocoapanel_mac.mm @@ -55,6 +55,12 @@ extern Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum); // qcocoaview. QT_END_NAMESPACE QT_USE_NAMESPACE + +@interface NSWindow (QtCoverForHackWithCategory) ++ (Class)frameViewClassForStyleMask:(NSUInteger)styleMask; +@end + + @implementation QT_MANGLE_NAMESPACE(QCocoaPanel) - (BOOL)canBecomeKeyWindow diff --git a/src/gui/kernel/qcocoawindow_mac.mm b/src/gui/kernel/qcocoawindow_mac.mm index 9c1dce5..7084416 100644 --- a/src/gui/kernel/qcocoawindow_mac.mm +++ b/src/gui/kernel/qcocoawindow_mac.mm @@ -58,6 +58,10 @@ extern Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum); // qcocoaview. QT_END_NAMESPACE QT_USE_NAMESPACE +@interface NSWindow (QtCoverForHackWithCategory) ++ (Class)frameViewClassForStyleMask:(NSUInteger)styleMask; +@end + @implementation NSWindow (QT_MANGLE_NAMESPACE(QWidgetIntegration)) - (id)QT_MANGLE_NAMESPACE(qt_initWithQWidget):(QWidget*)widget contentRect:(NSRect)rect styleMask:(NSUInteger)mask; diff --git a/src/gui/kernel/qcocoawindowdelegate_mac_p.h b/src/gui/kernel/qcocoawindowdelegate_mac_p.h index b171b47..1e1d668 100644 --- a/src/gui/kernel/qcocoawindowdelegate_mac_p.h +++ b/src/gui/kernel/qcocoawindowdelegate_mac_p.h @@ -63,15 +63,8 @@ QT_FORWARD_DECLARE_CLASS(QWidget) QT_FORWARD_DECLARE_CLASS(QSize) QT_FORWARD_DECLARE_CLASS(QWidgetData) -@interface QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) : NSObject { - QHash *m_windowHash; - QHash *m_drawerHash; -} -+ (QT_MANGLE_NAMESPACE(QCocoaWindowDelegate)*)sharedDelegate; -- (void)becomeDelegteForWindow:(NSWindow *)window widget:(QWidget *)widget; -- (void)resignDelegateForWindow:(NSWindow *)window; -- (void)becomeDelegateForDrawer:(NSDrawer *)drawer widget:(QWidget *)widget; -- (void)resignDelegateForDrawer:(NSDrawer *)drawer; +#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5 +@protocol NSWindowDelegate - (NSSize)windowWillResize:(NSWindow *)window toSize:(NSSize)proposedFrameSize; - (void)windowDidMiniaturize:(NSNotification*)notification; - (void)windowDidResize:(NSNotification *)notification; @@ -83,6 +76,25 @@ QT_FORWARD_DECLARE_CLASS(QWidgetData) - (void)windowDidResignMain:(NSNotification*)notification; - (void)windowDidBecomeKey:(NSNotification*)notification; - (void)windowDidResignKey:(NSNotification*)notification; +@end + +@protocol NSDrawerDelegate +- (NSSize)drawerWillResizeContents:(NSDrawer *)sender toSize:(NSSize)contentSize; +@end + +#endif + + + +@interface QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) : NSObject { + QHash *m_windowHash; + QHash *m_drawerHash; +} ++ (QT_MANGLE_NAMESPACE(QCocoaWindowDelegate)*)sharedDelegate; +- (void)becomeDelegteForWindow:(NSWindow *)window widget:(QWidget *)widget; +- (void)resignDelegateForWindow:(NSWindow *)window; +- (void)becomeDelegateForDrawer:(NSDrawer *)drawer widget:(QWidget *)widget; +- (void)resignDelegateForDrawer:(NSDrawer *)drawer; - (void)dumpMaximizedStateforWidget:(QWidget*)qwidget window:(NSWindow *)window; - (void)syncSizeForWidget:(QWidget *)qwidget toSize:(const QSize &)newSize @@ -90,6 +102,5 @@ QT_FORWARD_DECLARE_CLASS(QWidgetData) - (NSSize)closestAcceptableSizeForWidget:(QWidget *)qwidget window:(NSWindow *)window withNewSize:(NSSize)proposedSize; - (QWidget *)qt_qwidgetForWindow:(NSWindow *)window; -- (void)checkForMove:(const NSRect &)newRect forWidget:(QWidget *)qwidget; @end #endif diff --git a/src/gui/kernel/qsound_mac.mm b/src/gui/kernel/qsound_mac.mm index 43965d1..a8ee516 100644 --- a/src/gui/kernel/qsound_mac.mm +++ b/src/gui/kernel/qsound_mac.mm @@ -80,14 +80,19 @@ protected: QT_END_NAMESPACE +#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5 +@protocol NSSoundDelegate +-(void)sound:(NSSound *)sound didFinishPlaying:(BOOL)aBool; +@end +#endif + QT_USE_NAMESPACE -@interface QMacSoundDelegate : NSObject { +@interface QMacSoundDelegate : NSObject { QSound *qSound; // may be null. QAuServerMac* server; -} +} -(id)initWithQSound:(QSound*)sound:(QAuServerMac*)server; --(void)sound:(NSSound *)sound didFinishPlaying:(BOOL)aBool; @end @implementation QMacSoundDelegate diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 52f4b34..06d4a36 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -442,7 +442,7 @@ QtFontFoundry *QtFontFamily::foundry(const QString &f, bool create) // ### copied to tools/makeqpf/qpf2.cpp -#if (defined(Q_WS_QWS) && !defined(QT_NO_FREETYPE)) || defined(Q_WS_WIN) || defined(Q_WS_MAC) +#if (defined(Q_WS_QWS) && !defined(QT_NO_FREETYPE)) || defined(Q_WS_WIN) || (defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)) // see the Unicode subset bitfields in the MSDN docs static int requiredUnicodeBits[QFontDatabase::WritingSystemsCount][2] = { // Any, diff --git a/src/gui/text/qfontdatabase_mac.cpp b/src/gui/text/qfontdatabase_mac.cpp index f596449..2f6788f 100644 --- a/src/gui/text/qfontdatabase_mac.cpp +++ b/src/gui/text/qfontdatabase_mac.cpp @@ -51,6 +51,7 @@ QT_BEGIN_NAMESPACE int qt_mac_pixelsize(const QFontDef &def, int dpi); //qfont_mac.cpp int qt_mac_pointsize(const QFontDef &def, int dpi); //qfont_mac.cpp +#ifndef QT_MAC_USE_COCOA static void initWritingSystems(QtFontFamily *family, ATSFontRef atsFont) { ByteCount length = 0; @@ -81,6 +82,7 @@ qDebug() << "first char" << hex << unicodeRange[0]; for (int i = 0; i < systems.count(); ++i) family->writingSystems[systems.at(i)] = QtFontFamily::Supported; } +#endif static void initializeDb() { diff --git a/src/gui/util/qsystemtrayicon_mac.mm b/src/gui/util/qsystemtrayicon_mac.mm index 370bc0c..b733db5 100644 --- a/src/gui/util/qsystemtrayicon_mac.mm +++ b/src/gui/util/qsystemtrayicon_mac.mm @@ -124,12 +124,20 @@ QT_USE_NAMESPACE -(void)mousePressed:(NSEvent *)mouseEvent; @end -@interface QNSMenu : NSMenu { + +#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5 + +@protocol NSMenuDelegate +-(void)menuNeedsUpdate:(NSMenu*)menu; +@end +#endif + + +@interface QNSMenu : NSMenu { QMenu *qmenu; } -(QMenu*)menu; -(id)initWithQMenu:(QMenu*)qmenu; --(void)menuNeedsUpdate:(QNSMenu*)menu; -(void)selectedAction:(id)item; @end @@ -455,10 +463,11 @@ private: } return self; } --(QMenu*)menu { - return qmenu; +-(QMenu*)menu { + return qmenu; } --(void)menuNeedsUpdate:(QNSMenu*)menu { +-(void)menuNeedsUpdate:(NSMenu*)nsmenu { + QNSMenu *menu = static_cast(nsmenu); emit static_cast(menu->qmenu)->doAboutToShow(); for(int i = [menu numberOfItems]-1; i >= 0; --i) [menu removeItemAtIndex:i]; diff --git a/src/gui/widgets/qcocoamenu_mac_p.h b/src/gui/widgets/qcocoamenu_mac_p.h index cd53692..8eb6fba 100644 --- a/src/gui/widgets/qcocoamenu_mac_p.h +++ b/src/gui/widgets/qcocoamenu_mac_p.h @@ -56,16 +56,23 @@ QT_FORWARD_DECLARE_CLASS(QMenu) -@interface QT_MANGLE_NAMESPACE(QCocoaMenu) : NSMenu -{ - QMenu *qmenu; -} -- (id)initWithQMenu:(QMenu*)menu; +#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5 + +@protocol NSMenuDelegate - (void)menu:(NSMenu*)menu willHighlightItem:(NSMenuItem*)item; - (void)menuWillOpen:(NSMenu*)menu; - (void)menuWillClose:(NSMenu*)menu; - (BOOL)hasShortcut:(NSMenu *)menu forKey:(NSString *)key forModifiers:(NSUInteger)modifier whichItem:(NSMenuItem**)outItem; +@end + +#endif + +@interface QT_MANGLE_NAMESPACE(QCocoaMenu) : NSMenu +{ + QMenu *qmenu; +} +- (id)initWithQMenu:(QMenu*)menu; - (BOOL)menuHasKeyEquivalent:(NSMenu *)menu forEvent:(NSEvent *)event target:(id *)target action:(SEL *)action; @end #endif -- cgit v0.12 From 5138c39116a03e36005a03f47f718fced6cc6d4e Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 23 Jun 2009 15:10:39 +0200 Subject: Updated WebKit from /home/shausman/src/webkit/trunk to origin/qtwebkit-4.5 ( 4552f381497b5adc18714d7f6e33eba678e3a9b2 ) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes in WebKit since the last update: ++ b/WebCore/ChangeLog 2009-06-23 Thiago Macieira Reviewed by Simon Hausmann. Fix Qt build with Phonon. The #include header no longer exists. And the or headers have never existed (neither for us nor for the Phonon sources). You have to select each and every header that you do want now. * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp: 2009-06-23 Tor Arne Vestbø Reviewed by Simon Hausmann. Fix NPAPI mouse translation issues on Mac The WindowRef we pass to the plugin refers to the the top level window, so the x and y positions have to be relative to this position, but we have to manually compensate for title bar decorations and other parents of the QWebView since contentsToWindow() only traverses to the QWebView. Previously we did this compensation when passing on mouse coordinates to the plugin, which caused various issues with translations such as not being able to close the Flash settings dialog, or the hand cursor not appearing over links. We now do the compensation as part of the call to NPP_SetWindow, and then pass mouse coordinates in global context without any compensation, similar to how both Safari and Mozilla does it. * plugins/mac/PluginViewMac.cpp: (WebCore::PluginView::updatePluginWidget): (WebCore::PluginView::globalMousePosForPlugin): ++ b/WebKit/qt/ChangeLog 2009-06-16 Morten Engvoldsen Reviewed by Ariya Hidayat. Clearifying QWebFrame docs Adding docs to toHtml() and toPlainText() * Api/qwebframe.cpp: --- src/3rdparty/webkit/VERSION | 2 +- src/3rdparty/webkit/WebCore/ChangeLog | 37 ++++++++++++++++++++++ .../webkit/WebCore/plugins/mac/PluginViewMac.cpp | 9 +++--- src/3rdparty/webkit/WebKit/qt/ChangeLog | 10 ++++++ 4 files changed, 52 insertions(+), 6 deletions(-) diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index f7bd730..71add8f 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - bd7262be70c02564d655e4f2aaf79cd8302a937f + 4552f381497b5adc18714d7f6e33eba678e3a9b2 diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index 304b55d..4b74dcb 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,40 @@ +2009-06-23 Thiago Macieira + + Reviewed by Simon Hausmann. + + Fix Qt build with Phonon. + + The #include header no longer exists. And the or + headers have never existed (neither for us nor for the + Phonon sources). You have to select each and every header that you do + want now. + + * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp: + +2009-06-23 Tor Arne Vestbø + + Reviewed by Simon Hausmann. + + Fix NPAPI mouse translation issues on Mac + + The WindowRef we pass to the plugin refers to the the top level window, + so the x and y positions have to be relative to this position, but we + have to manually compensate for title bar decorations and other parents + of the QWebView since contentsToWindow() only traverses to the QWebView. + + Previously we did this compensation when passing on mouse coordinates to + the plugin, which caused various issues with translations such as not + being able to close the Flash settings dialog, or the hand cursor not + appearing over links. + + We now do the compensation as part of the call to NPP_SetWindow, and + then pass mouse coordinates in global context without any compensation, + similar to how both Safari and Mozilla does it. + + * plugins/mac/PluginViewMac.cpp: + (WebCore::PluginView::updatePluginWidget): + (WebCore::PluginView::globalMousePosForPlugin): + 2009-05-21 Geoffrey Garen Reviewed by Sam Weinig. diff --git a/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.cpp b/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.cpp index 3229922..569ed37 100644 --- a/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.cpp @@ -393,7 +393,10 @@ void PluginView::updatePluginWidget() IntRect oldWindowRect = m_windowRect; IntRect oldClipRect = m_clipRect; - m_windowRect = IntRect(frameView->contentsToWindow(frameRect().location()), frameRect().size()); + m_windowRect = frameView->contentsToWindow(frameRect()); + IntPoint offset = topLevelOffsetFor(platformPluginWidget()); + m_windowRect.move(offset.x(), offset.y()); + m_clipRect = windowClipRect(); m_clipRect.move(-m_windowRect.x(), -m_windowRect.y()); @@ -620,10 +623,6 @@ Point PluginView::globalMousePosForPlugin() const Point pos; GetGlobalMouse(&pos); - IntPoint offset = topLevelOffsetFor(platformPluginWidget()); - pos.h -= offset.x(); - pos.v -= offset.y(); - float scaleFactor = tigerOrBetter() ? HIGetScaleFactor() : 1; pos.h = short(pos.h * scaleFactor); diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index d9f925a..afbc770 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,13 @@ +2009-06-16 Morten Engvoldsen + + Reviewed by Ariya Hidayat. + + Clearifying QWebFrame docs + + Adding docs to toHtml() and toPlainText() + + * Api/qwebframe.cpp: + 2009-05-19 Kenneth Rohde Christiansen Reviewed by Simon Hausmann. -- cgit v0.12