Distribution with LGPL



  • Hey there. I want to build a simple application with some textboxes and dropdowns. Nothing fancy like charts or the like. I did not use QT until now and did not start my project yet as I'm not able to get the "obligations" QT wants. I read though some threads but those did not help me out.

    1: Using parts of Qt that are only available under GPL requires open sourcing of your application when distributing
    What? I thought LPGL is open source as well. Whats the difference between "GPL open source" and "LGPL open source"?

    2: Must provide a relinking mechanism for Qt libraries
    How do I provide a "mechanism"? I would assume that it would be enough to link dynamically to the QT librarys. But that would ommit static linking (which seems is only allowed with commercial license anyway). But I understand the "obligation" in the way that I need to provide a possibility for the user to define the name of the library that is getting linked.

    3: Must make a Qt source code copy available for customers
    As the FAQ states it is not sufficient enough to link to the QT download page. But the download of QT is ~400MB unzipped. But this includes the QTCreator editor. How to ship/provide the Source Code in a reasonable size?
    Alternatively you need to provide a written offer with instructions on how to get the source code. Please also note that this has to be under your control, so a link to the source code provided by the Qt Project or Qt Company is not sufficient.
    What needs to be under my control? The source code I need to provide or the instructions how to get it.
    Is it enough to write: "How to get QT: Google QT download -> Go to download page -> download"?

    4: Must make “open” consumer devices
    Oh common, what the ... What are they talking about? I don't want to create a dishwasher, I want to write a little program running on windows.

    5: The LGPL allows you to keep the source code of your application private as long as it is “work that uses” the library. Dynamic linking is usually recommended here.
    I thought it is not allowed to use static linking in LGPL distribution? How would I keep my code private without dynamic linking? If I would link statically, I would need to provide my source so the user can recompile the code, as re-linking with QT library must be possible.

    6: The user of your application has to be able to re-link your application against a different or modified version of the Qt library.
    Got that above already.
    With LGPLv3 it is also explicitly stated that the user needs to be able to run the re-linked binary on it’s intended target device.
    Does it mean if "I" target Windows 64Bit and the QT librarys got changed by the user, the program still needs to run on Windows 64Bit? Still the user could change to library to what ever. How should I be able to ensure proper functionality of my program?

    I'm slow-witted, but these terms seem not clear at all.

    Regards



  • @Rumbleball
    I too am not 100% on all this. So I'm going to throw in my understanding to help you and for comment/disagreement by any expert.

    I believe that essentially provided you stick to two things, you will be OK with Qt, but this seems in direct contravention of your quoted point #1:

    1. You do not modify the source of Qt anything.
    2. You allow/require your end users to install Qt from wherever themselves, rather than "packaging" it (not sure about this one). And certainly no static linking.

    That is what my understanding of GPL vs LGPL is. I say this based on my use of PyQt, which is GPL not LGPL, as I do not use GPL-but-not-LGPL bits of Qt. I believe I can quote web sources for this interpretation if required, as it does seem to contradict some of what is written above.

    My (admittedly confused) understanding of LGPL is that you don't have to do anything/make anything available of Qt, so long as you don't modify it/statically link it.

    I should be happy if an expert wishes to contradict my statements, especially if they quote where they are getting their info from for the LGPL or GPL side. In my case, I do need to adhere for PyQt if not for GPL parts of Qt.

    Please don't take anything I have written as intended antagonistically --- it's not!

    P.S.
    I assume because you're new you are intending to use Qt5.7 or later?
    And are you targetting desktops or embedded systems?


  • Moderators

    @Rumbleball said in Distribution with LGPL:

    1: Using parts of Qt that are only available under GPL requires open sourcing of your application when distributing
    What? I thought LPGL is open source as well. Whats the difference between "GPL open source" and "LGPL open source"?

    For a quick rundown of differences, see this post. Yes, both licenses are open source but have slightly different obligations. Qt is available under both LGPL and GPL (you choose either one), apart from some new modules introduced after Qt 5.7 like QtVirtualKeyboard, QtCharts etc.. From what you say I gather that you won't use these modules, so you can freely go with LGPL and keep your code private if you wish to.

    2: Must provide a relinking mechanism for Qt libraries
    How do I provide a "mechanism"? I would assume that it would be enough to link dynamically to the QT librarys. But that would ommit static linking (which seems is only allowed with commercial license anyway). But I understand the "obligation" in the way that I need to provide a possibility for the user to define the name of the library that is getting linked.

    Linking dynamically is enough.

    Don't worry about the mechanism. It is only important if you link statically (yes it is possible to link statically and use LGPL, but it is quite complicated stuff - hence they use "mechanism" word here).

    3: Must make a Qt source code copy available for customers
    As the FAQ states it is not sufficient enough to link to the QT download page. But the download of QT is ~400MB unzipped. But this includes the QTCreator editor. How to ship/provide the Source Code in a reasonable size?

    You can download and store single Qt submodules from here. Remember, you are only obliged to provide that to your clients and on demand. You don't need to ship Qt source code together with your application, you don't need to provide any open links on the Internet etc. And in reality, in 99% of cases, nobody will ever ask you for Qt libs.

    If your app is open source as well - don't worry about this at all. Your users will manage it by themselves.

    Alternatively you need to provide a written offer with instructions on how to get the source code. Please also note that this has to be under your control, so a link to the source code provided by the Qt Project or Qt Company is not sufficient.
    What needs to be under my control? The source code I need to provide or the instructions how to get it.
    Is it enough to write: "How to get QT: Google QT download -> Go to download page -> download"?

    That is due to a quirk in the license. It states that you are responsible for the LGPL libs you use. So in the - extremely unlikely - event that Qt company bankrupts, KDE foundation is nuked by some evil empire and the Internet collapses, you still need to provide your users with Qt. So, the easiest solution is to:

    • release your app
    • download the Qt sources you used to build that app, store them on some hard drive you have
    • forget about it all until the world ends or some lonely soul asks you to provide Qt sources ;-)

    4: Must make “open” consumer devices
    Oh common, what the ... What are they talking about? I don't want to create a dishwasher, I want to write a little program running on windows.

    Then just ignore that point... this is for embedded devices. If you don't target them, don't worry about this requirement.

    5: The LGPL allows you to keep the source code of your application private as long as it is “work that uses” the library. Dynamic linking is usually recommended here.
    I thought it is not allowed to use static linking in LGPL distribution? How would I keep my code private without dynamic linking? If I would link statically, I would need to provide my source so the user can recompile the code, as re-linking with QT library must be possible.

    As mentioned above, there is a way to link statically and keep sources private. You need to distribute object files (.o or .obj) and then users can relink (statically) themselves.

    But just linking dynamically is the easiest option, so it is recommended.

    6: The user of your application has to be able to re-link your application against a different or modified version of the Qt library.
    Got that above already.
    With LGPLv3 it is also explicitly stated that the user needs to be able to run the re-linked binary on it’s intended target device.
    Does it mean if "I" target Windows 64Bit and the QT librarys got changed by the user, the program still needs to run on Windows 64Bit? Still the user could change to library to what ever. How should I be able to ensure proper functionality of my program?

    The libs you will use (again, from your brief description) are licensed under GPLv2, which does not have this requirement. Of course you don't have control over user's custom Qt build. If it fails it is their fault.

    What this requirement ensures is that you are not allowed to secretly "lock" the libraries to your own, for example by checking the SHA checksum of the Qt .dll and refusing to start the application when it is different than one you shipped with the product.

    It may sound like a whimsical and stupid point, but sadly, people will find every opportunity to abuse and circumvent licenses, so they are written so that all - even weird and stupid - cases are covered.

    I'm slow-witted, but these terms seem not clear at all.

    Don't worry, that is lawyer's language, everybody has trouble understanding it ;-)

    Hope it helps :-) I'm not a lawyer of course, so I may be wrong about the details, of course.


  • Moderators

    Hi, and welcome to the forum.

    I'm not a lawyer.

    • GPL
      If you use stuff that's under the GPL then your whole product automatically becomes GPL'd as well. If you you give a customer a copy of your program you must ensure that she can inspect and modify it. Easiest way to comply in this case is not to provide any binaries but only give your costumers your own source code together with advice what else they need (e.g. Qt) and how to build everything.

    • LGPL
      If you don't use anything under GPL but stuff under LGPL then you can freely choose the license for your whole product but the LGPL parts remain LGPL'd. Your costumers need to be able to inspect and modify the LGPL'd parts of your product and use those modified parts together with your project. Easiest way to comply is not to provide any binaries but only give your costumers your own source code (under whatever license you wish) together with advice what else they need (e.g. Qt) and howto build everything.
      If you don't want other people to be able to read your source code then you have to provide your customers with precompiled binaries of your software. Easiest way to comply with the LGPL is to dynamically link your own stuff to the LGPL'd parts and give your customers the sources of the LGPL'd parts and all the makefiles etc that are needed to modify the LGPL'd parts and use them together with the binaries of your own stuff.

    • Proprietary
      If you can't comply with GPL or LGPL you can get a proprietary licence for Qt.



  • @sierdzio
    A couple of things in what you wrote:

    • You talk about "download the Qt sources you used to build that app". But (like most people using Qt?) I don't download any sources of it, I just take the distributed compiled libraries. I have no idea which bits of source that may or may not use?

    • You say "The libs you will use (again, from your brief description) are licensed under GPLv2". What is licensed under "GPLv2" (as opposed to "LGPLv3"), and what bit of what OP says implies this?



  • Wow, thanks for the fast and indepth replys. It's so a shame we need to waste time with such stuff.

    Ok, so I just write my program, make an About page and say its uses QT and is LGPL, pack in LGPL license and distribute it.

    @JNBarchan said in Distribution with LGPL:

    @sierdzio
    A couple of things in what you wrote:

    • You talk about "download the Qt sources you used to build that app". But (like most people using Qt?) I don't download any sources of it, I just take the distributed compiled libraries. I have no idea which bits of source that may or may not use?

    Yah, good point. Just tried to download the sources for windows, its 2GB. Am I supposed to look though that and find the right files? And what are the right files?


  • Moderators

    @JNBarchan said in Distribution with LGPL:

    @sierdzio
    A couple of things in what you wrote:

    • You talk about "download the Qt sources you used to build that app". But (like most people using Qt?) I don't download any sources of it, I just take the distributed compiled libraries. I have no idea which bits of source that may or may not use?

    If you built your app using Qt 5.6.1, then download 5.6.1. If you used 5.9.3, download 5.9.3. That's it.

    If, like OP, you want to download not whole Qt source code but only the modules you are using, then you know which bits of source you used: see the modules you are including in your qmake file. For example:

    QT = core gui network widgets
    

    You need to download QtBase (which contains QtCore, QtGui and QtNetwork modules), and QtWidgets. Due to historical reasons, the module names and source module names are not 1:1 match, but if in doubt, you can always check deeper or ask here on forum.

    • You say "The libs you will use (again, from your brief description) are licensed under GPLv2". What is licensed under "GPLv2" (as opposed to "LGPLv3"), and what bit of what OP says implies this?

    Oh, I shortened it a bit too much. Here's what I meant: before Qt 5.7, Qt (whole) was available under GPLv2 and LGPLv2.1. So all these modules can choose between LGPL and GPL. Now, since OP asked about specifics of GPLv3, I replied that these old modules are available under v2, so they do not need to worry about that v3 requirement.

    And just to put it all in writing: these "old" modules are currently available under GPLv2, GPLv3, LGPLv2.1, LGPLv3. And commercial. Plus Qt LGPL exception (which allows you not to share Qt modifications if they were very small).

    and what bit of what OP says implies this?

    "I want to build a simple application with some textboxes and dropdowns" I assume QtWidgets here. But actually, QtQuick is also available since loooooong before Qt 5.7, so it applies to it as well.


  • Moderators

    @Rumbleball said in Distribution with LGPL:

    Wow, thanks for the fast and indepth replys. It's so a shame we need to waste time with such stuff.

    Ok, so I just write my program, make an About page and say its uses QT and is LGPL, pack in LGPL license and distribute it.

    @JNBarchan said in Distribution with LGPL:

    @sierdzio
    A couple of things in what you wrote:

    • You talk about "download the Qt sources you used to build that app". But (like most people using Qt?) I don't download any sources of it, I just take the distributed compiled libraries. I have no idea which bits of source that may or may not use?

    Yah, good point. Just tried to download the sources for windows, its 2GB. Am I supposed to look though that and find the right files? And what are the right files?

    You don't have to do all the work for your users. If they want to compile their own Qt and substitute the libs you used, it's their job to compile Qt on their own. You just give them the source code if they want it. At least that's how I understand it.

    How is it 2GB? http://download.qt.io/archive/qt/5.9/5.9.2/single/ the .zip is 626 MB, and that includes all modules.



  • OP is lucky, and can (almost certainly) use LGPL.
    I am unlucky (being an Arsenal supporter), and will have to use GPL.
    I will return to this issue at a later date, when my head doesn't hurt so much....



  • @sierdzio said in Distribution with LGPL:

    How is it 2GB? http://download.qt.io/archive/qt/5.9/5.9.2/single/ the .zip is 626 MB, and that includes all modules.

    The 2GB download in the link you provided http://download.qt.io/archive/qt/5.9/5.9.2/
    The crypting filenames are not much of a help for a newcommer on what those packages provide.


  • Moderators

    That's why I suggest asking in the forum if in doubt. I'm not sure if there is any wiki page explaining which archive is for what.

    In short:

    • Root directory contains offline Qt installers
    • "Single" directory contains whole Qt source code (all modules) combined. Zip is for Windows, tarball for Unix, Linux, Mac
    • "Submodules" directory is for code of single Qt repositories. Unfortunately, they do not represent Qt modules directly. As said, that is due to historical reasons

    Lastly, Qt code can also be cloned from git, of course. Then checking out a given Qt version is just a matter of checking out a tag with version name.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.