Is QT charged?

Source: Internet
Author: User
Tags wrappers

The three protocols of QT and their charges are quoted as follows:

Example 1:

I have been learning QT recently. Qt has two licenses: lgpl and commercial protocols. The Code of these two protocols in the current QT version is completely consistent (the potential meaning is that early versions of QT and commercial versions of QT usually contain libraries not available in some open-source versions, for example, qtsingleapplication ). Therefore, for general developers and some commercial companies, using the lgpl QT can save a lot of cost. The biggest difference between the two versions is that the former is free and the latter is charged. Since the code is consistent, the cost is used to purchase the after-sales service and training services of QT.

Now let's talk about copyright issues. Lgpl is an open source protocol, so some people may worry about whether lgpl can be used to develop closed source programs and sell money. Although some companies in China do not pay much attention to this issue, if you violate the Agreement, when someone else sends a letter of attorney, it is really a cry. Therefore, let's take a look at the protocol to see if lgpl can be used to develop closed source programs.

The following is my summary of N websites. As bean is not a lawyer, the lgpl protocol is basically incomprehensible. How can we understand this agreement? We hope to hear from professionals. Here is a way to attract others! Although I am not quite sure, the understanding mentioned here is still far from the end.

As for what the lgpl protocol is, we will not talk about it here. We are concerned about developing commercial programs using the lgpl protocol. Please note that the closed source code here refers to a program that does not open source code in some form, that is, users (including other developers) cannot obtain their source code. The lgpl protocol is a commercial-friendly protocol. The meaning here is that you can use the lgpl Protocol to develop commercial programs. Of course, you can also use non-commercial closed source programs. However, it has some limitations. This is the focus of our discussion.

Now that we have defined it, we will go directly to the topic: Use the lgpl Protocol to develop closed source programs. If you use dynamic links, you can publish your applications in any form, commercial, non-commercial, open-source, or non-open-source. For some reason, if you have to statically link a library published based on the lgpl Protocol (hereinafter referred to as the lgpl Library), you are obligated to do the following:
1. You must note in your document that the lgpl library is used in your program and that the Library is released based on lgpl;
2. You must include an lgpl protocol in your application release, which is usually the text file;
3. You must open all the code that uses the lgpl library code, such as some wrappers. However, other codes that use these wrappers do not need to be open;
4. You must include the remaining part of the target file of your application (usually. O, etc.) or other equivalent files. Source code is not required.

Is it hard to understand? Let's talk about it in detail.

The first one is easy to understand; the second one is easy to understand. Here you can find the content of the lgpl protocol and copy it and release it with your program. Article 3 is not that easy to understand. To put it simply, the lgpl Protocol requires that if your class uses the lgpl library code, you must open-source the class. For example, if each source file of app.exe uses the lgpl library code, all your source code must be open-source. To avoid this situation, we usually write a package to encapsulate the code of the lgpl library. In this way, we only need to open the code of this package, other code that uses the package does not need to be open. Article 4 is a supplement to Article 3: Programs that use the package do not need to be open-source, but you must open the intermediate files that you compile.
The. O files.

You are wondering why the lgpl protocol requires this? What lgpl does is that it ensures that users can have the ability to modify the way you use the lgpl library functions (the wrappers are the way you use the lgpl library, which are already open-source), re-compile the code, and then re-connect the program (the target file required for the connection is also included, which is stipulated in Article 4 ), you can get a new executable program.

Well, if you still don't understand how to use it, let's look at an example.

Suppose we use a library named Lib, which is published based on the lgpl protocol. If you use Lib. DLL for Dynamic Link (in Windows), OK. Regardless of your program, you can do what you do.

We mainly look at how to organize your code if you want to use static links. If you have a main. cpp (we assume that all lib library functions use the Lib _ prefix ):

// main.cpp int main(){        lib_init();        lib_do_something();        lib_done();        lib_close();         return 0;} 

Now you have completed main. cpp, but you must open source it! Because it uses the lgpl library code. This is the third rule above. I don't want to open the source. What should I do? Okay. Create a new file 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 Main. cpp, make the following changes:

int main(){        my_lib_init();        my_lib_do_something();        my_lib_done();        my_lib_close();         return 0;} 

Currently, Main. cpp no longer directly uses the lgpl library code, so it does not need to be open-source, and our package lib_wrapper.cpp must be open-source.

