æè¿ãMac OS Xã§ãŠã£ã³ããŠã¿ã€ãã«ãã«ã¹ã¿ãã€ãºããããšã«ã€ããŠæžããã®ã§ãããQtãšCocoaã®çžäºäœçšã«ã€ããŠããã«è©³ããæžãããã«ãšãããªã¯ãšã¹ãããããŸããã ãããã¯ãå°ãåºããŠãQtã䜿çšããŠäœæãããã¢ããªã±ãŒã·ã§ã³ã®Mac OS Xãžã®çµ±åã«ã€ããŠèª¬æã§ãããšæããŸããQtfor Cocoaããã®å Žåã«äœ¿çšãããããšã«èšåããŸããQtfor Carbonã䜿çšããå Žåã¯ãççŽ ã®ã¿ã䜿çšããå¿ èŠããããŸãã ããããããã¯æ代é ãã§ããã極端ãªå Žåã«ã®ã¿äœ¿çšãã䟡å€ããããŸãã
éåžžã®Qtããã°ã©ã ã«ã¯ãApple HIGãšã®å€ãã®ççŸããããŸãã ããæ£ç¢ºã«ã¯ããã¹ãŠã®ããã°ã©ã ãè¿œå æ©èœãå¿ èŠãšããããã§ã¯ãªãã®ã§ãæã£ãŠãããããããŸããã ããšãã°ããã¹ãŠã®ããã°ã©ã ã§ããã¯ã®ã¢ã€ã³ã³ã®äžã«ãããžãä»ããããããã¯ã¡ãã¥ãŒãå±éãããããããŒã¡ãã¥ãŒã®äžéšã®æ©èœãåé€/è€è£œããå¿ èŠã¯ãããŸããã
ãããããã®æ©èœãå¿ èŠãªå Žåã¯ã©ãã§ããããïŒ ããã¯ïŒSkypeãªã©ïŒã§éç¥ã®æ°ã衚瀺ããå¿ èŠãããå Žåã¯ãããã¯ã®ã¢ã€ã³ã³ãã¯ãªãã¯ããŠåŠçããã¡ãã¥ãŒé ç®ãããã¯ã«è¿œå ããéåžžã®ã¡ãã¥ãŒã䜿çšããŠãäžè¬çã«ãããã°ã©ã ãMac OSã®ãã€ãã£ãã®ããã«ããŸããïŒ ããã®ããã€ãã¯ãéåžžãŸãã¯åææžåãããQté¢æ°ã䜿çšããŠå®è¡ã§ããŸãããŸããCocoaãšããããã£ãŠObjective-Cã䜿çšããŠã®ã¿å®è¡ã§ãããã®ããããŸãã
Objective-C ++ã圹ç«ã¡ãŸãïŒ
ããã¯ã©ããªåç©ã§ãäœãšäžç·ã«é£ã¹ãŸããïŒ æ¬è³ªçã«ãããã¯Objective-CãšC ++ã¯ã©ã¹ã1ã€ã®ãœãŒã¹ãã¡ã€ã«ã«çµåããæ©èœã§ãã ããã«ãèŠåºãã®æ¡åŒµåã¯æšæºïŒ.hïŒã®ãŸãŸã§ããããœãŒã¹ã«ã€ããŠã¯ãæ¡åŒµå.mmãæå®ããå¿ èŠããããŸããããã«ãããã³ã³ãã€ã©ã¯ãããé£ã¹ãŠãã§ãŒã¯ããŸããã
ããã§ãQtã§äœæãããïŒãããã倧ããªïŒãããžã§ã¯ãããããšæ³åããŠãã ããã åœåã¯WindowsãŸãã¯Linuxã§æžãããŠããŸããããä»ã§ã¯ãã¯ãã«è»¢éããå¿ èŠããããŸãããã®ãããã±ã·ã®æ œå¹è ããã®æªç©ãèŠããšãã«éŒ»ã«ãããå¯ããªãããã«ãçŸãã䟿å©ã§ãã
æå§ãã«ãApple HIGã®ããã°ã©ã ã€ã³ã¿ãŒãã§ãŒã¹ã調æŽããå¿ èŠãããããšã¯æããã§ãããã ããããã¯ãã®èšäºã®ç¯å²å€ã§ããç°ãªãOSåãã«ç°ãªãã³ãŒããã³ã³ãã€ã«ã§ãã䟿å©ãªQ_WS_ *å®çŸ©ã«ã€ããŠã®ã¿èšåããŸãã ã¢ããªã±ãŒã·ã§ã³ãæ°ããç°å¢ã«é©å¿ãããæ¹æ³ã«ã€ããŠèª¬æããŸãïŒãŸãã¯Qtã§Macã¢ããªã±ãŒã·ã§ã³ããŒãããäœæããæ¹æ³-ç®æšã«ãã£ãŠç°ãªããŸãïŒã
é çªã«è¡ããŸãããã
äžè¬çãªçµ±å
ãŸããããã°ã©ã ã«ååãšã¢ã€ã³ã³ãä»ããŸãã ãããããã³ãã«ã®ååã§ã¯ãªããã¢ããªã±ãŒã·ã§ã³ã¡ãã¥ãŒã«è¡šç€ºãããååã§ãã ãããè¡ãã«ã¯ãqmakeãçæãããã®ã§ã¯ãªããç¬èªã®Info.plistãã¡ã€ã«ãå¿ èŠã§ãã ããã¯ã.proã®1è¡ã§å®è¡ãããŸãã
macx: QMAKE_INFO_PLIST = MyInfo.plist
.plistã§ã¯ã次ã®ããã«èšè¿°ããŸãã
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>LSHasLocalizedDisplayName</key> <true/> <key>CFBundleIconFile</key> <string>myicon.icns</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleGetInfoString</key> <string>Created by Qt/QMake</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleExecutable</key> <string>MyAppName</string> <key>CFBundleIdentifier</key> <string>com.mycompany.myapp</string> <key>NOTE</key> <string>This file was generated by Qt/QMake.</string> </dict> </plist>
ãã¡ããããMyAppNameããšãcom.mycompany.myappãã®ä»£ããã«ãããã°ã©ã ã®è±èªåãšãã®ãã³ãã«èå¥åãèšè¿°ããŸãã ãªãè±èªïŒ ã¯ããå¥ã®ãã¡ã€ã«ã«ããŒã«ã©ã€ãºããããã ããã¯ããªã¹ãã®æåã®ãã©ã¡ãŒã¿ãŒLSHasLocalizedDisplayNameã«ãã£ãŠç€ºãããŸãã ãã£ã¬ã¯ããªãru.lprojããšãã®äžã«ãã¡ã€ã«InfoPlist.stringsãäœæããŸãã ãã®ãã¡ã€ã«ã§ã¯ã次ã®ããã«èšè¿°ããŸãã
/* Localized versions of Info.plist keys */ CFBundleName = " "; CFBundleDisplayName = "";
ããã§ã¯ããã³ãã«ã®ããŒã«ã©ã€ãºãããååãšãã¢ããªã±ãŒã·ã§ã³ã¡ãã¥ãŒã«è¡šç€ºãããååãæå®ããå¿ èŠããããŸãã ãããæ©èœãããã«ã¯ãããã°ã©ã ãã€ã³ã¹ããŒã«ãããšãã«ãã®ãã£ã¬ã¯ããªãAppName.app/Contents/Resourcesã«ã³ããŒããå¿ èŠããããŸãã.proãã¡ã€ã«ã§INSTALLSãæå®ããããšããå§ãããŸãã詳现ã«ã€ããŠã¯ãqmakeã®ããã¥ã¡ã³ããåç §ããŠãã ããã ã¹ã¯ãªãŒã³ã·ã§ããã¯ããã³ãã«èªäœã«ã©ãã³èªã®ååãããã«ãããããããã¢ããªã±ãŒã·ã§ã³ã¡ãã¥ãŒã®ååããã·ã¢èªã§ããããšã瀺ããŠããŸãã
ããã°ã©ã ã¢ã€ã³ã³ïŒMyInfo.plistãã¡ã€ã«ã®myicon.icnsãåç §ïŒãèšå®ããã«ã¯ãã°ã©ãã£ãã¯ãšãã£ã¿ãŒã§èªåã§äœæãããã ããã°ã©ã ãŸãã¯ãªã³ã©ã€ã³ãµãŒãã¹ã䜿çšããŠ.icoãŸãã¯äžé£ã®.pngããå€æã§ãã.icnsãã¡ã€ã«ãå¿ èŠã§ãã ã¢ã€ã³ã³ã®èŠæ ããè¯ãããã«ã¯ã512x512ã256x256ã128x128ã64x64ã48x48ã32x32ã16x16ã®ããã€ãã®ãµã€ãºã«ããããšããå§ãããŸãã ã·ã¹ãã èªäœããã©ã®ç¶æ³ã§ã©ã®ãµã€ãºã衚瀺ããããéžæããŸãã ã¢ã€ã³ã³ã®ãããã¡ã€ã«ããªãœãŒã¹ã«ã€ã³ã¹ããŒã«ããå¿ èŠããããŸãã ã€ã³ã¹ããŒã«ããæãç°¡åãªæ¹æ³ã¯ã.proãã¡ã€ã«ã«ä»¥äžãæžã蟌ãããšã§ãã
macx: ICON = myicon.icns
ã³ãŒãåââé¢
Objective-C ++ã«ã¯å€ãã®å¶éããããŸãã ããšãã°ã.cppãœãŒã¹ãã¡ã€ã«ã«Objective-Cã¯ã©ã¹ã€ã³ã¿ãŒãã§ã€ã¹ã®å®£èšã«ããããŒãå«ããããšã¯ã§ããŸãããã³ã³ãã€ã©ããã§ãŒã¯ããããã§ãã Mac OS Xå°çšã«èšèšãããæ°ãããããžã§ã¯ãã®å Žåãããã¯å¶éã§ã¯ãããŸããããã¹ãŠã®C ++ã³ãŒãã.mmãã¡ã€ã«ã«ä¿æãã楜ããããšãã§ããããã§ãã ããããQtã®æå³ã¯ã¯ãã¹ãã©ãããã©ãŒã ãªã®ã§ããœãŒã¹ã³ãŒãã¯ãŸã .cppãã¡ã€ã«ã«ãããšæ³å®ããŸãã
åºå£ã¯ç°¡åã§ãã C ++ã§Objective-CåŒã³åºããšã¯ã©ã¹ã®ã©ãããŒãäœæããå¿ èŠããããŸãã ç§ã¯ãã®æ§é ãéžæããŸãããMacOS Xãšã®çµ±åãæäŸããQt / C ++ã¯ã©ã¹ããããŸããããèªäœã§ããã€ãã®äœæ¥ãè¡ããCocoa / Objective-Cãç©æ¥µçã«äœ¿çšãããã©ã€ããŒãã¯ã©ã¹ãããªã²ãŒãããžã®ããªã²ãŒããè¡ããŸãã åæã«ã次ã®ãã¡ã€ã«ãååŸããŸãã
* myclass.h-ã¡ã€ã³ã¯ã©ã¹ã®ããããŒ
* myclass.cpp-å®è£
* myclass_p.h-ãã©ã€ããŒãã¯ã©ã¹ããããŒïŒObjective-Cã€ã³ã¿ãŒãã§ã€ã¹ãªãïŒ
* myclass_p.mm-ãã©ã€ããŒãã¯ã©ã¹ãœãŒã¹ãObjective-Cã¯ã©ã¹ã®ã€ã³ã¿ãŒãã§ã€ã¹ãšå®è£ ãããããŒãªã©ãå«ããããšãã§ããŸãã
ãããã£ãŠãC ++ãšObjective-C ++ãæ確ã«åºå¥ããŸãã
ãšããã§ãObjective-C ++ãæ©èœããããã«ã¯ã.proãã¡ã€ã«ã§ããã䜿çšãããã¹ãŠã®ããããŒ/ãœãŒã¹ãOBJECTIVE_HEADERSããã³OBJECTIVE_SORCESã»ã¯ã·ã§ã³ã«é 眮ããå¿ èŠããããŸãã ãããŠãã¡ãããmacxãããã¯å ã§ãããè¡ããŸãïŒ{}ã ãŸããCocoaã䜿çšããå Žåã¯ããã®ãã¬ãŒã ã¯ãŒã¯ããããžã§ã¯ãã«è¿œå ããå¿ èŠããããŸãã .proã§æžã蟌ã¿ãŸãã
macx: QMAKE_LFLAGS += -framework Cocoa
ãããŠä»ã楜ãã¿ãæ¥ãã§ãããã
Dockã䜿çšãã
ããã¯ãæäœãã5ã€ã®äž»èŠãªæ©èœãèããŠã¿ãŸãããããããžã®è¿œå ããªãŒããŒã¬ã€ã®è¿œå ãããã¯å ã®ã¢ã€ã³ã³ã®ã¯ãªãã¯åŠçãããã¯å ã®ããã°ã©ã ã¢ã€ã³ã³ã®ããã¹ããç¬èªã®ã¡ãã¥ãŒã®è¿œå ã Qtã䜿çšãããšãæåŸã®åé¡ã ãã§ãªããææžåãäžååãªé¢æ°qt_mac_set_dock_menuïŒQMenu *ïŒã§ã解決ã§ããŸãã ãŸããå€éšãã宣èšããå¿ èŠããããŸãã
extern void qt_mac_set_dock_menu(QMenu *); // Qt internal function
å人çãªçµéšã«åºã¥ããŠãããã€ãã£ããããã¯ã¡ãã¥ãŒãšæ¯èŒããŠãã¡ãã¥ãŒã«ã¯ããã€ãã®å¶éã課ãããŠããŸãã
*éã¢ã¯ãã£ãïŒç¡å¹ïŒã¡ãã¥ãŒé ç®ã¯äœããã®çç±ã§ã¢ã¯ãã£ãã«ãªããŸã
* QMenuã¯aboutToHideããã³aboutToShowä¿¡å·ãåºåããŸãã
*èŠçŽ ãã€ã³ãã³ãããããšã¯ã§ããŸãã
*ã¡ãã¥ãŒã®æåã®QActionãã»ãã¬ãŒã¿ãŒã§ããå Žåãããã¯è¡šç€ºãããŸãïŒä»ã®ãã¹ãŠã®QMenuãããã§ã¹ããšã¯ç°ãªããŸãïŒ
ãããã£ãŠãããã«é©å¿ããå¿ èŠããããŸãã ãã¡ãããObjective-C / Cocoaã§ãã¹ãŠãå®è¡ã§ããŸãããQActionãšãã€ãã£ãã¡ãã¥ãŒé ç®ããããã³ã°ããç¬èªã®ã¡ã«ããºã ãäœæããå¿ èŠããããŸãã ãã ãããããã®å¶éãæé€ããå¿ èŠæ§ãéåžžã«é«ãå Žåã«ã®ã¿ããããè¡ãããšã¯çã«ããªã£ãŠããŸãã
次ã«ãããã¯ã®ã¯ãªãã¯ãæ€èšããŸãã Cocoaã§èšè¿°ããå Žåãåé¡ã¯ãããŸãããAppDelegateã§applicationShouldHandleReopenïŒhasVisibleWindowsïŒã¡ãœãããå®è£ ããã°ååã§ãã ããããQtã®è žã§äœæãããããã°ã©ã ããªã²ãŒãã«çŽæ¥ã¢ã¯ã»ã¹ããããšã¯ã§ããŸããã ãããã£ãŠã ã©ã³ã¿ã€ã ã®ããžãã¯ã䜿çšããŠããã®ã¡ãœããã®å®è£ ãè¿œå ããŸã ã ãŸããå¿ èŠãªãã®ãå®è£ ããé¢æ°ã宣èšããŸãã ãããè¡ãã«ã¯ããã©ã€ããŒãã¯ã©ã¹ãã·ã³ã°ã«ãã³ã«å€æãïŒãšã«ããããã®ã¯ã©ã¹ã®è€æ°ã®ãªããžã§ã¯ãã¯å¿ èŠãããŸããïŒã次ã®é¢æ°ãèšè¿°ããŸãã
void dockClickHandler(id self, SEL _cmd) { Q_UNUSED(self) Q_UNUSED(_cmd) MyPrivate::instance()->emitClick(); }
é¢æ°ã¯ãããªã²ãŒãã«åã蟌ãŸãã«æ»ãã§ããŸãã ããããããããªãã§ãã ããïŒ
MyPrivate::MyPrivate() : QObject(NULL) { Class cls = [[[NSApplication sharedApplication] delegate] class]; if (!class_addMethod(cls, @selector(applicationShouldHandleReopen:hasVisibleWindows:), (IMP) dockClickHandler, "v@:")) NSLog(@"MyPrivate::MyPrivate() : class_addMethod failed!"); } void MyPrivate::emitClick() { emit dockClicked(); }
ããã§ãã¢ããªã±ãŒã·ã§ã³ã®ããªã²ãŒãã¯ã©ã¹ãååŸããã¡ãœããããã®å Žã§è¿œå ããŸãã åæã«ãemitClickïŒïŒã¡ãœãããå®è£ ããŸãããã®ã¡ãœããã¯ãã¯ãªãã¯ã«é¢ããQtã·ã°ãã«ãçºè¡ããŸãã å®éãããã§ãã¹ãŠã§ããããšãã°ãã¡ã€ã³ããã°ã©ã ãŠã£ã³ããŠãªã©ã衚瀺ã§ããããã¯ãã¯ãªãã¯ããã ãã§ãã
次ã«ãããã¯ã®ããã°ã©ã ã¢ã€ã³ã³ãæŸãæããããšãã§ããŸãã ç§ã®æåã®èãïŒãQApplication :: alertïŒQWidget *ïŒã¯åãããšãããããšãã§ããŸãïŒããã®èãã¯çå®ã§ãããææå°æ©ã«æ¥œèŠ³çã§ãã åé¡ã¯ãMac OS X 10.6ã®å Žåã§ãã*ãã®é¢æ°ã¯æ£åžžã«æ©èœããŸããã10.7ã®å Žåã§ãã*äœããã®çç±ã§äžèŠã§ãïŒããã¯Qt 4.7.xãå ¬åŒã«LionããµããŒãããŠããªããããããããŸãããã 4.8ã§ã¯ä¿®æ£ãããŸãïŒã ç§ã¯ããããªãèµ·ããã®ãç解ã§ãããCocoaã«ãã¹ãæžããã ãã§ãã
void MyPrivate::requestAttention() { [NSApp requestUserAttention: NSInformationalRequest]; }
ãã®ã³ãŒãã¯Qt-shn alertïŒïŒãè€è£œããŸãããMac OS Xã®ãã¹ãŠã®ããŒãžã§ã³ã§åäœããŸããä»ã®ã·ã¹ãã ã§ããalertïŒïŒã䜿çšã§ããŸãã
次ã«ããããžãæ±ããŸãããã 誰ããç¥ããªãå Žåãããã¯ããã¯ã®ããã°ã©ã ã¢ã€ã³ã³ã®äžã«ããã¹ãã衚瀺ãããèµ€ãåã§ãã ããšãã°ãMail.appã®æªèªã¡ãã»ãŒãžã®æ°ã衚瀺ããããã«äœ¿çšãããŸãã Appleã®ããã¥ã¡ã³ãã§ã¯ãããã¯æ¬¡ã®ããã«è¡ãå¿ èŠããããšæžãããŠããŸãã
[[NSApp dockTile] setBadgeLabel: badgeString];
ããã§ãbadgeStringã¯NSString *åã§ãã ãããããã¯æåã®äžäŸ¿ã§ãïŒ Qtã§ã¯ãQStringã¯éåžžæäœãããŸããã€ãŸããæååã®ç¹å®ã®ãã³ã³ããŒã¿ãŒããèšè¿°ããå¿ èŠããããŸãã
// warning! nsstring isn't released! NSString * nsStringFromQString(const QString & s) { const char * utf8String = s.toUtf8().constData(); return [[NSString alloc] initWithUTF8String: utf8String]; }
ã³ãŒãïŒããã³ã³ã¡ã³ãïŒãããããããã«ãè¿ãããæååã¯è§£æŸãããªããããåŒã³åºãã³ãŒãã§ãããè¡ãå¿ èŠããããŸãïŒQtã¯ARCã䜿çšããªããããã¡ã¢ãªãç£èŠããŸãïŒã
ããã§ãããã¯ã®ãããžã«å¿ èŠãªè¡ã衚瀺ãããã©ã€ããŒãã¯ã©ã¹ã®é¢æ°ãäœæã§ããŸãã
void MyPrivate::setDockBadge(const QString & badgeText) { NSString * badgeString = nsStringFromQString(badgeText); [[NSApp dockTile] setBadgeLabel: badgeString]; [badgeString release]; }
ããã¯ã䜿çšããæåŸã®åŽé¢ã¯ãä»»æã®ãªãŒããŒã¬ã€ãããã¯ã«è¿œå ããããšã§ãã ããã¯ã次ã®ã³ãŒãã䜿çšããŠè¡ãããŸãã
[[NSApp dockTile] setContentView: view];
ããã§ã®ãã¥ãŒã¯NSView *ã§ãã ããããç§ãã¡ã¯Qtã§äœæ¥ããŠããŸãïŒ ãã®ããããªãŒããŒã¬ã€ã«QWidget *ãé 眮ããå¿ èŠããããŸãã NSViewãQWidgetããååŸããæ¹æ³ã¯ïŒ ç°¡åãªé¢æ°ãæžããŸãïŒ
NSView * nsViewFromWidget(QWidget * w) { return (NSView *)w->winId(); }
ç°¡åã§ããQtã®äœæè ã¯ãã»ãŒãã¹ãŠã®äœæ¥ãè¡ã£ãŠãããŸããã
ããããæ®å¿µãªãããæ®å¿µãªããšã«ç§ãã¡ã¯åŸ ã£ãŠããŸããQWidgetããååŸããNSViewã¯ãããã¯ãžã®ã€ã³ã¹ããŒã«ã«ã¯é©ããŠããŸããã ã€ãŸããããã¯çœ®ãããNSDockTileã¯ãããé£ã¹ãŸãããããã¯å ã®ãŠã£ãžã§ããã®ã³ã³ãã³ãã®ä»£ããã«ã空ã®ã¹ããŒã¹ã圢æãããŸãã çç±ã¯ããããŸããã ããããQt Creatorã§ãããããã¯ã®é²è¡ç¶æ³ããŒã¯ããã®ããã«ç¹å¥ã«äœæãããçŽç²ãªNSViewãä»ããŠæ£ç¢ºã«ãã³ã°ã¢ããããŸãã ãã®ãããç¬èªã®ãªãŒããŒã¬ã€ãå¿ èŠãªå Žåã¯ãCocoaã§ãã¥ãŒãäœæããŠãããŸããŸããã ããã
ã¡ãã¥ãŒãæäœãã
ãããŒã¡ãã¥ãŒïŒãããããã«ã®ã¡ãã¥ãŒïŒã«é²ã¿ãŸãããã ããã©ã«ãã§ã¯ãQtããã°ã©ã ã¯äœæããŸããïŒã·ã¹ãã æ©èœãåããæšæºã®ã¢ããªã±ãŒã·ã§ã³ã¡ãã¥ãŒãé€ãïŒã Qtéçºè ã«ãšã£ãŠæåã«æãæµ®ãã¶ã®ã¯QMenuBarã§ãã 確ãã«ãããã«é¢ããããã¥ã¡ã³ãã¯ããããŒã¡ãã¥ãŒã®æ©èœãå®è¡ã§ãããšè¿°ã¹ãŠããŸãã ãã ãã2ã€ã®ãªãã·ã§ã³ããããŸããããã°ã©ã ãŠã£ã³ããŠããšã«åå¥ã®QMenuBarãäœæãããã1ã€ã®ã°ããŒãã«ãäœæããŸãã åŠå®ã§ããªãå©ç¹ãããããã2çªç®ã®ãªãã·ã§ã³ãéžæããŸãã
ç¹°ãè¿ãã«ãªããŸãããããã¥ã¡ã³ãã«åºã¥ããŠã芪ããŒãã®QMenuBarãã€ãŸãQMenuBar * macMenuBar = new QMenuBarïŒNULLïŒãäœæããå¿ èŠããããŸããããã¯ã°ããŒãã«ã«ãªããŸãã ããæ£ç¢ºã«ã¯ãããããŠäœæãããæåã®ã¡ãã¥ãŒããŒãã°ããŒãã«ã«ãªããŸãã
ãããŠä»-æã§å調ãªä»äºãããããã ãç·šéããããã¡ã€ã«ããããã«ããã¡ãã¥ãŒãªã©ãäœæããŸãã ããã¯ããªãéå±ãªä»äºã§ããããããªãã§ã¯ããã°ã©ã ã¯è¯ãèŠããŸããã ããã«ãæšæºã®ã·ã§ãŒãã«ããâWããã³âMã¯ããããããŠã£ã³ããŠãéãããæå°åãããããŸããã ãŸããèªåã§è¡ãå¿ èŠããããŸãïŒå°ãªããšããwellQã¯ããã«åäœããŸãïŒã
Mac OS Xã®QActionã®ããã€ãã®æ©èœã«æ³šç®ããŸãããããã«ã·ã§ãŒãã«ãããæå®ããå ŽåããCtrl + MããQKeySequenceã³ã³ã¹ãã©ã¯ã¿ãŒã«æž¡ããŠâMã·ã§ãŒãã«ãããäœæããå¿ èŠããããŸãã ãããŠäžè¬ã«ãã±ã·ã®äžã®Qtã®âããŒã¯Ctrlã®ããã«ã©ãã«ã§ãè¡ããCtrlããŒã¯Metaã®ããã«è¡ããŸãã ãããããããã°ã©ã ã®ç§»æ€æ§ãé«ããããã§ãã
ããŠãã¡ãã¥ãŒãäœæãããã®ã¢ãããŒãã®å¶éã«ã€ããŠã
*ã¡ãã¥ãŒé ç®ãã€ã³ãã³ãããããšã¯ã§ããŸãã
* QMenuã¯aboutToHideä¿¡å·ãéä¿¡ããŸããïŒaboutToShowã®ã¿ïŒ
*次ã®ãã°ãçºçããŸãã[ãã«ã]ã¡ãã¥ãŒãããã«ãããšåŒã°ããå Žåãã¡ãã¥ãŒé ç®ãæ€çŽ¢ããããã®ã·ã¹ãã ãããã¯ãèªåçã«äœæãããŸããããã·ã¢èªã§åœåãããŠããå ŽåãçŸåšã®ãã±ãŒã«ããã·ã¢èªã§ãã£ãŠããããã¯çºçããŸããã ãã®ã°ãªãããåãé€ãæ¹æ³ã¯ãç§ã¯ãŸã èŠã€ããŠããŸããã
ã»ãŒæçµ-Qtã®ã«ã¹ã¿ã ãŠã£ã³ããŠã¿ã€ãã«
åã®èšäºã§æžãããã¹ãŠãQtããã°ã©ã ã«é©çšããã«ã¯ã次ã®ããšãè¡ãå¿ èŠããããŸãã ãŸããä¿æ/解æŸããå¿ èŠãããå Žæãèšå®ããŸãã ARCã¯å«ãŸããŸããã 第äºã«ãObjective-C ++ã§ã¯ãçŽç²ãªObjective-Cã§ã¯å®è¡ã§ããªãã£ãããšãèš±å¯ãããŸãããã©ã¯ãŒããšããŠã®ã¿å®£èšãããŠããå Žåã¯ã¯ã©ã¹ãååŸããŸãã
id _class = [NSThemeFrame class];
ããã«ããããã®é¢æ°ãåŒã³åºãåã«ããã°ã©ã ã«å°ãªããšã1ã€ã®ãŠã£ã³ããŠãçšæããå¿ èŠããªããªããŸãã ãã以å€ã¯ãã¹ãŠåããªã®ã§ãããã§ã³ãŒããã³ããŒããŠè²Œãä»ããŸããã ããã¯äŸã§ç¢ºèªã§ããŸãïŒä»¥äžã®ãªã³ã¯ïŒã
ãããã«
ãã®ãããQtããã°ã©ã ãMac OS Xã«çµ±åããããã«Qt + Cocoaãã³ãã«ã«é©çšãããObjective-C ++ãæ€èšããŸãããObjective-CãšCocoaã®åºæ¬çãªç¥èãããã°ãæŠããŠããã§è€éãªããšã¯ãããŸããã ãã®èšäºã§çŠç¹ãåœãŠãããšããæ©èœã®ããã€ããç¥ã£ãŠããå¿ èŠããããŸãã
ãã¹ããããžã§ã¯ãã®å®å šãªãœãŒã¹ã³ãŒãã«èå³ããã人ã¯ã GitHubãžããããïŒ
PSïŒ Growlãä»ããããã°ã©ã éç¥ãžã®åã蟌ã¿ãæ€èšããããšãã§ããŸãããè³æãåŠãã å Žåãèªè ã¯èªåã§ãããè¡ãããšãã§ããŸãã