[SOLVED] Which one to use for Desktop Applications: Python with GTK or C++ with QT?

About programming and getting involved with Linux Mint development
Forum rules
Topics in this forum are automatically closed 6 months after creation.
User avatar
AndyMH
Level 21
Level 21
Posts: 13759
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?

Post by AndyMH »

mudassir wrote: Wed Feb 07, 2024 4:43 pm 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
Another pascal convert :D

You will find the lazarus forum helpful, but not as helpful/friendly as the LM forum.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
Drugwash
Level 5
Level 5
Posts: 734
Joined: Fri Jun 07, 2019 6:40 am
Location: Ploieşti, RO
Contact:

Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?

Post by Drugwash »

mudassir wrote: Wed Feb 07, 2024 4:43 pm I will check Double Commander.. author / maintainer being Russian? That should not be an issue for anyone. I mean why?
Oh, personally I got no problems with Russian people, but seeing the context in that part of the world some people have built a certain adversity towards them generally for no reason. Mine was a friendly heads up in case you did have a problem, so as not to send you unknowingly in "unfriendly territory" so to speak. :)
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 [...] 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.
Different tools fit best to different people. Glad you found Lazarus to your liking. Haven't heard of GAMBAS before, might have a quick look out of curiosity.
Yeah, I read a lot about Glade and Python but never used it. Will give it a try too [...]
As a former Windows user I have been quite fond of AutoHotkey for many years and used a version of SmartGUI XP improved by myself, for GUI design. It produced actual code, much like wxFormsBuilder does according to BwingBob here. But as it happened Glade Builder had crossed my path earlier so I took it for a spin, and now got used to it. Anyway, it's just an alternative to take into account when you have time to play around. Whatever suits you best. :wink:
mudassir
Level 3
Level 3
Posts: 118
Joined: Tue Dec 12, 2023 2:28 am

Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?

Post by mudassir »

@Bob, thanks for details on wxFormBuilder. I will give it a quick look for sure. Personally I did not like Glade much as it just produces xml.

@AndyMH, thanks to introduce Lazarus, it's a great tool. Lazarus Forums, I find quite helpful too.

Pascal Convert / Found Lazarus of my Liking:
It's really hard to say by now. FreePascal is a capable language for no doubt, not so hard to learn but the language structure is too different at-least for people trying to migrate from Visual Studio (esp. VB / VFP) or any dBase/xBase clone. As far as Lazarus is concerned, it's a very well built RAD framework.
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
User avatar
AndyMH
Level 21
Level 21
Posts: 13759
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?

Post by AndyMH »

Pascal is a strongly structured language, e.g. cannot use a variable without declaring it. I didn't have any problems migrating from dbase to it, but that was a long time ago, dbase II and Turbo pascal V1.0 both running under CP/M.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
mudassir
Level 3
Level 3
Posts: 118
Joined: Tue Dec 12, 2023 2:28 am

Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?

Post by mudassir »

AndyMH wrote: Thu Feb 08, 2024 7:11 am Pascal is a strongly structured language, e.g. cannot use a variable without declaring it. I didn't have any problems migrating from dbase to it, but that was a long time ago, dbase II and Turbo pascal V1.0 both running under CP/M.
Well, it's easier to devote time to learn new stuff in young age but not so easy when you're like 40 or 50yo. There's some family, kids, business etc etc at that age, a bit harder to devote time and efforts to something... and just because the stuff you learned is like... IDK the word.. maybe gone? taken by someone?

(Just my thought)
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
User avatar
BwingBob
Level 3
Level 3
Posts: 183
Joined: Fri Sep 03, 2021 1:43 am
Location: Texas, USA.

Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?

Post by BwingBob »

Don't give up on Object Pascal too quickly, it is a great language. Anders Hejlsberg is a genius https://en.wikipedia.org/wiki/Anders_Hejlsberg and like Linus he has proven that Delphi was not just a one off since he went on to develop C# and TypeScript. I saw a lot of Delphi (Object Pascal) in C# when I used it.

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
mudassir
Level 3
Level 3
Posts: 118
Joined: Tue Dec 12, 2023 2:28 am

Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?

Post by mudassir »

