Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt open source lgplv3



  • I have a short question, can I sell an app created With Qt Creator and c++ on windows and for windows in for example the Microsoft store when I used Qt OpenSource LGPLv3 tools?


  • Moderators

    You can sell stuff created with LGPL (and GPL, too), no problem there.

    You have to fulfill license requirements, though:

    • inform users that LGPL libraries are used
    • provide license text to them
    • provide a way to swap LGPL libraries (this point will conflict with Microsoft Store distribution!)
    • etc.


  • @sierdzio Sorry I forgot to add if i want to keep my source code closed/private. So if I only use Qt and no other library do I have the option to sell apps created with Qt OpenSource LGPLv3?



  • @pavll Yes but providing the option to satisfy requirement to link your binary against different versions of LGPL (@sierdzio used word "swapping") libraries used might be a bit tricky. I believe I saw an extension in Qt Marketplace that provides for satisfaction of this requirement (and it was not expensive) but never used it.



  • @artwaw

    Isn't it just a "usual" dynamic build, where the used Qt libs can be replaced by any "customer"?!

    Static linking is only allowed if you buy a Qt license.
    [Edit: It is allowed but way more complicated]

    @pavll
    With LGPL you don't have to share YOUR code, but allow to replace the linked Qt version with any other.



  • @Pl45m4 I did not dig since it is outside my area of interest, have a look yourself https://marketplace.qt.io/collections/premium/products/qt-lgpl-app-template


  • Lifetime Qt Champion

    Warning: I am not a lawyer

    @Pl45m4 said in Qt open source lgplv3:

    Static linking is only allowed if you buy a Qt license.

    That's wrong however, in the case of a static build you have to provide the build artefacts of your application so that your users may link to their version of Qt. This is way more complicated and cumbersome than use dynamic builds as you have to keep all build artefacts of all the versions you released of your software.


  • Moderators

    @pavll said in Qt open source lgplv3:

    @sierdzio Sorry I forgot to add if i want to keep my source code closed/private. So if I only use Qt and no other library do I have the option to sell apps created with Qt OpenSource LGPLv3?

    Yes, you can keep your code secret. And yes you can sell it.



  • @SGaist said in Qt open source lgplv3:

    That's wrong however, in the case of a static build you have to provide the build artefacts of your application so that your users may link to their version of Qt. This is way more complicated and cumbersome than use dynamic builds as you have to keep all build artefacts of all the versions you released of your software.

    Ah ok, good to know. Had in mind that it's not allowed.
    So nobody does it and says that you should avoid it, because it's complicated and probably can lead to other issues.



  • Tank's for all the replies but, I think all the linking stuff and such is a bit too much for me. Then I will have to revert to other GUI frameworks for my project to avoid any conflict with qt licenses and all the bad stuff.


  • Lifetime Qt Champion

    You do realise that this is nothing Qt specific ? LGPL is a license used by many other libraries/framework.
    Just use the classic dynamic linking and the information requested (there's an aboutQt slot in QGuiApplication just for that) and you are good to go.



  • @SGaist said in Qt open source lgplv3:

    the information requested (there's an aboutQt slot in QGuiApplication

    You have to add this static AboutQt dialog to your app, when you want to release it?
    Asking for a friend :)


  • Moderators

    @Pl45m4 said in Qt open source lgplv3:

    @SGaist said in Qt open source lgplv3:

    the information requested (there's an aboutQt slot in QGuiApplication

    You have to add this static AboutQt dialog to your app, when you want to release it?

    It does not need to be that specific dialog, you can make your own. License states that you have to inform your users that Qt is being used under LGPL - exactly how you will do that is up to you.



  • Ok, thank you for all that replies. I'll take another try. But I still have one problem. Can any of you who have worked with Qt 5.* and Sqlite3 recommend me a Qt framework or something? (So something like in .NET the Entity Framework to not have to write every query myself and I need to be able to use it with the open-source LGPL v3 version even if I have my source code private and want to sell the program for a small price).



  • @pavll said in Qt open source lgplv3:

    Can any of you who have worked with Qt 5.* and Sqlite3 recommend me a Qt framework or something?

    QtSQL
    https://doc.qt.io/qt-5/qtsql-index.html

    Can be used as GPL/LGPL and provides a lot of helpful classes.

    not have to write every query myself

    Depends on what you want to do with your database / data. There are models/views where you dont have to write every query, but most of them work only with simple database structures. For anything else more complex, you have to create your own model/view.

    For example: QTableView + QSqlTableModel for single-table queries



  • Kk, thanks it has worked. I have now used QStyledItemDelegate to make the UI stylesheets work.
    Now I have a problem, when I select a row in my QTableView, the fields that I have filled with painter->drawText are not highlighted with a color in the background. However, with the QItemDelegate, this works. Can someone please help me, because I can not find a solution on the Internet.
    So either a possibility in the QItemDelegate to change the background color of a selected row or in the QStyledItemDelegate, that the fields I myself have filled via the delegate are also highlighted with color when selected. I believe with the QItemDelegate this works with the selecting since I work there with drawDisplay and drawFocus, these functions do not exist however with the QStyledItemDelegate unfortunately.

    QItemDelegate with drawDisplay() and drawFocus()
    QItemDelegate with drawDisplay() and drawFocus()

    QStyledItemDelegate with painter->drawText() and in .ui defined stylesheet for pseudo state selected and focus
    QStyledItemDelegate with painter->drawText() and in .ui defined stylesheet for pseudo state selected and focus


  • Lifetime Qt Champion

    Hi,

    It's up to you to test the state through the options you get in the paint function and draw the highlight rectangle.



  • Ok, and have you got a hint for me, how I can change the background color of the options.rect for the QItemDelegate where the standard is blue for selected and my stylesheet doesn't apply to this, so i have to do this in code.


  • Lifetime Qt Champion

    Well, use options.state to get the state and draw the rectangle accordingly. I am not sure what more information you need.


Log in to reply