Forum > QT

Stand Alone Qt5/6 library releases.


I know this has been discussed before but the current situation really is really making it a real problem.

Qt5 and Qt6 have made huge strides in recent months, for many people its preferable to gtk2 on Linux.  But end users are very, very uncomfortable when it comes to installing a third (or fourth) party library when they download and install our applications.

Further, because of the lag time between release of a product and its appearance in the distros it will be a much long time before we can assume even half our end users will have access to an appropriate library. 18 months in the case of Debian and all its spin offs.

The problem lies with linking libqt[5,6]Pas release to the corresponding Lazarus release.  The Qt libraries have been ready to go for some months now, we see no sign of a Lazarus release. I am not sure, maybe the libraries were finalized before Debian Bookworm was released. But distros will not take software until its formally released !

zeljko, can we please spin libqt5/6pas off as a standalone library ?  Get it out there now ?  If it goes into Debian Trixie soon, it will be picked up by, eg, Ubuntu 24.04 which is a long term release. If we miss that, it would be sad indeed !

Move it into a new tree under, give it your blessing and Alexey and I will start harrassing the distros.


Yes, I agree that qt5 and qt6 should be moved from lazarus tree, I'll discuss it with other developers first.

Bad Sector:
One alternative - and a bit hacky but it seems to work - is to link libQt6Pas statically. You need to modify the file to make it build a static library and then modify the qt62.pas file in lcl/interfaces/qt6 so that it links with the static library (you need to install it system-wide so the linker can find it).

Here is an image showing this in practice:

Notice the required libraries in the top left terminal, it links against the Qt6 (and C++) libraries directly instead of via Qt6Pas. The modifications to qt62.pas are shown in the Lazarus source editor and the modification to in the bottom left terminal.

I just tried and haven't done any excessive testing, however i did something similar to link statically against Gtk1 itself (so that the binary only requires X11 and can run even if Gtk1 isn't installed - which is the case in pretty much all distros out there :-P) and tried it in a bunch of systems and worked, so i'd expect this to work too.

Obviously this is for binary downloads and wont work with source releases as it requires modifying the LCL interface code.


[0] Message Index

Go to full version