* * *

Author Topic: How to use Qt5 with Lazarus-IDE 1.8?  (Read 1964 times)

İbrahim

  • New member
  • *
  • Posts: 11
How to use Qt5 with Lazarus-IDE 1.8?
« on: December 20, 2017, 02:17:08 pm »
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

  • Full Member
  • ***
  • Posts: 119
  • Pascal is my life.
    • Homepage
Re: How to use Qt5 with Lazarus-IDE 1.8?
« Reply #1 on: December 20, 2017, 03:31:40 pm »
Hi,

Projects -> Project Options -> Additions & Overrides -> Set "Value qt5"
« Last Edit: December 20, 2017, 03:38:21 pm by turrican »

Handoko

  • Hero Member
  • *****
  • Posts: 2254
  • My goal: build my own game engine using Lazarus
Re: How to use Qt5 with Lazarus-IDE 1.8?
« Reply #2 on: December 20, 2017, 03:41:54 pm »
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_interfaces

You may need to search the web for how to do Qt5 binding.

OH1KH

  • New member
  • *
  • Posts: 17
Re: How to use Qt5 with Lazarus-IDE 1.8?
« Reply #3 on: March 21, 2018, 06:58:14 pm »
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?


--
Saku

Handoko

  • Hero Member
  • *****
  • Posts: 2254
  • My goal: build my own game engine using Lazarus
Re: How to use Qt5 with Lazarus-IDE 1.8?
« Reply #4 on: March 21, 2018, 07:32:25 pm »
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

But "as per wiki" says nothing valuable to me. A'm I looking for wrong wiki?

Which wiki you're reading?
« Last Edit: March 21, 2018, 07:37:54 pm by Handoko »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3366
  • I like bugs.
Re: How to use Qt5 with Lazarus-IDE 1.8?
« Reply #5 on: March 21, 2018, 08:01:32 pm »
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)
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

  • Hero Member
  • *****
  • Posts: 2254
  • My goal: build my own game engine using Lazarus
Re: How to use Qt5 with Lazarus-IDE 1.8?
« Reply #6 on: March 21, 2018, 08:08:11 pm »
The lib and source can be found and downloaded on the link I gave.

Blaazen

  • Hero Member
  • *****
  • Posts: 2531
  • POKE 54296,15
    • Eye-Candy Controls
Re: How to use Qt5 with Lazarus-IDE 1.8?
« Reply #7 on: March 21, 2018, 08:08:48 pm »
My Chakra Linux has it in repos, package qt5pas version 2.6.r57057-1  :)
Lazarus 1.9.0 r57500 FPC 3.0.4 x86_64-linux-qt Chakra, Qt 4.8.7, Plasma 5.11.4
Lazarus 1.8.0 r56594 FPC 3.0.4 i386-win32-win32/win64 Wine 3.2

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3366
  • I like bugs.
Re: How to use Qt5 with Lazarus-IDE 1.8?
« Reply #8 on: March 22, 2018, 01:16:25 am »
Ok, my information was outdated then.

OH1KH

  • New member
  • *
  • Posts: 17
Re: How to use Qt5 with Lazarus-IDE 1.8?
« Reply #9 on: March 22, 2018, 07:31:56 am »
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.
--
Saku

Handoko

  • Hero Member
  • *****
  • Posts: 2254
  • My goal: build my own game engine using Lazarus
Re: How to use Qt5 with Lazarus-IDE 1.8?
« Reply #10 on: March 22, 2018, 08:12:37 am »
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

  • New member
  • *
  • Posts: 17
Re: How to use Qt5 with Lazarus-IDE 1.8? [solved]
« Reply #11 on: March 22, 2018, 10:47:28 am »
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!  8)

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.
--
Saku

alanphys

  • New member
  • *
  • Posts: 39
Re: How to use Qt5 with Lazarus-IDE 1.8?
« Reply #12 on: March 22, 2018, 11:19:05 am »
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
Alanphys

Handoko

  • Hero Member
  • *****
  • Posts: 2254
  • My goal: build my own game engine using Lazarus
Re: How to use Qt5 with Lazarus-IDE 1.8?
« Reply #13 on: March 22, 2018, 11:37:49 am »
@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

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus