Recent

Author Topic: GTK or QT?  (Read 12268 times)

Leledumbo

  • Hero Member
  • *****
  • Posts: 8744
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: GTK or QT?
« Reply #15 on: September 17, 2021, 01:55:42 pm »
When making cross platform apps, I usually prefer each platform's native interface, if they have one. If they have two, well, provide two :P
As long as you adhere to LCL Autosize / Layout, meaning you're not doing any absolute sizing / layouting, any backend should show similarly well laid out controls.

bitman

  • Newbie
  • Posts: 5
Re: GTK or QT?
« Reply #16 on: September 18, 2021, 10:57:58 pm »
A quick update...

I ultimately had to go with GTK, because of this:

https://forum.lazarus.freepascal.org/index.php/topic,48275.15.html

https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/36483

The IDE code editor is unusable in certain versions of QT. Fonts are a real mess, making impossible to do any work; nothing else mattered. Supposedly there is some patch, but didn't know exactly how to apply it, while the problem is absent in GTK... so, there's that  :sighs:

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: GTK or QT?
« Reply #17 on: September 19, 2021, 08:23:36 am »
hello,
GTK2 is now EOL and  newer  GTK linux distribution versions use GTK3 by default.
On Ubuntu 20.04 LTS i have a project for image processing. When i use gtk2 as LCL widgetset i have some error messages at run time :
Quote
Gtk-Message: 13:32:49.621: Failed to load module "canberra-gtk-module"
GLib-GObject-WARNING **: 13:32:51.031: ../../../gobject/gsignal.c:1282: no emission of signal "key-release-event" to stop for instance '0x2628350'
Read this topic: GTK2 is now EOL :(   

Friendly, J.P
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: GTK or QT?
« Reply #18 on: September 21, 2021, 12:14:57 pm »
I ultimately had to go with GTK, because of this:
(a font problem in the IDE)

I suspect that you believe you have to use the same widget set in the ide that your application uses ?   That is not the case, absolutely no reason why you cannot have a GTK2 based IDE and produce (and test, debug, everything) a QT5 app.  Mixing does not make any part of the process any harder once you have selected QT5 Widgetset in ProjectOptions.  Normally, for a cross platform app, you will define in your project a mode for GTK2, QT5, Windows, MacOS, perhaps Raspberry Pi and maybe GTK3 (?).

Indeed, that same GTK2 IDE (as long as you have setup FPC cross compilers) will also make Windows and Raspberry Pi binaries. But no special cross compile setup needed to make QT5, it just works.

Davo
 
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • Former Turbo Pascal 3 user
Re: GTK or QT?
« Reply #19 on: September 21, 2021, 02:41:42 pm »
hello,
GTK2 is now EOL and  newer  GTK linux distribution versions use GTK3 by default.
On Ubuntu 20.04 LTS i have a project for image processing. When i use gtk2 as LCL widgetset i have some error messages at run time :
Quote
Gtk-Message: 13:32:49.621: Failed to load module "canberra-gtk-module"
GLib-GObject-WARNING **: 13:32:51.031: ../../../gobject/gsignal.c:1282: no emission of signal "key-release-event" to stop for instance '0x2628350'
Read this topic: GTK2 is now EOL :(   

Friendly, J.P

gtk3 is not even on the roadmap yet:

https://wiki.freepascal.org/Roadmap

It would be great if we could see what progress has been made, and it might inspire some bounties or donations.

Cheers
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

Zvoni

  • Hero Member
  • *****
  • Posts: 2300
Re: GTK or QT?
« Reply #20 on: September 21, 2021, 03:45:54 pm »
gtk3 is not even on the roadmap yet:

https://wiki.freepascal.org/Roadmap

It would be great if we could see what progress has been made, and it might inspire some bounties or donations.

Cheers
https://wiki.freepascal.org/GTK3_Interface
Quote
Current bindings (12.01.2021) are 3.8.6 and there's a plan to move it to 3.22 
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

af0815

  • Hero Member
  • *****
  • Posts: 1284
Re: GTK or QT?
« Reply #21 on: September 21, 2021, 04:58:45 pm »
Is there any information about the state of gtk3 ?


Edit: I should ask for 'actual' state of gtk3.
« Last Edit: September 22, 2021, 07:06:57 am by af0815 »
regards
Andreas

prof7bit

  • Full Member
  • ***
  • Posts: 161
Re: GTK or QT?
« Reply #22 on: October 02, 2021, 04:53:17 pm »
Fortunately with Lazarus you can defer this decision indefinitely and just use whatever seems best at the moment ;-)

I personally have used  GTK2 on Linux for a long time, until I recently upgraded some of my *buntu boxes to the 21.04 release and found that they are now very aggressively phasing out GTK2 support, removing theme support for GTK2, etc.

Fortunately the Qt5 widgetset has become very good in the meantime, I have upgraded from Lazarus 2.0 to the 2.2 branch earlier this year and at the same time I began gradually switching all my old projects over to Qt5. This is causing ZERO problems so far, exactly as one would expect with such an excellent versatile Toolkit that Lazarus is.
« Last Edit: October 02, 2021, 04:55:06 pm by prof7bit »

funlw65

  • Full Member
  • ***
  • Posts: 148
    • Visual Pin Configurator for Nucleo 64pin boards
Re: GTK or QT?
« Reply #23 on: November 07, 2021, 10:11:04 am »
Qt5 license could change anytime?

Guys, I think it will come a day when Lazarus will have to decide for it's own pascal native widgetset, with a certain look and two main themes (dark and light). Going all the way with Qt5 won't be secure.  But yes, today Qt5 is the recommended choice.
FreePascal 3.2.2, C 10.2.1, D 1.24 under Linux(init,musl,glibc), DragonflyBSD, NetBSD
gui: gtk2, qt5, raylib4.x+raygui3.x, nanovg 
tui: freevision, tvision2, termbox2+widgets, finalcut
db: typhoon-1.11...

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4458
  • I like bugs.
Re: GTK or QT?
« Reply #24 on: November 07, 2021, 10:55:11 am »
Qt5 license could change anytime?
Why would it? This same fear mongering has continued since the last millenium.

Quote
Guys, I think it will come a day when Lazarus will have to decide for it's own pascal native widgetset, with a certain look and two main themes (dark and light). Going all the way with Qt5 won't be secure.  But yes, today Qt5 is the recommended choice.
There already is CustomDrawn widgetset and also bindings for the fpGUI library.
Both are alpha state. Felipe has other priorities and does not maintain CustomDrawn any more.
Contributions are welcome!
What means "Going all the way with Qt5"? The idea is to have many widgetsets, not only one.

Information about the 'actual' state of LCL-GTK3 bindings can be obtained by testing it. Patches / merge requests to fix bugs are welcome, too.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: GTK or QT?
« Reply #25 on: November 07, 2021, 11:09:28 am »
Going all the way with Qt5 won't be secure.

But there is just about no way you can "Go all the way with Qt5" even if you wanted to.  Select GTK2 (or some time in the future GTK3, maybe even GTK4) with a couple of clicks. Its an each way bet on a three horse race !

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

 

TinyPortal © 2005-2018