Qt Binding for Go with Support Desktop, Mobile and Embeddable
github.comIt looks like this binding has a compile option where Qt itself is statically linked into the resulting executable. That gives this stack (Go+Qt) a very unique deployment story.
There are a lot of people (I'm looking at you, console home-brew community) who build all their little tools to go along with their projects as native GUIs, usually with C# + WinForms—not particularly because they have Windows-specific functionality, but more because they have at least some native functionality (so Electron is out) and C#+WinForms allows them to just make releases as a standalone .exe you can "just" download and run (at least on modern Windows), without needing to first install some external runtime.
This could be a good multiplatform alternative to the C#+WinForms stack, with all the same advantages. (The only con being that statically-linked Qt is pretty dang large.)
One thing to notice is that the open-sourced version of Qt is under GPL/LGPL, which means if you statically linked it into the executable, your application is then infected by (L)GPL.
Your application is "infected" if you use Qt without a commercial license, regardless of how you link it. It's a little harder (but still possible) to comply with the LGPL requirements when you statically link, but you are bound to those requirements either way.
Pretty sure having it dynamically linked is ok with the open source licence
Right, my point is that static linking is also okay with the LGPL, albeit slightly more difficult in terms of what you have to make available to end users.
I believe the parent post is correct and mechanism used to link effects the licence.
If you want to ship closed source code based on other people's hard work, then you should pay. In this case by getting a Qt commercial license.
Maybe, but keep in mind FreePascal/Lazarus has generally been supporting at least three of the platforms natively for several years. Complier, visual design, everything as expected from a delphi-like product. One of my FPC projects includes a desktop client with one window using multiple size controls and everything re-sizes near perfectly (know how to use panel controls). Recompiled on Linux and behavior was almost identical and no compile errors, according to expected behavior of a multi-platform toolchain. Funny enough, the client calls into a Golang rest backend I wrote. Nice, efficient solution that is easy to add additional devs to when needed.
Well, you can do this with C++ and Qt as well, but as a sibling commented, you are subjected to LGPL, so your app has to be under a compatible license, or provide a way to replace the Qt part (not sure if you were to provide one such mechanism while statically linking, like SDL2 does with its dynapi[1]).
[1]: https://hg.libsdl.org/SDL/file/default/docs/README-dynapi.md
Would you elaborate on the size of QT? I searched and found this link ([1]) that suggests when done right, the QT part is about 20MB.
I am asking this because sometimes people have different idea on what is accounted for being big.
[1]: https://stackoverflow.com/questions/25426895/qt-static-build...
Edit: grammar, link style
20MB is still large in this case; we're talking about people who frequently use as their download host a phpBB forum with a 5MB download limit, and who usually manage to achieve sizes far less than that (usually ~150KB) because it's literally just CRUD + parsing + filesystem access + some layout XML for the dynamically-linked GUI toolkit to chew on.
Think: "would software pirates write their little keygen GUIs in this?"
We ship a C++/Qt/Go application at $DAYJOB. The C++ and Go parts communicate by IPC so I would love to get down to a single language - Qt is the main reason why C++ is involved at all. A Go binding for Qt (Widgets) would seriously solve a lot of issues for us.
But this binding is LGPL, so
- we can't include it in a closed-source statically-linked Go application as-is;
- this binding plans to offer a commercial license but it isn't available yet;
- dynamic linking of a Go package (i.e. `-buildmode plugin`) is possible on Linux but not on Windows.
There's also the similar https://github.com/kitech/qt.go that works by LoadLibrary/dlsym'ing the Qt dll/so files, that has the same LGPL + no-commercial-alternative license.
This seems more like a feature than a bug. Shipping proprietary software to end-users is unethical. The license is working as designed.
Shipping proprietary software to end-users is unethical.
The user wants to use the software, the developer wants to provide it. I'm really struggling to see what is unethical about that.
Maybe what he means is that it's unethical to provide software to user without access to the source code, so in case the developer go out of business the user is left with software that the user couldn't update by themselves or someone else they hired.
Agreed
You can statically link LGPL.
This is much more basic but also considerably smaller.
I really wish libui had more support and momentum. It's literally the only sane cross platform UI project in existence. Everything else is not native (html5 guis), has no accessibility support (all the immediate mode ones), is ancient and ugly (wxwidgets), or is bloated (qt).
Is andlabs/ui still maintained? The last commit is from September 2018. Personally I love Qt since it's modular and I only use (and ship) the parts needed by the application.
It exists since 1995 and is still heavily maintained and modernized over time. I don't know any other GUI cross-platform library like that.
It's maintained, but by one dev in their spare time as near as I can tell. The parent libui project is in the midst of a refactoring.
We're considering using it for some simple client UI stuff and if we do we plan to make a donation.
This would take a lot of work to be powerful enough for a complex rich UI, but the world needs a basic cross platform UI lib for doing simple interfaces. It's absurd for things like file sync clients and VPN clients to spin up f'ing Electron to provide a UI, but they often do.
This is maintained. libui is the parent project.
I'm curious whether those bindings were written entirely by hand or perhaps some generator was used.
I was wondering the same thing. Seems like a massive undertaking by hand.
The license looks like a mess. They claim their own code is LGPL, but it looks like some of their code links to GPL modules (e.g. serialbus).
To my mind, this is entirely GPL and heaven help anyone who mistakes it for LGPL.
I've never seen Qt run in a web browser. It's weird but cool
That's WebAssembly there
I predict that we will see a renaissance of CORBA / COM MIDL in the form of WebAPI IDL as new IPC standard, bringing interoperability back to where it was around 1995.