[SOLVED] Which one to use for Desktop Applications: Python with GTK or C++ with QT?
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Topics in this forum are automatically closed 6 months after creation.
[SOLVED] Which one to use for Desktop Applications: Python with GTK or C++ with QT?
Hi, I migrated from Windows world and used to make database applications for web in Php + MySQL and for desktop in VB and Visual FoxPro for clients. I am good with Php + MySQL but dealing with desktop projects seems frustrating.
Most of my projects are written in Visual FoxPro as I've been working from the time of D Base III Plus or FoxPro for DOS. Now on Linux, I've to access those tools via Wine and I want to switch to some native programming language (or should I say a language which can compile standalone applications for both Linux and Windows).
I neither used Python nor C++ (just in school, which I barely remember). Database should not be a problem as both the languages support SQLite. I seek guidance from experienced coders about choosing a language to accomplish my tasks:
* Please don't advice which tool you use in school or for fun learning.
Should it be Python with GTK or C++ with QT?
Which language is easier to generate printable reports with different fonts, sizes and alignment (bills / statements / ledger etc.)?
Which is the best RAD GUI framework to use? Something like drag widgets / controls to the window, set properties, write code for events, call functions / procedures and compile?
Most of my projects are written in Visual FoxPro as I've been working from the time of D Base III Plus or FoxPro for DOS. Now on Linux, I've to access those tools via Wine and I want to switch to some native programming language (or should I say a language which can compile standalone applications for both Linux and Windows).
I neither used Python nor C++ (just in school, which I barely remember). Database should not be a problem as both the languages support SQLite. I seek guidance from experienced coders about choosing a language to accomplish my tasks:
* Please don't advice which tool you use in school or for fun learning.
Should it be Python with GTK or C++ with QT?
Which language is easier to generate printable reports with different fonts, sizes and alignment (bills / statements / ledger etc.)?
Which is the best RAD GUI framework to use? Something like drag widgets / controls to the window, set properties, write code for events, call functions / procedures and compile?
Last edited by mudassir on Sat Feb 10, 2024 7:38 pm, edited 1 time in total.
Please SHARE Knowledge.. Let's not FLAUNT it...
FUN := 'Linux Mint 21 Vanessa Cinnamon' + 'Php, Apache, MySQL Server' + 'Lazarus' + 'Gambas';
const Lazarus : Pascal;
const Gambas As BASIC
Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?
Speaking strictly out of user experience: QT sucks a lot! Better aim for GTK, if you're gonna make applications.
Core i7-4770, Palit GTX 1660 Ti, 32GB DDR3 RAM, Firefox, Arch LTS w/ Cinnamon 5.2.7
My Linux group on Telegram
Avatar & desktop: https://ibb.co/album/GFx0yV
My Linux group on Telegram
Avatar & desktop: https://ibb.co/album/GFx0yV
-
- Level 8
- Posts: 2239
- Joined: Wed Aug 14, 2019 1:02 am
Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?
My own personal experience in RAD GUI framework for cross-platform is Lazarus, a very VB-like experience with Pascal code underneath, and generate extremely portable executable by default.
"Python with GTK" is where many application developed by MInt is done with. So you may gain quite a bit of support in this forum as well, or take the code from Mint devs as reference sample.
"C++ with QT" is loved by somebody, but in my opinion a risky choice unless one is willing to maintain the codebase perpetually. Qt framework evolves far faster than GTK and break compatibility far faster too. Old software written for Qt3 and Qt4 has lost capacity to run on latest Linux distos as the library support has been dropped. Currently most Qt-based software are relying on Qt5 but since Qt6 has been out already, all of them are pressured to update/upgrade their code to Qt6 in near future or face losing capacity to run on Linux. This marathon is tedious.
Meanwhile, GIMP has still not finished porting to GTK3. Thus even archaic software written in GTK2 days are still safe for a while.
"Python with GTK" is where many application developed by MInt is done with. So you may gain quite a bit of support in this forum as well, or take the code from Mint devs as reference sample.
"C++ with QT" is loved by somebody, but in my opinion a risky choice unless one is willing to maintain the codebase perpetually. Qt framework evolves far faster than GTK and break compatibility far faster too. Old software written for Qt3 and Qt4 has lost capacity to run on latest Linux distos as the library support has been dropped. Currently most Qt-based software are relying on Qt5 but since Qt6 has been out already, all of them are pressured to update/upgrade their code to Qt6 in near future or face losing capacity to run on Linux. This marathon is tedious.
Meanwhile, GIMP has still not finished porting to GTK3. Thus even archaic software written in GTK2 days are still safe for a while.
Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?
Thanks @Valsodar and @billyswong for sharing your experiences. I need something stable to work with, so (as suggested), QT is not my bet
Lazarus seems great at first glance with RAD GUI Framework looks like Visual Foxpro / Visual Basic Form Designer... but (sorry to ask) is it capable to make modern interface like GTK 3 or give native interface experience on Windows 10 / 11?
Language is no barrier to me, it's just a RAD Framework to create GUI with drag and drop and capable to produce modern looking interface OR preferably give native interface when deployed to Linux or Windows systems.
Python would be my first choice if there is any Lazarus / Visual Basic / Visual Foxpro like RAD GUI Framework to work with latest GTK. Yes, google gives countless suggestions but advice from experienced coders is much more reliable to me.
Lazarus seems great at first glance with RAD GUI Framework looks like Visual Foxpro / Visual Basic Form Designer... but (sorry to ask) is it capable to make modern interface like GTK 3 or give native interface experience on Windows 10 / 11?
Language is no barrier to me, it's just a RAD Framework to create GUI with drag and drop and capable to produce modern looking interface OR preferably give native interface when deployed to Linux or Windows systems.
Python would be my first choice if there is any Lazarus / Visual Basic / Visual Foxpro like RAD GUI Framework to work with latest GTK. Yes, google gives countless suggestions but advice from experienced coders is much more reliable to me.
Please SHARE Knowledge.. Let's not FLAUNT it...
FUN := 'Linux Mint 21 Vanessa Cinnamon' + 'Php, Apache, MySQL Server' + 'Lazarus' + 'Gambas';
const Lazarus : Pascal;
const Gambas As BASIC
Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?
I was going to suggest lazarus but was thinking, no not mainstream, it will get "downvoted" by others suggesting python. Pascal is my 'goto' language, the lazarus IDE is excellent, there is a lazarus forum and it is relatively easy to get GUI apps up and running. You can use GTK or QT although to date I've stuck with GTK. Even it you switch to something else later, a good starting point (although if you switch to C++ you will find yourself saying this is so much easier with pascal = my experience).billyswong wrote: ⤴Fri Jan 26, 2024 2:06 am My own personal experience in RAD GUI framework for cross-platform is Lazarus.
An example of an application written in pascal with lazarus:
https://foxclone.org/
About 8,000 lines of code.
So another upvote for lazarus
Downside - it is GTK2 and GTK3 has been coming "real soon now" for several years, I've not found that a problem. No issues like that on the win side.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?
Downloaded Lazarus from here to see how things work with that. But we're open to all good suggestions from experienced people because it's just an experiment and till now I'm not even aware of Pascal basic syntax.
The package came with three deb files for:
1. fpc-laz - the Compiler, some command line tools, base units and non visual components like database access
2. fpc-src - the sources of fpc and its packages, needed for code browsing
3. lazarus-project - the IDE, visual components and help files
Installed all three packages with libgtk2.0-dev and fixed dependency issues while there is only one Shortcut in the programming menu for Lazarus. Where to find command line tools and non visual components from fpc-laz? Also is there something about fpc-src I should know?
The package came with three deb files for:
1. fpc-laz - the Compiler, some command line tools, base units and non visual components like database access
2. fpc-src - the sources of fpc and its packages, needed for code browsing
3. lazarus-project - the IDE, visual components and help files
Installed all three packages with libgtk2.0-dev and fixed dependency issues while there is only one Shortcut in the programming menu for Lazarus. Where to find command line tools and non visual components from fpc-laz? Also is there something about fpc-src I should know?
Please SHARE Knowledge.. Let's not FLAUNT it...
FUN := 'Linux Mint 21 Vanessa Cinnamon' + 'Php, Apache, MySQL Server' + 'Lazarus' + 'Gambas';
const Lazarus : Pascal;
const Gambas As BASIC
-
- Level 8
- Posts: 2239
- Joined: Wed Aug 14, 2019 1:02 am
Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?
I installed Lazarus (2.2.0) through Software Manager. Thus no trouble of dependencies.
If you want to build Lazarus project through command line tools, take a look at https://wiki.freepascal.org/Using_the_L ... ut_Lazarus
You may also take a look at https://wiki.freepascal.org/Installing_Help_in_the_IDE and install the help file into your local computer.
If you want to build Lazarus project through command line tools, take a look at https://wiki.freepascal.org/Using_the_L ... ut_Lazarus
About "non visual components", no need to worry. Open the IDE and you should find all the popular database connection class/object in the toolbox for you to add into your project.So, how to build a Lazarus project without Lazarus?
The easy way
Uselazbuild
. It does NOT launch Lazarus; it's just a wrapper forfpc
. Runninglazbuild project1.lpr
should do it.
You may also take a look at https://wiki.freepascal.org/Installing_Help_in_the_IDE and install the help file into your local computer.
Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?
billyswong wrote: ⤴Fri Jan 26, 2024 3:01 pm I installed Lazarus (2.2.0) through Software Manager. Thus no trouble of dependencies.
If you want to build Lazarus project through command line tools, take a look at https://wiki.freepascal.org/Using_the_L ... ut_LazarusAbout "non visual components", no need to worry. Open the IDE and you should find all the popular database connection class/object in the toolbox for you to add into your project.So, how to build a Lazarus project without Lazarus?
The easy way
Uselazbuild
. It does NOT launch Lazarus; it's just a wrapper forfpc
. Runninglazbuild project1.lpr
should do it.
You may also take a look at https://wiki.freepascal.org/Installing_Help_in_the_IDE and install the help file into your local computer.
Thanks, already reading stuff on freepascal.org and wiki.freepascal.org
Please SHARE Knowledge.. Let's not FLAUNT it...
FUN := 'Linux Mint 21 Vanessa Cinnamon' + 'Php, Apache, MySQL Server' + 'Lazarus' + 'Gambas';
const Lazarus : Pascal;
const Gambas As BASIC
Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?
Sorry, just thought to download the latest one from source as repositories are not very often update.And asked if I'm missing something.billyswong wrote: ⤴Fri Jan 26, 2024 3:01 pm I installed Lazarus (2.2.0) through Software Manager. Thus no trouble of dependencies.
Got them in the IDE, thanks. Reading stuff on freepascal.org and wiki.freepascal.org already Thanks for the helpbillyswong wrote: ⤴Fri Jan 26, 2024 3:01 pm About "non visual components", no need to worry. Open the IDE and you should find all the popular database connection class/object in the toolbox for you to add into your project.
Please SHARE Knowledge.. Let's not FLAUNT it...
FUN := 'Linux Mint 21 Vanessa Cinnamon' + 'Php, Apache, MySQL Server' + 'Lazarus' + 'Gambas';
const Lazarus : Pascal;
const Gambas As BASIC
Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?
Way back, might have been LM18, the version in the repos was broke, missing some components, so I always download the debs from lazarus. If it is all there in the version in the repos then fine. I'm running lazarus 2.2.4 and FPC 3.2.2.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?
Thanks AndyMH, I will surely check that for language reference. But my priority is to play with the controls. Like, I made a Form, put some buttons, edit box and a listbox... I'm attempting to add items to the list during runtime via the edit box input on button click and to remove them from other button. Please suggest if there is some quick tutorial to help me play with the controls or maybe some example codes to download. Thanks again.AndyMH wrote: ⤴Fri Jan 26, 2024 3:47 pm Google, just one:
https://www.tutorialspoint.com/pascal/p ... erview.htm
Please SHARE Knowledge.. Let's not FLAUNT it...
FUN := 'Linux Mint 21 Vanessa Cinnamon' + 'Php, Apache, MySQL Server' + 'Lazarus' + 'Gambas';
const Lazarus : Pascal;
const Gambas As BASIC
Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?
It's Lazarus Project 3.0 at their website that I downloaded and FPC 3.2.2
Please SHARE Knowledge.. Let's not FLAUNT it...
FUN := 'Linux Mint 21 Vanessa Cinnamon' + 'Php, Apache, MySQL Server' + 'Lazarus' + 'Gambas';
const Lazarus : Pascal;
const Gambas As BASIC
-
- Level 8
- Posts: 2239
- Joined: Wed Aug 14, 2019 1:02 am
Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?
The reference manual written by FreePascal devs may provide more up-to-date/detailed information. https://www.freepascal.org/docs.htmlAndyMH wrote: ⤴Fri Jan 26, 2024 3:47 pmGoogle, just one:
https://www.tutorialspoint.com/pascal/p ... erview.htm
Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?
I'm not aware of one, not to suggest that there isn't one. I learnt by trial and error. I also don't use the form designer, I hard code all my widgets with the constructor for each object.
When I first started with lazarus I bought this:
https://www.amazon.co.uk/gp/product/150 ... UTF8&psc=1
It was worth buying.
As I suggested earlier, join the lazarus forum, friendly, but not as friendly as the LM forum. There may be stuff there.
The help in lazarus is pretty comprehensive (and what you see in help is all online): But before you can make effective use of it, you need some understanding of the overall structure of lazarus - that's what the book did. I was already reasonably fluent in pascal having learnt it in the 1980's. That proved an obstacle, it took me a long time before I could get my head around OOP, my thinking was procedural.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?
Thanks billyswong, I got the best language reference over freepascal.org.billyswong wrote: ⤴Sat Jan 27, 2024 1:35 am The reference manual written by FreePascal devs may provide more up-to-date/detailed information. https://www.freepascal.org/docs.html
Please SHARE Knowledge.. Let's not FLAUNT it...
FUN := 'Linux Mint 21 Vanessa Cinnamon' + 'Php, Apache, MySQL Server' + 'Lazarus' + 'Gambas';
const Lazarus : Pascal;
const Gambas As BASIC
Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?
I'm working my way through Lazarus form designer but I have to find some tutorial on controls (esp. methods) as properties and events are always (almost) same for any framework.
Form designers in VFP and VB really made me lazy or maybe it's my habit to create GUI using my own custom functions/procedures to get it done quickly.I also don't use the form designer, I hard code all my widgets with the constructor for each object.
Will surely go through that.As I suggested earlier, join the lazarus forum, friendly, but not as friendly as the LM forum. There may be stuff there.
The help in lazarus is pretty comprehensive (and what you see in help is all online):
Procedural is best suited to me also but there is always something new to learn but any prior experience with some computer language enables us to adapt new languages faster.I was already reasonably fluent in pascal having learnt it in the 1980's. That proved an obstacle, it took me a long time before I could get my head around OOP, my thinking was procedural.
Please SHARE Knowledge.. Let's not FLAUNT it...
FUN := 'Linux Mint 21 Vanessa Cinnamon' + 'Php, Apache, MySQL Server' + 'Lazarus' + 'Gambas';
const Lazarus : Pascal;
const Gambas As BASIC
Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?
If you don't mind main author/maintainer being Russian you could take a look at the Double Commander project. It's written in Pascal and uses Lazarus so it lines up with all advices above. It has options to build either with Gtk2 or Qt5 so if you could follow its lines you could do that too for your project(s). It can also build for Windows but not under Linux (I think).
Personally I have never ever used Pascal or the Lazarus IDE before, so can't provide any advice in that regard; but after following the recommendations regarding installing tools, dependencies and whatnot I was able to succesfully build both DoubleCmd versions. So maybe something on that page could help in case you have problems with building your project.
Just in case you want to also pursue the Python alternative there is Glade Builder 3.22 that provides the means for building a Gtk3 GUI usable with a Python script. That I did use a few times. It's not too easy as the Gtk tends to make everything fluid and widgets are so dependent on one-another but in the end one can achieve more or less their goal.
Unfortunately I can't provide any direct links to Glade as the stupidity that took over the web lately made everybody into an enemy and there's that imbecility called captcha everywhere, even in an innocent search.
Personally I have never ever used Pascal or the Lazarus IDE before, so can't provide any advice in that regard; but after following the recommendations regarding installing tools, dependencies and whatnot I was able to succesfully build both DoubleCmd versions. So maybe something on that page could help in case you have problems with building your project.
Just in case you want to also pursue the Python alternative there is Glade Builder 3.22 that provides the means for building a Gtk3 GUI usable with a Python script. That I did use a few times. It's not too easy as the Gtk tends to make everything fluid and widgets are so dependent on one-another but in the end one can achieve more or less their goal.
Unfortunately I can't provide any direct links to Glade as the stupidity that took over the web lately made everybody into an enemy and there's that imbecility called captcha everywhere, even in an innocent search.
Codeberg repo; old: @GitLab
Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?
Thanks for your input Drugwash, I will check Double Commander.. author / maintainer being Russian? That should not be an issue for anyone. I mean why?Drugwash wrote: ⤴Tue Feb 06, 2024 12:11 am If you don't mind main author/maintainer being Russian you could take a look at the Double Commander project. It's written in Pascal and uses Lazarus so it lines up with all advices above. It has options to build either with Gtk2 or Qt5 so if you could follow its lines you could do that too for your project(s). It can also build for Windows but not under Linux (I think).
As far as Lazarus is concerned, I tried it upon the recommendations over here and found that it is a very good (if not best) open source RAD platform for former Visual Studio coders who used to code in Visual Basic / Visual Foxpro. Good support of a wide variety of components / controls. And contrary to the myths Language is pretty powerful and a good community. Best part is being able to compile programs for both Linux and Windows (not talking about other platforms).
Also tried GAMBAS, looks so neat and minimal but the user-base is very small. Main drawback being not able to compile the applications for Windows.
Yeah, I read a lot about Glade and Python but never used it. Will give it a try too but now I'm trying to learn / play with Lazarus controls as I want to good alternative to VFP to port my running programs.Just in case you want to also pursue the Python alternative there is Glade Builder 3.22 that provides the means for building a Gtk3 GUI usable with a Python script. That I did use a few times. It's not too easy as the Gtk tends to make everything fluid and widgets are so dependent on one-another but in the end one can achieve more or less their goal.
Unfortunately I can't provide any direct links to Glade as the stupidity that took over the web lately made everybody into an enemy and there's that imbecility called captcha everywhere, even in an innocent search.
Please SHARE Knowledge.. Let's not FLAUNT it...
FUN := 'Linux Mint 21 Vanessa Cinnamon' + 'Php, Apache, MySQL Server' + 'Lazarus' + 'Gambas';
const Lazarus : Pascal;
const Gambas As BASIC
Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?
This topic is very close to the question in another thread. You might take a look at wxFormBuilder if you want to use Python.https://github.com/wxFormBuilder/wxFormBuilderYeah, I read a lot about Glade and Python but never used it. Will give it a try too but now I'm trying to learn / play with Lazarus controls as I want to good alternative to VFP to port my running programs.
I posted about it here.
Years ago I did a brief stent as a programmer working in a shop that used Turbo Pascal/Delphi. Back in the early 2000s I contributed a small amount of code to the Lazarus project (My name is still on the list of contributors).BwingBob wrote: ⤴Mon Feb 05, 2024 8:07 pm It's not really a plugin for Eclipse but you might take a look at wxFormBuilder https://github.com/wxFormBuilder/wxFormBuilder.
I have not used it for C/C++, mostly Python. The work flow is to build the base of your gui using the Builder, dump the source code for the design. In your application you derive your gui from the classes in the builder code and add your application logic to this derived class. This workflow allows you to modify the design without wiping out your application logic.
I prefer wxBuilder over Glade because the output is the actual source code to build the widgets, not XML to be used by some builder object. Since your code classes are derived from the classes in the builder output, the derived class is free to modify almost anything in the base class does not function/look etc. the way you want.
On Linux the underlying widget set is GTK on Windows it's WinForms so everything looks native.
Good luck.
Bob
Because of this thread, I downloaded and installed Lazarus in my "Programming test" VM and it looks really good. I may have to dust of my Object Pascal skills.
Give wxFormBuilder a look. It works really well.
Bob
Pop_OS! 22.04 {Dell Inspiron 15 5510}
Linux Mint Cinnamon 21 {Minisforum UM700}
Pop_OS! Thelio Mira ;-)
We have met the enemy and he is us. - Pogo
Linux Mint Cinnamon 21 {Minisforum UM700}
Pop_OS! Thelio Mira ;-)
We have met the enemy and he is us. - Pogo