close

很久以前的筆記@@

 

/*qMain*/
'qMain' is not declared in this scope
解決:
在include file那邊把含有int main()的header file擺在第一個

/*jpg,gif image file*/
QT預設不支援開啟jpg,gif等檔案,程式需要的時候需要特別再加(mac不用)
pro檔:
DEPLOYMENT_PLUGIN += qjpeg qmng qgif
在執行的資料夾新建一個,把dll file放進去(C:\Qt\2010.05\qt\plugins\imageformats)
imageformats/xxx.dll

/*key event*/
QWidget的key event,需要設定focus,需要用tab/mouse等產生focus才能接收到key event
如果希望使用者一執行程式就可以按鍵,可以利用setFocus:
setFocus(Qt::ActiveWindowFocusReason);
google到的另一個方法是攔截windows的evnet,直接處理

/*mousetracking*/
只對qmainwindow無效,要加對centralwidget設定即可
即QMainWindow裡的設
this->setMouseTracking(true);
centralwidget->setMouseTracking(true);
http://www.qtcentre.org/wiki/index.php?title=Widget_Overlay
http://album.blog.yam.com/cherrybrand&folder=7861795

arrow
arrow
    全站熱搜

    natsumi93 發表在 痞客邦 留言(0) 人氣()