Migrating QT4 to QT5 (database plugin don't copy the wrong place)

Source: Internet
Author: User

QT5 launched a period of time, after a trial, although there are some problems, such as designer missing WebView and ACTIVEQT UI tools, in addition WebKit release version seems and Visual-studio Express compiler does not Too halftone, always reported run-time errors-Fortunately, the modules used are tested.

1. Modify the path system. QT4 Qtgui Many classes are independent to the Widgets module, in order to improve compatibility, the head of these include all go, directly #include <qapplication>, so, through the Qt + + module name can be bridged 4, The difference between 5.

2, add a macro replacement, Qt:: Wflag into Qt5 windowflags, small problem.

3, the modification of the plugin system. The new q_plugin_metadata the header of the plug-in implementation class, replacing the previous mode of export in CPP, without affecting the migration. Add a compile preprocessing macro, judge the flag, decide which method to use.

4, String handling mode issue. At present, because the project to Chinese, English and internationalization of the use of more standardized, no garbled problems, you can think compatibility is better.

5, third-party dependencies

If you reference a PostgreSQL or MySQL SQL connection plug-in, note that the LIBPQ and Libmysql-related library files are copied to the folder where the executable file is located, not to the folder where the plugins is located, otherwise the connection may fail, although it can be enumerated to the driver. If you refer to the OCI plug-in, be careful not to copy Oci.dll to the publishing folder, which in some cases causes the connection to fail. Instead, use the Oracle connection instance on the machine path system for publishing purposes to obtain dependencies.

6. Release procedure

Qt5 the contents of the Plugins folder, do not forget to publish together.

Summary: After testing, QT4 to 5 of the conversion than qt3->4 to smooth a lot, the general project can be quickly migrated.

-------------------------------

By the Way, the compilation of Qt5 on the consumption of resources greatly unexpected, especially the webkit,link when the direct hard drive 100% Flash, virtual memory support n Large, really regret the memory did not buy more. Memory fragmentation estimation is also very serious, after compiling to Outof Mem, reboot the system then come. Under GCC, too, Mac didn't try.

In the current QT code, in a few years without 4G of memory simply can not compile. So want to think more than QT, I am afraid later a lot of Big C + + projects are so--snowball roll big, keep to be compatible with the old version, add new features, and refactoring for many projects is impossible, only the more rolling bigger.

http://blog.csdn.net/goldenhawking/article/details/8497205

Migrating QT4 to QT5 (database plugin don't copy the wrong place)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.