BwingBob wrote: Thu Feb 08, 2024 3:15 pm Don't give up on Object Pascal too quickly, it is a great language. Anders Hejlsberg is a genius https://en.wikipedia.org/wiki/Anders_Hejlsberg and like Linus he has proven that Delphi was not just a one off since he went on to develop C# and TypeScript. I saw a lot of Delphi (Object Pascal) in C# when I used it.
No, I'm not talking about giving up Pascal, I said it's just different. I am trying to learn and make it compatible with my preferences using custom functions... For example, adding columns to ListView like this:

Code: Select all

        ListView1.ViewStyle:=vsReport;
        ResetListView(ListView1);           //  Or maybe: lvReset(ListView1);
    // Add column with Caption, Width and Alignment in one statement:
        AddListViewColumn(ListView1,'First Name',120,0);
        AddListViewColumn(ListView1,'Last Name',120);
    //  Or even some Shorter Alternative like: lvAddCol
        lvAddCol(ListView1,'Age',50,2);
        lvAddCol(ListView1,'DoB',120,1);
Or Adding Data / Rows like this:

Code: Select all

        ListView1.ViewStyle:=vsReport;
        ResetListView(ListView1);           //  Or maybe: lvReset(ListView1);
    // Add column with Caption, Width and Alignment in one statement:
        AddListViewColumn(ListView1,'First Name',120,0);
        AddListViewColumn(ListView1,'Last Name',120);
    //  Or even some Shorter Alternative like: lvAddCol
        lvAddCol(ListView1,'Age',50,2);
        lvAddCol(ListView1,'DoB',120,1);
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
User avatar
BwingBob
Level 3
Level 3
Posts: 183
Joined: Fri Sep 03, 2021 1:43 am
Location: Texas, USA.

Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?

Post by BwingBob »

No, I'm not talking about giving up Pascal, I said it's just different. I am trying to learn and make it compatible with my preferences using custom functions... For example, adding columns to ListView like this:

Code: Select all

        ListView1.ViewStyle:=vsReport;
        ResetListView(ListView1);           //  Or maybe: lvReset(ListView1);
    // Add column with Caption, Width and Alignment in one statement:
        AddListViewColumn(ListView1,'First Name',120,0);
        AddListViewColumn(ListView1,'Last Name',120);
    //  Or even some Shorter Alternative like: lvAddCol
        lvAddCol(ListView1,'Age',50,2);
        lvAddCol(ListView1,'DoB',120,1);
[/code]
Not sure I understand the question, but in my case I try to separate my application logic from the gui code as much as possible. Especially when the gui code is generated by a tool. In the Python code below I have a source file named gui.py that is the output of a tool, the code below is in a file name main.py. Using the gui tool I created the MainFrame object. In my main.py file I create the MainWindow class and inherit from the MainFrame class.

I am now free to modify the MainWindow class as I see fit, going back to the tool does not change the code in the main.py file, only the gui.py file. My MainWindow will inherit any changes I made with the tool.
Python example.

Code: Select all

import gui

class MainWindow(gui.MainFrame):
    """Main Program window"""
    #constructor
    def __init__(self,parent):
        #initialize parent class
        gui.MainFrame.__init__(self,parent)
        self.build_grid()
In this case the build_grid() function is in the file main.py, but I could easily add it to another source file called app_logic.py and modify the function to accept a grid object build_grid(theGrid: wx.grid) then import app_logic into my main.py source file.

The keywords are different in Pascal you would use

Code: Select all

Uses
instead of

Code: Select all

import
but the idea is the same.

Hopefully I answered the right question, if there was one.

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
mudassir
Level 3
Level 3
Posts: 118
Joined: Tue Dec 12, 2023 2:28 am

Re: Which one to use for Desktop Applications: Python with GTK or C++ with QT?

Post by mudassir »

I feel like the title of this thread does not go well with the discussion on choosing right language / framework for developing cross platform desktop applications on Linux. Though the responses are so helpful but still I feel that it is missing attention of a lot more developers as the title only address C++ and Python primarily. So, I decided to start a new thread and close this one.

Here's the new topic with title Top Graphical RAD Tools / Programming Languages to make Graphical Desktop Applications on Linux. Please be kind to follow. Thank you
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
Post Reply

Return to “Programming & Development”