Qt 4.5 ãªãªã¼ã¹
ãQt 4.5ãã¤ãã«ãªãªã¼ã¹ããã¾ããï¼
ãQt Software、LGPL対応の「Qt 4.5」リリース、「Qt Creator」も新登場 | OSDN Magazine
ãhttp://journal.mycom.co.jp/news/2009/03/04/035/index.html
Qt 4.5(Mac OS X) 㧠64ãããããã°ã©ã ãä½ãæ¹æ³
ãQt 4.5 ããMac OS X ã®64ãããï¼x86_64ï¼ã¢ã¼ããã¯ãã£ã¨ãCocoa ããµãã¼ããããããã«ãªãã¾ããã
ãMac OS X ã¯OSã®æ©è½ããCocoa ã¨ãã Objective-C ã®ãã¬ã¼ã ã¯ã¼ã¯ã§æä¾ãã¦ãã¾ããç´æ¥ Mac OS X ã®æ©è½ãå¼ã¶ãªãã°ãObjective-C/C++ ãã Cocoa ãå¼ã¶å¿
è¦ãããã¾ããC/C++ãã Cocoa ãå¼ã¶ãã¨ãã§ããªããããC/C++ç¨ã«ã¯ Carbon ã¨ãããã¬ã¼ã ã¯ã¼ã¯ãåå¨ãã¾ããããããCarbon ã¯å°æ¥å»æ¢ããããã¨ã決å®ãã¦ãããã64ãããçããµãã¼ããããªããã¨ã決å®ãã¦ããï¼ä¿®æ£ï¼ãMac OS X åãã«C/C++ã§å®è£
ããããã°ã©ã ã¯å°æ¥ãè¦è¶ãã¦ãCarbon ããCocoa ã¸ç§»è¡ããå¿
è¦ãããã¾ãããããããQt 4.5ããã©ã¤ãã©ãªã®ããã¯ã¨ã³ã㧠Cocoa ããµãã¼ããã¦ãã¾ããã¤ã¾ããQt 4.5ã使ãã° Cocoa ãæèãããã¨ãªã Mac OS X ãã¤ãã£ããªããã°ã©ã ãéçºã§ããã¨ããããã§ã*1ãããã¯é常ã«å¬ããã§ããã
ãã¨ããããã§ãQt 4.5åãã«x86_64åãã®å®è¡ãã¡ã¤ã«ãä½ãæ¹æ³ã«ã¤ãã¦èª¬æãã¾ããã¡ãªã¿ã«ã64ãããã§ä½æããããã°ã©ã ã¯èªåçã« Cocoa ã«ãªãã¿ããã§ãããããã¦ãCocoa㯠64ãããã ãã§ãªã 32ãããããã°ã©ã ãã使ç¨ãããã¨ãã§ãã¾ãã
æé
ãæ¢ã«ããã¸ã§ã¯ããã¡ã¤ã«ã¯ä½ææ¸ã¿ã¨ããä¸ã§ã話ãé²ãã¾ããããã¸ã§ã¯ããã¡ã¤ã«ãç·¨éãã¦ãCONFIGã«x86_64ã追å ãã¾ãã
CONFIG += x86_64
ãqmake ã³ãã³ã㧠Makefileãçæãã¾ããã好ã¿ã§ -platform macx-g++42 ãªã©ãå ãã¾ãï¼ããããã¨ãçæããã Makefile ã§ã¯CC=gcc-4.2, CXX=g++-4.2ãã»ãããããï¼ã
$ qmake qttest1.pro -spec macx-g++
ããã¨ã¯ make clean ãã¦ããªãã«ãããã ãï¼
ãã¨ããç°¡åãªããã»ã¹ã®ã¯ããªã®ã§ãããå®ã¯ç½ ãããã¾ãããªãã£ã·ã£ã«ã§é
å¸ããã¦ãã Qt 4.5 ã®ãã¤ããªããã±ã¼ã¸ã§ã¯ x86_64/Cocoa ã«å¯¾å¿ãã¦ããªãã¿ããã§ãã³ã³ãã¤ã« or ãªã³ã¯ã§å¤±æããã®ã§ã*2ãã¾ãå
ã«çµè«ãããã¨ãQtãã½ã¼ã¹ã³ã¼ãããã¤ã³ã¹ãã¼ã«ãã¾ããããããã§è§£æ±ºã§ããã½ã¼ã¹ã³ã¼ãããã¤ã³ã¹ãã¼ã«ããæ¹æ³ã«ã¤ãã¦ã¯æ¬¡ã®æ®µè½ãé£ã°ãã¦ã次ã®é
ã§èª¬æãã¾ãã
ãç´°ãã話ãã©ããã¦ãããªãã¨ãããã£ãã®ããã¨ããçµç·¯ã«ã¤ãã¦æ¸ãã¦ã¿ã¾ããQt 4.5ããªãªã¼ã¹ããããããç§ã¯å¬ã
ã¨ã㦠Qt 4.5 ã®ãã¤ããªããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ãã¾ããã次ã®ããã¥ã¡ã³ããèªãã ããGoogleã§æ¤ç´¢ãæç®ãæ¼ã£ãçµæããCONFIG += x86_64ããããã¸ã§ã¯ããã¡ã¤ã«ã«è¿½å ããã¨ããçãã«ãã©ãã¤ãã¾ãããããããã³ã³ãã¤ã«ã«å¤±æãã¦ãã¾ãã¾ãã
ãhttp://doc.trolltech.com/4.5/developing-on-mac.html
ãQtã®ã©ã¤ãã©ãªã x86_64/Cocoa ã«å¯¾å¿ãã¦ããå ´åãã³ã³ãã¤ã«æã«ããªããã»ããµã§ QT_MAC_USE_COCOA ãå®ç¾©ããã¾ãããã¤ããªããã±ã¼ã¸ã§ã¯ãããã¸ã§ã¯ããã¡ã¤ã«ã«ãCONFIG += x86_64ãã追å ããã ãã§ã¯ã³ã³ãã¤ã«ã«å¤±æãã¦ãã¾ãã¾ãããããã§ãç§ã¯ã³ã³ãã¤ã«æã« QT_MAC_USE_COCOA ãå®ç¾©ãããããã«ããã¸ã§ã¯ããã¡ã¤ã«ãç·¨éããã³ã³ãã¤ã«ãæåããããã«ãã¾ããããçµæçã«ã¯ãªã³ã¯ã¨ã©ã¼ãåºã¦å¤±æãã¦ãã¾ãã¾ãããããã¥ã¡ã³ããããèªãã¨ããCocoa åãã« Qt ããã«ããã¦ããããQT_MAC_USE_COCOAãå®ç¾©ããããã¨ãããã¨ãããã§ããã¤ã¾ãããã£ãããªãã£ã·ã£ã«ãµã¤ããããã¦ã³ãã¼ãããã®ã«ããã±ã¼ã¸ã«ã¯ QT_MAC_USE_COCOA ãå®ç¾©ããã¦ããããCocoa ãé対å¿ã ã£ãã®ã§ããæ®å¿µï¼
Qt 4.5ãã½ã¼ã¹ããã¤ã³ã¹ãã¼ã«ãã
ãåºæ¬çã«ã¯æ¬¡ã®ãããªæµã㧠Qt 4.5 ãã¤ã³ã¹ãã¼ã«ãã¾ããconfigure ã¯ãªãã·ã§ã³ãå¤ããããconfigure --help ã®è¡¨ç¤ºãèªã¿ãèªåã«å¿ è¦ãªãªãã·ã§ã³ãé¸ãã§ãã ãããã¤ã³ã¹ãã¼ã«å ã¯ããã©ã«ãã§ãã/usr/local/Trolltech/Qt-4.5.0/ãã§ãã
$ wget ftp://ftp.qtsoftware.com/qt/source/qt-mac-opensource-src-4.5.0.tar.bz2 $ tar -xvf qt-mac-opensource-src-4.5.0.tar.bz2 $ cd qt-mac-opensource-src-4.5.0 $ ./configure -optimized-qmake -fast -shared -debug-and-release -largefile -silent -cocoa -framework -arch "x86 x86_64" $ make $ sudo make install
ãç§ãæå¹ã«ãããªãã·ã§ã³ã¯æ¬¡ã®ãããªæãã§ãã
- release/buildç¨ã®sahredã©ã¤ãã©ãª
- Largeãã¡ã¤ã«ãµãã¼ãï¼4GBãã大ãããã¡ã¤ã«ã®å¯¾å¿ï¼
- 対å¿ã¢ã¼ããã¯ãã£: x86/x86_64
- ã³ã³ãã¤ã©ã®æé©åãªã³(-fast)*3ã
ããã¨ãç§ã¯ã³ã³ãã¤ã«ã«gcc 4.2ã使ãããã£ãã®ã§ãã./configureãã®åã«ãCC="gcc-4.2" CXX="g++-4.2"ããä»ãã¦ãgcc,g++ãæå®ãã¾ããã
ãPATH ãéãã®ãå¿ããªãããã«ãã¾ãããã以ä¸ã§ãã¤ã³ã¹ãã¼ã«ã¯çµããã«ãªãã¾ãããç²ãæ§ã§ããã
ãQt Creator, Qt Desinger ãªã©ä¾¿å©ãªãã¼ã«ãå¢ãã¦ãããè²ã
ç´¹ä»ãããã¨ããã§ããæ°ãåããã次åã«ç¶ãã¾ããããã§ã¯ãQtã§å¿«é©ãªéçºã©ã¤ããï¼
å ¬å¼ããã¥ã¡ã³ãã¸ã®ãªã³ã¯
ãQt 4.5ã¨Mac OS X ã«ã¤ãã¦ã¯ãã¨ãããã次ã®ããã¥ã¡ã³ãããããã¦ããã°ããããã§ãã
ãhttp://doc.trolltech.com/4.5/qtcocoa-known-issues.html
ããCocoa ã§ãªã³ã¯ããã¨ãã¯ãã¹ã¿ãã£ãã¯ãªã³ã¯ãéæ¨å¥¨ã®ããã§ãã
ãhttp://doc.trolltech.com/4.5/deployment-mac.html
ãhttp://doc.trolltech.com/4.5/developing-on-mac.html
ãhttp://doc.trolltech.com/4.5/platform-notes-mac.html
*1:ãã¡ãããããã©ã¼ãã³ã¹ãªã©ãæèããç´æ¥ Cocoa ã® API ãå¼ã³åºããã¨ããã®ãããã§ãããã
*2:ç§ã¯ã¯ãQt SDK: Complete Development Environmenãã®Mac OS X ç¨ã®ããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ãã¾ããããQt: Framework Onlyãã®ããã±ã¼ã¸ã¯ã¤ã³ã¹ãã¼ã«ãã¦ããªãã®ã§ç¢ºèªãã¦ãã¾ããã
*3:ã©ããããSSEã®ãã§ãã¯çããã£ã¦ãããã¿ããã§ã