• 8277阅读
  • 1回复

【提问】请教版本的兼容问题?? [复制链接]

上一主题 下一主题
离线忙碌
 
只看楼主 倒序阅读 楼主  发表于: 2006-02-25
由于原先安装的是qt-win-eval-3.3.1试用版,现改用qt4.1.0的开源版后,需要的库文件就找不到了,也许将某些文件改名就可以,但不知应将什么文件改名
离线XChinux

只看该作者 1楼 发表于: 2006-02-25
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 Q3ValueList), Qt 4 provides compatibility functions when it's possible for an old API to cohabit with the new one. For example, QString provides a QString::simplifyWhiteSpace() compatibility function that's implemented inline and that simply calls QString::simplified(). The compatibility functions are not documented here; instead, they are documented for each class.
If you have the line QT += qt3support in your .pro file, qmake will automatically define the QT3_SUPPORT symbol, turning on compatibility function support. You can also define the symbol manually (e.g., if you don't want to link against the Qt3Support library), or you can define QT3_SUPPORT_WARNINGS instead, telling the compiler to emit a warning when a compatibility function is called. (This works only with GCC 3.2+ and MSVC 7.)
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
快速回复
限100 字节
 
上一个 下一个