GTK Or QT? - Lazarus Forum - Free Pascal
Lazarus
- Lazarus »
- Forum »
- Installation »
- Linux »
- GTK or QT?
Server maintenance
In the period from 21 December to 29 December, expect some downtime of the server due to maintenance- Free Pascal
- Website
- Downloads
- Wiki
- Documentation
- Bugtracker
- Mailing List
- Lazarus
- Website
- Downloads (Laz+FPC)
- Packages (OPM)
- FAQ
- Wiki
- Documentation (RTL/FCL/LCL)
- Bugtracker
- CCR Bugs
- GIT
- Mailing List
- Other languages
- Foundation
- Website
- Useful Wiki Links
- Project Roadmap
- Getting the Source
- Screenshots
- How to use the forum
Bookstore
Computer Math and Games in Pascal (preview) | |
Lazarus Handbook |
Search
Advanced searchRecent
- It feels like a big leaky... by Joanna from IRC [Today at 12:16:42 am]
- How to not wipe out the g... by jeremiah [December 22, 2024, 11:51:12 pm]
- problems with install of ... by Martin_fr [December 22, 2024, 09:28:23 pm]
- Algoritm for combination ... by Warfley [December 22, 2024, 09:12:44 pm]
- Run Parameters... handlin... by jollytall [December 22, 2024, 08:44:07 pm]
- Debug library by Martin_fr [December 22, 2024, 06:58:29 pm]
- [SOLVED] ListView: use of... by d7_2_laz [December 22, 2024, 05:00:15 pm]
- OPM, some issues by backprop [December 22, 2024, 03:59:50 pm]
- need to understand extent... by wp [December 22, 2024, 03:21:01 pm]
- FPC [main] beats CLANG, G... by DragoRosso [December 22, 2024, 02:07:56 pm]
- [SOLVED] IDE cannot be bu... by dsiders [December 22, 2024, 01:13:15 pm]
- Remove selection from PNG... by lainz [December 22, 2024, 11:16:43 am]
- Heavy flicker treeview w.... by d7_2_laz [December 22, 2024, 10:59:36 am]
- How to make odbc dsn entr... by paweld [December 22, 2024, 10:03:03 am]
- MQTT Client by cdbc [December 22, 2024, 09:35:09 am]
- Only one icon left in RTT... by egsuh [December 22, 2024, 09:06:35 am]
- It feels like a big leaky... by gary [December 22, 2024, 08:03:36 am]
- FPC's Binary Trees score ... by lainz [December 22, 2024, 07:36:23 am]
- N-Sided Flakes Updated fo... by Boleeman [December 22, 2024, 06:46:32 am]
- How to create another pro... by microguy [December 22, 2024, 02:06:38 am]
- Question about the use of... by Martin_fr [December 21, 2024, 09:47:56 pm]
- Lazarus and MSWord Automa... by mtrsoft [December 21, 2024, 09:07:59 pm]
- How to write reverse prox... by Packs [December 21, 2024, 07:32:12 pm]
- Drawing text with opacity... by zxandris [December 21, 2024, 05:58:43 pm]
- ZenGL +android + MacOS Co... by Seenkao [December 21, 2024, 05:46:08 pm]
Topic: GTK or QT? (Read 13896 times)
bitman
- Newbie
- Posts: 5
GTK or QT?
« on: September 04, 2021, 07:36:48 am » Hi everyone, I'm new to the forum and to Lazarus in general, though I've got some experience with Pascal and Delphi.I need to develop an app that needs to run on Linux, Windows and mac. I will be developing solely on Linux, and my plan is to just recompile on Windows and mac later on.I noticed that Lazarus on Linux works under the hood using either Gtk2 or QT. As a matter of fact, I think I installed the QT implementation in a Debian/KDE machine, while on another system with Solus/Budgie I believe I installed the Gtk version.So, my question is: which one should I use (GTK or QT) so that it gives me the less problems later on when I try to recompile for Windows and Mac ??? Or doesn't make any difference? Should I just install the version that merely corresponds to the linux desktop I'm using at the moment (Plasma or budgie)?Thanks in advance! LoggedMarkMLl
- Hero Member
- Posts: 8059
Re: GTK or QT?
« Reply #1 on: September 04, 2021, 09:30:55 am » I can't really speak for the Windows/Mac side of things, but my experience on Linux (mainly Debian) is that there are few issues compiling for /both/ GTK2 and Qt. Where you /do/ come across problems, e.g. if you're trying to do fancy stuff with keycodes or define control placement better than can be managed with anchors etc., I think I'd argue that if you isolate them early by regularly checking with multiple widget sets on the same platform then it will likely save you work when you migrate to a different one.MarkMLl Logged MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).Pet hate: people who boast about the size and sophistication of their computer.GitHub repositories: https://github.com/MarkMLl?tab=repositorieszeljko
- Hero Member
- Posts: 1675
-
Re: GTK or QT?
« Reply #2 on: September 04, 2021, 09:34:29 am » I'm using Qt on Linux, Windows and Mac for years and it suits all my needs. You must decide on your own what is better on Linux for you, gtk2 is usually installed by default, but gtk2 won't be default installation for so long time since it's pretty old lib now. Gtk3 widgetset isn't finished, on the other side we have Qt and Qt5 WS - stable and continuosly developed and maintaned. My recommendation is definitelly Qt5 if you start fresh project and need stable WS since all distros now pack libQt5Pas C library which is needed by Qt5 WS. LoggedPascalDragon
- Hero Member
- Posts: 5771
- Compiler Developer
Re: GTK or QT?
« Reply #3 on: September 05, 2021, 11:34:56 am » Quote from: bitman on September 04, 2021, 07:36:48 amSo, my question is: which one should I use (GTK or QT) so that it gives me the less problems later on when I try to recompile for Windows and Mac ??? Or doesn't make any difference? Should I just install the version that merely corresponds to the linux desktop I'm using at the moment (Plasma or budgie)?For Windows and macOS neither Gtk nor Qt are used (by default). For Windows the WinAPI is used directly and for macOS Cocoa is used. So there might be slight differences between platforms anyway so it's recommended that you test your application on these platforms. Logged
dbannon
- Hero Member
- Posts: 3160
-
Re: GTK or QT?
« Reply #4 on: September 05, 2021, 12:16:53 pm » Yes, as previously said, you really only need to choose between GTK2 and Qt5 on Linux, on Windows you will use Win32 and on Mac, its Cocoa.If you mean which of GTK2, Qt5 is easier to translate to Windows or mac, neither, in my app, I make both a Qt5 and GTK2 version for Linux and just recompile to be Windows or mac. Very occasionally you might need to put a ifdef in because one widget set or another needs slightly different treatment. But you will have more (but still not a lot) of ifdefs dealing with other differences between platforms, not related to widget set.I do occasionally get feedback from my Linux users that they prefer the look of the QT5 set, its trivial to produce either so build something and see what you prefer the look of.Davo Logged Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey) My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannonWarfley
- Hero Member
- Posts: 1778
Re: GTK or QT?
« Reply #5 on: September 05, 2021, 08:52:44 pm » You shouldn't use gtk or qt on windows but rather windows forms and on MacOs GTK2 is an absolute pain, but i think QT5 works okish, but here cocoa is the way to go.On Linux the decision is rather simple. GTK2 is officially considered EOL (end of life) by their developers and there will not be any more patches. It is removed from more and more platforms as default system. With respect to QT, while QT6 was also rolled out last year, QT5 is still considered live and, while the official QT team only provides LTS for commercial customers, the KDE Team publishes regular updates and fixes to QT5. Also as the main platform for KDE, it will be shipped with all KDE platforms for the next few years.So the decision is pretty simple use QT5, especially if you consider developing commercial software, because using EOL libraries is irresponsible and you can be held liable to any bugs or security issues arising from this decision (as, unless otherwise necessary and/or negotiated with the client, you must provide a service according to the state of the art). Logged GitHub: https://github.com/Warfleybitman
- Newbie
- Posts: 5
Re: GTK or QT?
« Reply #6 on: September 07, 2021, 11:00:05 pm » Thanks everyone for their feedback.Quote from: dbannon on September 05, 2021, 12:16:53 pmIf you mean which of GTK2, Qt5 is easier to translate to Windows or mac, neither,...Yes, that's what I meant...I will follow your advice and go with QT, while regularly recompiling for GTK (as sanity check) and more seldomly for Windows (which is the one I've access to); will have to wait until a beta version to try on Mac though ;(Quote from: zeljko on September 04, 2021, 09:34:29 am
I'm using Qt on Linux, Windows and Mac for years and it suits all my needs.I wasn't aware that QT could be used on Windows and Mac too... I mean, I know it is crossplatform, but didn't know could also be used via Lazarus in those platforms...I feel attracted to the idea however, of using QT as engine for all platforms, mainly for its theming capabilities... I know I cannot use mac UI theme on Win nor Linux, but what about the "Fusion" theme (QT own theme)??? could my app use it across all platforms? Well, I ask this mostly for aesthetic reasons, to achieve an uniform look across platforms; but seeing other people mentioning setting up QT for mac may be hassle, it might not be worth the effort. Logged
Warfley
- Hero Member
- Posts: 1778
Re: GTK or QT?
« Reply #7 on: September 07, 2021, 11:14:17 pm » Quote from: bitman on September 07, 2021, 11:00:05 pmI feel attracted to the idea however, of using QT as engine for all platforms, mainly for its theming capabilities... I know I cannot use mac UI theme on Win nor Linux, but what about the "Fusion" theme (QT own theme)??? could my app use it across all platforms? Well, I ask this mostly for aesthetic reasons, to achieve an uniform look across platforms; but seeing other people mentioning setting up QT for mac may be hassle, it might not be worth the effort.I don't think that a uniform design is a good idea. It is generally said that users preferr if all the applications fit into the system style. This is why Java introduced native style GUIs (before that Java had a unified look on all platforms) or why Android pushed for a more uniform style accross different apps.I don't really agree with this sentiment, because as software like VSCode or Final Cut have shown, people also like different looking apps, if they are well designed. But personally, I am not a designer, I am terrible at graphical UI design and the default style will always be accepted, so I rather go with that than trying to make a unique look that must be very good to be accepted.I think the worst thing is if you have a dark-themed system (like I have under Linux) and then there is one app thats not dark themed. Every time I open such an app it is kinda blinding. So personally I think sticking to the default theme a safe option that will always produce a good result « Last Edit: September 07, 2021, 11:16:01 pm by Warfley » Logged GitHub: https://github.com/Warfley
dbannon
- Hero Member
- Posts: 3160
-
Re: GTK or QT?
« Reply #8 on: September 08, 2021, 05:05:45 am » Quote from: bitman on September 07, 2021, 11:00:05 pmThanks everyone for their feedback.....I will follow your advice and go with QT, while regularly recompiling for GTK (as sanity check) and more seldomly for Windows (which is the one I've access to); will have to wait until a beta version to try on Mac though ;(Sorry but I would suggest the other way around, you do need to regularly check under Windows, too easy for a set of issues to build up. And a set is much harder to deal with. And the switch between Qt and GTK2 on Linux is a non-event. The Mac is an issue ("Its Unix Captain, but not as we know it") but maybe your approach might be to treat that as an extra project. Most things will work fine but there will be issues....And, yes I agree with the other posters who say that you should use native widget sets on both Windows and Mac. Qt can be made work there but end users will not appreciate the slightly different look and feel and getting the extra libraries installed is an unnecessary complication with no gain. Davo Logged Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey) My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon
cappe
- Full Member
- Posts: 192
Re: GTK or QT?
« Reply #9 on: September 08, 2021, 08:01:38 am » Quote from: zeljko on September 04, 2021, 09:34:29 amI'm using Qt on Linux, Windows and Mac for years and it suits all my needs. You must decide on your own what is better on Linux for you, gtk2 is usually installed by default, but gtk2 won't be default installation for so long time since it's pretty old lib now. Gtk3 widgetset isn't finished, on the other side we have Qt and Qt5 WS - stable and continuosly developed and maintaned. My recommendation is definitelly Qt5 if you start fresh project and need stable WS since all distros now pack libQt5Pas C library which is needed by Qt5 WS.An information, is qt ws by chance like broadway? Yes, I'm interested, is there any example to start with?Thank you. Logged
PascalDragon
- Hero Member
- Posts: 5771
- Compiler Developer
Re: GTK or QT?
« Reply #10 on: September 08, 2021, 08:54:01 am » Quote from: bitman on September 07, 2021, 11:00:05 pmI will follow your advice and go with QT, while regularly recompiling for GTK (as sanity check) and more seldomly for Windows (which is the one I've access to); will have to wait until a beta version to try on Mac though ;(For general tests you could also use WINE instead of Windows. Of course there might be differences between that and Windows itself, but for general tests that might be faster (at least if you need to reboot to test on Windows; if you have a separate computer or a VM that's a different topic). Logged
zeljko
- Hero Member
- Posts: 1675
-
Re: GTK or QT?
« Reply #11 on: September 08, 2021, 10:34:13 am » Quote from: bitman on September 07, 2021, 11:00:05 pmI wasn't aware that QT could be used on Windows and Mac too... I mean, I know it is crossplatform, but didn't know could also be used via Lazarus in those platforms...I feel attracted to the idea however, of using QT as engine for all platforms, mainly for its theming capabilities... I know I cannot use mac UI theme on Win nor Linux, but what about the "Fusion" theme (QT own theme)??? could my app use it across all platforms? Well, I ask this mostly for aesthetic reasons, to achieve an uniform look across platforms; but seeing other people mentioning setting up QT for mac may be hassle, it might not be worth the effort.Qt/Qt5 uses native theming on Mac and Win, so app looks exactly same as other OS apps. Logged
CM630
- Hero Member
- Posts: 1200
- Не съм сигурен, че те разбирам.
-
Re: GTK or QT?
« Reply #12 on: September 08, 2021, 12:03:37 pm » @Bitman did not say if he intends to distribute the software and under what conditions.Possibly there are significant licensing issues between GTK and QT (for commercial products)? Logged Лазар 4,0RC1 32 bit (sometimes 64 bit); FPC3,2,2zeljko
- Hero Member
- Posts: 1675
-
Re: GTK or QT?
« Reply #13 on: September 08, 2021, 07:19:02 pm » Qt is LGPL LoggedVTwin
- Hero Member
- Posts: 1224
- Former Turbo Pascal 3 user
Re: GTK or QT?
« Reply #14 on: September 08, 2021, 11:22:14 pm » I use native on Win and Mac, gtk2 on Lin. I found using QT caused additional complications with no benefit. Perhaps the eventual transition to gtk3 will change my mind, but we saw very rapid development of cocoa when carbon went south.BTW, I develop on Mac, and recompile on Win and Lin using VirtualBox.EDIT: You can use either on Lin, and still use native on Win and Mac. « Last Edit: September 08, 2021, 11:32:11 pm by VTwin » Logged “Talk is cheap. Show me the code.” -Linus TorvaldsFree Pascal Compiler 3.2.2macOS 14.5: Lazarus 3.4 (64 bit Cocoa M1)Ubuntu 18.04.3: Lazarus 3.4 (64 bit on VBox)Windows 7 Pro SP1: Lazarus 3.4 (64 bit on VBox)- Lazarus »
- Forum »
- Installation »
- Linux »
- GTK or QT?
- SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies
- XHTML
- RSS
- WAP2
Từ khóa » Gtk 3 Vs Qt
-
What Is Difference Between GTK And QT Applications?
-
GTK Vs Qt? What Do You Prefer And Why? (2017 Edition) - Reddit
-
What Should I Choose: GTK+ Or Qt? [closed] - Stack Overflow
-
What's The Difference Between GTK+ And Qt? - MakeUseOf
-
What Are Considerations When Choosing Between Gtk 3 And Qt 5 For ...
-
Kind Of A Tangent, But Why Switch From GTK To Qt 5? Or Rather, Why Qt ...
-
I Love KDE,I Like QT, Why Is GTK The Preferred Toolkit On Linuxes ...
-
Qt Vs GTK+ Vs WxWidgets - A Comparative Study - E-con Systems
-
Gtk Or Qt Or Flutter For Developing Linux App - Value In Brief
-
Difference Between GTK And QT
-
Qgtk3theme.cpp\gtk3\platformthemes\plugins\src - Qt/t
-
Uniform Look For Qt And GTK Applications - ArchWiki
-
GTK Or Qt? | Peter
-
GUI Applications - The Hitchhiker's Guide To Python - Read The Docs