licensing
How does Qt accomplish both GPL and commercial licensing?
<p>In Qt there are some modules which are licensed with GPL or commercial license: <a href="https://doc.qt.io/qt-5/qtmodules.html#gpl-licensed-addons" rel="nofollow noreferrer">https://doc.qt.io/qt-5/qtmodules.html#gpl-licensed-addons</a></p>
<p>How I read this: I can use those modules in SW that I sell and I don't have to publish the source code, if I buy the commercial license (because there's the word &quot;or&quot; -&gt; I can pick either GPL <em>or</em> commercial license).</p>
<p>If I'm right so far, my next question is: How do they accomplish this? In case they use the GPL licensed code in their libraries, GPL says that they should publish the source code and so should I, right? So I guess they must have coded their own versions of those libraries and sell those under commercial license?</p>
<p>Please explain this like to a 5-year old.</p>

<h2>Their code, their rules</h2>
<p>A copyright holder is free to offer their work under none, one or many licences. They can, at the same time, use their own work however they see fit without regard to the licences they have given/sold to others (except, they can only give one person an exclusive licence).</p>
<p>As an analogy, let’s say I own a fleet of cars. I can drive my cars anytime I want. I can let Jim drive my cars anytime he wants for free. I can let Mary drive a specific car on Thursdays and only within 10km of the depot. I can let Joe drive my cars providing he pays me $50 a day. And I’m not going to let Fred drive them at all because Fred’s a jerk.</p>
<p>Each of those is a different licence.</p>

<p>To do that, Qt must either be the sole copyright holder, or they must have the consent of all other copyright holders. In both cases, as the copyright holder or with agreement of all copyright holders, they can do whatever they like. For example license their software under two different licenses.</p>
<p>It has an effect on software development: If I voluntarily created an improvement to their software, and I published it under the GPL license (which I have the right to do), Qt could not take that improvement and incorporate it into their software and publish it under their commercial license without my agreement to the second license. So what would happen is that either my improvements are not included, or if Qt thinks my improvements are worthwhile to have, they could offer me cash to agree to publication using their commercial license. Or to hand over my copyright, against cash.</p>
