- 7月 13 週日 200821:13
[QT筆記] 在Visual Studio 2005使用PainterPath繪圖
- 7月 12 週六 200818:57
[QT筆記] 在Visual Studio 2005下如何使用QT
這篇文章是說明我初步在Visual Studio 2005中撰寫簡單的QT程式,
首先必須要先下載與安裝QT的兩個程式:
1. QT4.4.0商業評估版
2. QT ntegration for Visual Studio
步驟:
- 7月 12 週六 200813:33
[QT筆記] 將QT4 Designer的ui檔轉換(或編譯)成exe執行檔
QT4的Designer顯然是與QT3有很大的不同,
在參考許多文章後才將QT4的ui檔,轉換成exe檔,
所使用的軟體為QT4.4.0,
步驟如下:
1. 開啟QT Designer,建立一個widget專案,拉一個PushButton放置在表單上,並將text屬性填入"hello",
2. 存檔成qtui1.ui,同時到表單-->檢試程式碼將源碼儲存,預設的檔名是ui_qtui1.h,

3. 將這兩個檔案放入C槽新增的qtui1資料夾中,這時需要一個main.cpp(請參考QT Designer Manual的Using a Component in Your Application部份)
main.cpp的內容為:
在參考許多文章後才將QT4的ui檔,轉換成exe檔,
所使用的軟體為QT4.4.0,
步驟如下:
1. 開啟QT Designer,建立一個widget專案,拉一個PushButton放置在表單上,並將text屬性填入"hello",
2. 存檔成qtui1.ui,同時到表單-->檢試程式碼將源碼儲存,預設的檔名是ui_qtui1.h,
3. 將這兩個檔案放入C槽新增的qtui1資料夾中,這時需要一個main.cpp(請參考QT Designer Manual的Using a Component in Your Application部份)
main.cpp的內容為:
- 7月 12 週六 200807:35
[QT筆記] 在Window XP下使用qmake
軟體 : QT4.4.0
qmake是Trolltech提供的一套簡化在不同平台進行專案的"build(建立)"流程的工具。
qmake is a tool from Trolltech that helps simplify the build process for development project across different platforms.
拿QT所提供的範例來做示範,在QT位置所在的資料夾的 examples/qmake/tutorial中有:
hello.h
hello.cpp
將這兩個檔案copy到C槽,並新建一個"hello"的資料夾來存放這兩個檔案,

打開程式集中的QT4.4.0 Command Prompt

切換到C:\hello

qmake -project =>生成hello.pro,告訴qmake與開發專案相關的souece與header檔的部份。


hello.pro的內容:
qmake是Trolltech提供的一套簡化在不同平台進行專案的"build(建立)"流程的工具。
qmake is a tool from Trolltech that helps simplify the build process for development project across different platforms.
拿QT所提供的範例來做示範,在QT位置所在的資料夾的 examples/qmake/tutorial中有:
hello.h
hello.cpp
將這兩個檔案copy到C槽,並新建一個"hello"的資料夾來存放這兩個檔案,
打開程式集中的QT4.4.0 Command Prompt
切換到C:\hello
qmake -project =>生成hello.pro,告訴qmake與開發專案相關的souece與header檔的部份。
hello.pro的內容:
######################################################################
# Automatically generated by qmake (2.01a) ??? ?? 2 08:09:11 2008
######################################################################
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
# Input
HEADERS += hello.h
SOURCES += hello.cpp main.cpp
qmake => 生成Makefile文件
此時debug與release兩個資料夾還是空的,
nmake(亦可用make,取決於所使用的compiler) =>執行Makefile中的命令,
此時debug資料夾中出現hello.exe
cd debug =>進入debug資料夾
hello =>運行编譯鏈接好的exe文件
執行的hello.exe
1
