How to use Qt5 with Lazarus-IDE 1.8? lazarus / 13-General ---------------------------------------------------------------------- İbrahim · 2017-12-20 13:17 Hi. I downloaded fpc-3.0.4, fpc-src and Lazarus-IDE 1.8. I installed Lazarus and when I started Lazarus-IDE, I see Lazarus is using x86_64-linux-gtk2. I want to use Qt5 for Lazarus interface. How can I do it? Thanks. ---------------------------------------------------------------------- turrican · 2017-12-20 14:31 Hi, Projects -> Project Options -> Additions & Overrides -> Set "Value qt5" ---------------------------------------------------------------------- Handoko · 2017-12-20 14:41 What turrican said is for changing the Project's widgetset. For changing the IDE's widgetset you need to change the setting here: Lazarus main menu > Tools > Configure "Build Lazarus" For Qt5, you may fail on first attempt. Because you need to prepare the binding as mentioned here: http://wiki.lazarus.freepascal.org/Roadmap#General_status_of_LCL_inter faces You may need to search the web for how to do Qt5 binding. ---------------------------------------------------------------------- OH1KH · 2018-03-21 17:58 HI ! Could someone give detailed instructions for Fedora26 and QT5 usage, please? I selected  Projects -> Project Options -> Additions & Overrides -> Set "Value qt5" and compile stops to linking error. Assume it is because of bindings. Wiki says: Bindings sources are located in lcl/interfaces/qt5/cbindings , to build it just follow README.txt. Found them from /usr/lib64/lazarus/lcl/interfaces/qt5/ But readme there says: To use them you also need to download and install at appropriate place the libQt5Pas.so (linux) "dnf provides */libQt5Pas.so" does not found anything, Same with googling. No file or library named like that within Fedora releases. Fedora is known using bit different naming, but could not guess anything that fits. Closest hit with google was found  from this forum: Hi I've recently installed Fedora 26 with KDE 5 and QT 5.6 on a new system. I managed to build and install libQt5Pas.so as per the wiki and rebuild Lazarus for QT5. But "as per wiki" says nothing valuable to me. A'm I looking for wrong wiki? ---------------------------------------------------------------------- Handoko · 2018-03-21 18:32 I don't know much about Qt, but I found some info that maybe can help. The README.txt on my Lazarus 1.8.0 Ubuntu is found at: /usr/share/lazarus/1.8.0/lcl/interfaces/qt And this is what it says: These are the sources of the LCL qt interface. They only work with qt4 or superior. To use them you also need to download and install at appropriate place the libQt4Pas.so (linux) or Qt4Pas.dll (ms windows) or Qt4Pas.framework (Darwin). For more information see: http://wiki.lazarus.freepascal.org/index.php/Qt_Interface And the wiki page says: ... The first thing to do is go to the official website of the bindings and download the binary Qt bindings. ... Note: The link of the "official website" is http://users.pandora.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html Quote from: OH1KH on March 21, 2018, 06:58:14 pmBut "as per wiki" says nothing valuable to me. A'm I looking for wrong wiki? Which wiki you're reading? ---------------------------------------------------------------------- JuhaManninen · 2018-03-21 19:01 Quote from: OH1KH on March 21, 2018, 06:58:14 pmAssume it is because of bindings. Wiki says: Bindings sources are located in lcl/interfaces/qt5/cbindings , to build it just follow README.txt. Found them from /usr/lib64/lazarus/lcl/interfaces/qt5/ But readme there says: To use them you also need to download and install at appropriate place the libQt5Pas.so (linux) I don't think you can download it from anywhere now. You must build it yourself. Zeljko, the author, should clarify the documentation. I don't remember the details now. In any case with QT5 you should use Lazarus trunk. The bindings are being improved. ---------------------------------------------------------------------- Handoko · 2018-03-21 19:08 The lib and source can be found and downloaded on the link I gave. ---------------------------------------------------------------------- Blaazen · 2018-03-21 19:08 My Chakra Linux has it in repos, package qt5pas version 2.6.r57057-1 ---------------------------------------------------------------------- JuhaManninen · 2018-03-22 00:16 Ok, my information was outdated then. ---------------------------------------------------------------------- OH1KH · 2018-03-22 06:31 My dear friends! Ubuntu and Chakra linuxes are NOT Fedora. So the original question is still unanswered. I can compile library if just get link to sources but Lazarus wiki(s qt and qt5) or readme.txt under lcl/.... do not state the place. Easier would be installation from package but it seems not be done for Fedora. ---------------------------------------------------------------------- Handoko · 2018-03-22 07:12 Again, I ask you which wiki page did you read? See the image below. The wiki page really has the link for downloading the lib and source. ---------------------------------------------------------------------- OH1KH · 2018-03-22 09:47 HI ! That link leads to site where everything is quite old. But I think I am able to resolve this. Compile of bindings is now running. Seems to take some time. Problem is this(quete my first message): -------- Assume it is because of bindings. Wiki says: Bindings sources are located in lcl/interfaces/qt5/cbindings , to build it just follow README.txt. Found them from /usr/lib64/lazarus/lcl/interfaces/qt5/ ----------- Yep found them and there is readme.txt that says download libqt5pas.so But now I spent more time to study the folder structure and there is another readme.txt under /cbindings. Actually just what the wiki says!  And that readme has totally different content !! Why, why, why they cannot be equal! Or at least the higer level readme should say that if you can not find ready made libqt5pas.so dive into subdir cbindings and see readme.txt there. Now when you navigate to directory structure like this and you get into qt5 and find readme.txt  you assume that is the one that tells all, but nope !! My fault not to search every subdir, or read a little better the wiki ! But nice to see that no one else could not advise me too dive into subdir cbindings and look a bit more carefully !! And another addition to cbindings/readme.txt would be that mentioned "qmake" command is "qmake-qt5" when using Fedora releases. While writing this "make" finished and then I made "make install". Next step was to open my program in lazatus. QT5 is there selected allready and make buld. Now it went through without linking error. Other quesiton is how it works, but that is another subject. So, for use QT5 with program (in Fedora26 x86_64): -goto project properties and select LCL widgetset "qt5" -navigate to /lib64/lazarus/lcl/interfaces/qt5/cbindings/ (note ordinary user does not have write rights there, use sudo in front of commands, or copy directory cbindings (with subdirs) to user's folders. Then you need sudo just for "make install")  -issue command: qmake-qt5 -query -issue command: qmake-qt5 -issue command: make    (takes quite long time, just wait...) -issue command :make install Go back to Lazarus and issue "biuld". After that start debugging your previously gtk written program. Maybe later recompile lazarus to use qt5. ---------------------------------------------------------------------- alanphys · 2018-03-22 10:19 Hi Sorry I'm only getting to this now. For Fedora you need to install qt5-creator and qt5-devel. This will give you qmake-qt5. For some reason my Fedora had qmake-qt4 installed by default. This will not work. Also do not run qmake-qt5 as su or sudo it will recompile your system qt5 with potentially disastrous results. Apart from this it is a matter of following the readme file in the cbindings folder. There is a problem exiting programs in the debugger. An exception is generated. We are not sure of the cause as it is difficult to track as the debugger has already shut down at that stage. Regards ---------------------------------------------------------------------- Handoko · 2018-03-22 10:37 @OH1KH, @alanphys If you managed to make it works, please consider to update the wiki page so others can benefit from your experience. If you found the information in the documentation/wiki is outdated or incorrect, please improve them or at least submit a report to the bug tracker forum: http://bugs.freepascal.org/view_all_bug_page.php ---------------------------------------------------------------------- M+AUDIO · 2021-01-05 21:35 I encountered this same problem for compiling a project for x86_64 linux with Qt5 widgetset. From GTK2 Lazarus. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Warning: linker: /usr/bin/ld: cannot find -lQt5Pasbithesabgui.lpr(37,1) Error: Error while linkingAnd this (old) thread was in google results. So I just wanted to add that with Fedora 33 and latest Lazarus trunk to this date (r64335) it only took me to install these packages using Terminal Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i sudo dnf install qt5pas qt5pas-devel + selecting Qt5 widgetset inside additional and overrides inside project options. And it just worked! No extra steps. And since the compiled app requires the library file libQt5Pas.so.1 at runtime, you need to have qt5pas in your destination system (user system) as well. so qt5pas is somehow a required runtime library. The equivalent in Xubuntu 20.10 is libqt5pas1 (with that 1) as the runtime library and libqt5pas-dev for compilation and linking library. PS Glad to see Qt5 is so stable compared to GTK3. Congratulation to the Devs. ---------------------------------------------------------------------- dbannon · 2021-01-05 23:12 I keep some recently (or so) libqt5pas1 packages at https://github.com/davidbannon/libqt5pas/releases However, I have not tested then against such an old version of Fedora or Lazarus.   Quite a lot has improved in Lazarus Qt5 since then. And I suspect Fedora 26 would have a quite old version of Qt5, perhaps too old. Davo