首页| 论坛| 消息

标题:【提问】请教版本的兼容问题??
作者:忙碌
日期:2006-02-25 03:22
内容:

由于原先安装的是qt-win-eval-3.3.1试用版,现改用qt4.1.0的开源版后,需要的库文件就找不到了,也许将某些文件改名就可以,但不知应将什么文件改名


#1 [XChinux 02-25 04:03]
Qt3和4不完全兼容的。
请看Qt4 Reference的Porting to Qt4节:
The Qt 4 series is not binary compatible with the 3 series. This means programs compiled for Qt 3 must be recompiled to work with Qt 4. Qt 4 is also not completely source compatible with 3, however nearly all points of incompatibility cause compiler errors or run-time messages (rather than mysterious results). Qt 4 includes many additional features and discards obsolete functionality. Porting from Qt 3 to Qt 4 is straightforward, and once completed makes the considerable additional power and flexibility of Qt 4 available for use in your applications.
To port code from Qt 3 to Qt 4:
Briefly read the porting notes below to get an idea of what to expect.
Be sure that your code compiles and runs well on all your target platforms with Qt 3.
Add the line QT += qt3support to your .pro file if you use qmake; otherwise, edit your makefile or project file to link against the Qt3Support library and add -DQT3_SUPPORT to your compiler flags. (You might also need to specify other libraries. See What's New in Qt 4 for details.)
Run the qt3to4 porting tool. The tool will go through your source code and adapt it to Qt 4.
Follow the instructions in the Porting .ui Files to Qt 4 page to port Qt Designer files.
Recompile with Qt 4. For each error, search below for related identifiers (e.g., function names, class names). This document mentions all relevant identifiers to help you get the information you need at the cost of being a little verbose.
The qt3to4 porting tool replaces occurrences of Qt 3 classes that don't exist anymore in Qt 4 with the corresponding Qt 3 support class; for example, QListBox is turned into Q3ListBox.
At some point, you might want to stop linking against the Qt 3 support library (Qt3Support) and take advantage of Qt 4's new features. The instructions below explain how to do that for each compatibility class.
In addition to the Qt3Support classes (such as Q3Action, Q3ListBox, and Q3V ..

回复 发表
主题 版块