Well, compile our program and you will get the target file main. O (in Windows.

In the release of the final program, you need to include the following file:

1. a document stating that this program uses the Lib library, which is published based on the lgpl protocol;

2.lgpl.txt;

3. lib_wrapper.cpp;

4. Main. o

In this way, you can change the method of using the lgpl library by modifying the lib_wrapper.cpp content, for example:

void my_lib_done(){        lib_done();        lib_close();}void my_lib_close(){        // lib_close();} 

Then compile lib_wrapper.cpp and re-link it. A new executable program is born!

Citation 2:

Qt 4.5 provides three authorization protocols: GPL, lgpl, and cial. Many may ask why three authorization protocols are required for the same product, under what circumstances is the most appropriate authorization protocol? Here I will give a general explanation:

GPL stands for the GNU General Public License, which is a license agreement for most GNU programs and more than half of free software. The starting point of GPL is the open-source/free use of code and the open-source/free use of reference/modification/derivative code, however, modification and derivative Code cannot be released and sold as commercial software with closed source.
The main content of the GPL protocol is as long as you use ("use" refers to the class library reference, modified code or derivative code) the GPL protocol in a software product, the software must also adopt the GPL protocol, which is both open-source and free. This is the so-called "contagious ". The GPL protocol product can be used as a separate product without any problems. You can also enjoy the free advantage.

Return to lgpl. The full name of lgpl is GNU lesser General Public License, which is also a license issued by the Free Software Foundation, is an open-source protocol designed mainly for the use of class libraries, and GPL requires that any software that uses/Modifies/derives the GPL class library must adopt the GPL protocol. Lgpl allows commercial software to use the lgpl class library through class library reference (Link) without the need for open source commercial software code. This allows open source code using the lgpl protocol to be referenced by commercial software as class libraries for concurrent release and sales.

In addition to the two open-source protocols GPL and lgpl, QT also provides the commercial license cial protocol, which is defined by Nokia and signed by Nokia and the buyer, qt product authorization protocol with legal effect. Commercial License is used with GPL and lgpl. It provides more flexibility for commercial customers. Customers can modify the QT source code and develop commercial software without disclosing any source code. In addition, we provide technical support services in commercial license. Of course, commercial authorization agreements are charged.

When do I need to select GPL and lgpl? One of the most obvious reasons is that they are free of charge. You do not have to pay for the use of lgpl and gpl qt versions. Of course, we will not provide technical support accordingly. If you plan to develop real open-source software and want users to keep it open-source, GPL is a better choice because everyone, whether you are yourself or in the future based on your code for further development, it must be open-source. If you plan to develop commercial software with closed source code (not open source code), lgpl is more suitable, but must meet the following two conditions:
1. Your application should dynamically link to the QT function library and release your application separately from the lgpl library that has not been modified. At the same time, make sure that the user (receiver) knows that the application uses the lgpl QT;
2. If you have made any changes to the qt of the lgpl version and published it, you must follow the lgpl terms for release. Any user has the right to get these changes (usually the source code) and make sure that the user can generate the QT version you have modified through these changes.

I believe that you have a basic understanding of the three protocols provided by QT. Generally, you may have a question, what is the functional difference between the QT products based on these three authorization protocols? Is the commercial version more complete and the performance better? Here I can say responsibly: 99% of the Code is the same. No difference is made between GPL, lgpl, or commercial. The only difference is that the authorization protocol is different.

Another note is that lgpl was introduced in qt4.5, so the previous QT version, 4.4 or 3. the version of X does not provide the lgpl Protocol and is irreversible. At the same time, the QT version released in the future will always provide three different authorization protocol versions.

There are links below. If you want to learn more about these authorization protocols, you can learn.

GPL protocol (http://www.gnu.org/copyleft/gpl.html)
GPL protocol-http://bergwolf.googlepages.com/gplv3_zh
Lgpl protocol source-http://www.gnu.org/copyleft/lesser.html
Lgpl protocol-http://www.thebigfly.com/gnu/lgpl/lgpl-v3.php
58 different open source protocols-http://www.fsf.org/licensing/licenses/
What is dynamic link-http://zh.wikipedia.org/wiki/%E5%8A%A8%E6%80%81%E9%93%BE%E6%8E%A5%E5%BA%93
Official statement-http://www.qtsoftware.com/about/news/lgpl-license-option-added-to-qt
Official Q & A-http://www.qtsoftware.com/about/licensing/frequently-asked-questions

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/changsheng230/archive/2010/07/24/5761519.aspx

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.