diff options
author | David Boddie <dboddie@trolltech.com> | 2009-06-24 15:17:08 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2009-06-24 15:17:08 (GMT) |
commit | 962d3938380dde01e2bd4915c51c95f47fafa0ec (patch) | |
tree | 24524e62fa3c40930a0c6335bfab4d1276aa3f22 /src/gui/util | |
parent | f98829ae299e1f3c1f21b4bf2628601008e5141a (diff) | |
parent | dab9d7c67ed2eda150c8da9e41db75f7eeeecd0d (diff) | |
download | Qt-962d3938380dde01e2bd4915c51c95f47fafa0ec.zip Qt-962d3938380dde01e2bd4915c51c95f47fafa0ec.tar.gz Qt-962d3938380dde01e2bd4915c51c95f47fafa0ec.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/gui/util')
-rw-r--r-- | src/gui/util/qsystemtrayicon_mac.mm | 19 |
1 files changed, 14 insertions, 5 deletions
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 <NSObject> +-(void)menuNeedsUpdate:(NSMenu*)menu; +@end +#endif + + +@interface QNSMenu : NSMenu <NSMenuDelegate> { 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<QNSMenu *>(nsmenu); emit static_cast<QSystemTrayIconQMenu*>(menu->qmenu)->doAboutToShow(); for(int i = [menu numberOfItems]-1; i >= 0; --i) [menu removeItemAtIndex:i]; |