hello world!
分类: C/C++
2013-09-08 00:59:35
Qwt插件增加至designer
1、 系统环境
Windows 7 x86操作系统(32bit);
Intel(R) Core(TM) i5-3470 CPU;
2、软件包
Qwt 6.0.0();
Qt Creator 2.4.1;
Qt 4.8.1 for Desktop – MSVC2008 (用于Qt的MicroSoft工具);
Microsoft Visual C++Compiler 9.0(x86)。
3、安装
3.1 解压
解压Qwt 5.0.2,通过Qt creator打开工程文件,在管理工程目录下将qwtconfig.pri文件(这里所做的修改主要是为了能够调试qwt程序):将
else {
# Qt 4
win32 {
# On Windows you can't mix release and debug libraries.
# The designer is built in release mode. If you like to use it
# you need a release version. For your own application development you
# might need a debug version.
# Enable debug_and_release + build_all if you want to build both.
CONFIG += release # release/debug/debug_and_release
#CONFIG += debug_and_release
#CONFIG += build_all
}
else {
CONFIG += release # release/debug
}
}
修改成为
else {
# Qt 4
win32 {
# On Windows you can't mix release and debug libraries.
# The designer is built in release mode. If you like to use it
# you need a release version. For your own application development you
# might need a debug version.
# Enable debug_and_release + build_all if you want to build both.
#CONFIG += release # release/debug/debug_and_release
#CONFIG += debug_and_release
CONFIG += build_all
}
else {
CONFIG += release # release/debug
}
}
3.2 项目配置
在打开的Qwt工程中选择项目->Qt版本->管理->选择Qt 4.8.1 for Desktop – MSVC2008工具;工具中选择Microsoft Visual C++ Compiler 9.0 (x86)
编译完成后,将源目录下的plugin插件文件下的qwt_designer_plugin.dll 文件拷贝到QtSDK的安装目录D:\QtSDK\QtCreator\bin\designer下。
将qwt目录下的qwt.dll、qwt.lib、qwtd.dll、qwtd.lib放至D:\QtSDK\QtCreator\bin目录下。
重启动Qt Creator,建立一个新的带UI界面的工程,并进入UI设计器点击工具->界面编辑器->关于QT设计师插件。如果正常的话,会是此处Qt将显示找到的插件。
接下来我们就可以直接拖选qwt的控件使用了。当然,如果要编译成exe还需要在.pro文件中将QWT库的头文件和LIBS动态库增加到文件中。