Interpretation of Qt License

Source: Internet
Author: User
Tags wrappers

For desktop and mobile platform applications

    • The official statement is as follows
Qt for application development lets your create applications forDesktopandMobilePlatforms.
It contains all of the QT APIs and the QT Creator IDE for seamless cross-platform development. Qt for application development isdual-licensed under commercialandOpen Source Licenses.
The commercial Qt license gives you all rights to create and distribute software on your
Own terms without any open source license obligations. With the commercial license you also
There are access to the official QT support and close strategic relationship with the QT company
To make sure your development goals is met. Qt for application development is also available underGPLandLGPLv3Open source licenses.
Qt Tools and some libraries is only available under GPL. See the comparison chart for details.
The Qt open source licensing is ideal for use cases such as open source projects with open
Source distribution, student/academic purposes, hobby projects, internal-projects
Without external distribution, or other projects where all (L) GPL obligations can is met. For more information, please see the FAQ.
    • Lincense Types and costs

    • Various License rights and services ( here is concerned about LGPL, can dynamically link Qt library to keep software private )

    • Unfortunately, there are some Qt libraries that are distributed in the GPL ( given the contagion of the GPL, it is not possible to use these libraries in any way in proprietary software, shit! )

    • Unfortunately, there are some Qt tools that are also published in the GPL (but fortunately, without changing the case, can be used in a LGPL way, see the explanation of asterisks in the figure)

For embedded platform Applications



Only under a commercial license


Where only can control and monetize on your end product ' s development, user experience and distribution.

Keep the software private explanation for dynamically linked LGPL licensed libraries

What we are concerned about is whether the library containing the LGPL is viable in its own company's commercial closed-source program.

The LGPL agreement is a business-friendly agreement. You can use the LGPL protocol Library to develop a commercial closed source program . However, it has some limitations .

-If you use the LGPL library to develop the closed source program, use the form of dynamic link , then you can publish your application in any form, commercial, non-commercial, open source, non-open source, with you.

-If for some reason you have to statically link A library published based on the LGPL protocol, you are obligated to do the following:

1. You must indicate in your documentation that the LGPL library is used in your program and that the library is published based on LGPL.
2. You must include a LGPL protocol in your application release, usually the lincense text file.
3. You must open all code that uses the LGPL library code, such as some wrappers. However, other code that uses these wrappers does not need to be open.
4. You must include the destination file for the remainder of your application (usually what we call the. O, etc.), or other equivalent files, which are not required by the source code.

Interpretation:

1th, good understanding.

1th, good understanding.

3rd, simply put, the LGPL protocol requires that if your class uses the code of the LGPL library, you must open up this class. For example, if your program app.exe each source file with the code for the LGPL library, all your source code is open source. To avoid this, we usually write a wrapper that encapsulates the code of the LGPL library so that it only needs to open the wrapper's code, while the other code that uses the wrapper does not need to be open.

4th, a supplement to 3rd, those that use the wrapper do not need open source, but you have to open the intermediate files you compiled, Windows is those. o files.

Examples Show

Suppose we use a library called Lib, which is published based on the LGPL protocol.

If you use Lib.dll to do dynamic linking (under Windows), OK, everything OK, you can keep the final program completely private.

If you want to use static links, then you need to organize your code. If you have a main.cpp (we assume that all functions using the LIB library use the lib_ prefix):

Main.cpp

int main () {    lib_init ();    Lib_do_something ();    Lib_done ();    Lib_close ();
return 0;}

Now that you've finished the main.cpp, you have to open it up! Because it uses the code of the LGPL library. This is stipulated in the third article above.

What if I don't want to open up main.cpp? OK, I'll create a new file Lib_wrapper.cpp:

Lib_wrapper.cpp

void My_lib_init () {    lib_init ();} void My_lib_do_something () {    lib_do_something ();} void My_lib_done ()
{ lib_done ();} void My_lib_close () { lib_close ();}

In the main.cpp , I make the corresponding changes:

int main () {    my_lib_init ();    My_lib_do_something ();    My_lib_done ();    My_lib_close ();
Return0;}

Now, Main.cpp is no longer a direct use of the LGPL library code, so it does not need open source, and our wrapper lib_wrapper.cpp must be open source.

Well, compile our program and you will get MAIN.O (under Windows) this target file.

In the final program release, I need to include the following files:

1. A document stating that: This program uses LIB library, which is published based on the LGPL protocol.

2. LGPL.txt

3. Lib_wrapper.cpp

4. MAIN.O

In this way, users can change the way you use the LGPL library by modifying the contents of the Lib_wrapper.cpp, for example:

void My_lib_done () {    lib_done ();    Lib_close ();} void My_lib_close () {    //lib_close (); }

Then compile this lib_wrapper.cpp and eventually relink. A new executable program was born!

It is believed that there is a basic understanding of the three protocols provided by QT, and there is usually a question about how much of the functional difference is based on the QT products of the three licensing protocols, is it a more complete and better performance for the commercial version? Here can be responsible to say: 99% of the code is the same, whether it is the GPL, LGPL or commercial, function, performance is not different, the only difference is the licensing agreement.

It is also important to note that because LGPL is introduced in this version of Qt4.5, the previous Qt version, 4.4 or 3.x version, does not provide LGPL protocol, is irreversible. At the same time, the release of the QT version in the future will always provide three different versions of the license agreement.

Summary: Given the limitations of the Qt licensing agreement, it is recommended to use WxWidgets to develop commercial products if there is no special requirement for the project!

////////////////////////////////////////////////////////////////////////////////

This part of the content from the Netizen blog, if there is infringement please contact me.

Finish.

Qt License Interpretation

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.