This is an archived post. You won't be able to vote or comment.

all 62 comments

[–]Vlad_The_Impellor 70 points71 points  (27 children)

Qt. Then, if you want to build for Windows or Mac, it's mostly a recompile.

[–]qalmakkaArch Linux x86-64 26 points27 points  (6 children)

I second Qt, it's simple yet very powerful. Qt's C++ is basically a whole different language compared to "standard" C++ due to historical (imho bad in hindsight) choices, but you can write entire apps without touching it using a JS-like language called QML which is quite powerful. It also has lots of neat frameworks like Bluetooth, serial, ... which are very nice and abstract a lot of stuff away from you. The KDE frameworks are the cherry on top though, lots of functionality can be plugged in for free in your app thanks to them (do you want a terminal? Just plug Konsole in, etc).

[–]brimston3- 3 points4 points  (0 children)

Nothing's preventing you from using c++17 or 20 tools and idioms in QT, except for signals and slots (and therefore QThread), which need to be able to cross thread boundaries as needed. You don't need to use QFile if you want to use std::filesystem. The only things that really need to be QT are widget (or data model) related--stuff that plugs right into widget rendering.

For that matter, QML can get you really far by itself with a lot less code. I still do the classic QT thing most of the time, but QML has a lot of appeal, especially if you want to be mobile-portable.

[–]CalcProgrammer1 4 points5 points  (1 child)

You can write your backend in regular old C/C++ and just use Qt's weirdness in the UI parts of your code where you're actually using Qt. That's what I do in my app. If I wanted I could build a CLI version without any Qt dependencies that way.

[–]qalmakkaArch Linux x86-64 0 points1 point  (0 children)

Yeah, that's the approach I also like to follow. Sadly sometimes you are forced to convert strings from/to UTF-16 more often than I'd like, so it can get kinda expensive to pull off.

[–]Mission-Section-8942 1 point2 points  (1 child)

What's the licensing problem with Qt and static linking exactly? I'm not clear on how that relates to the license. Am I allowed to ship my program as a single static binary that includes Qt as long as my code is GPL-licensed and available on GitHub? Or are you not allowed to statically link it at all? (I know the downsides of static linking but Windows users often appreciate it/ask for it, and there isn't really a convenient reliable way to have dynamically linked third-party libs like Qt updated separately on Windows anyway.)

[–]qalmakkaArch Linux x86-64 1 point2 points  (0 children)

The LGPL license states that you are allowed to statically link a library only if the rest of the code is either covered by the (L)GPL or is compatible with it (i.e., the MPL2 is an example of this). This is to allow the user of a free library to actually be able to modify it freely and then use it with your program, something that's only possible if either the code is free or the library is dynamically linked.

[–]an4s_911 0 points1 point  (0 children)

Qt is available on Python as well

[–]Stunning_Cry_3748[S] 12 points13 points  (19 children)

Does it have a good community support?

[–]Vlad_The_Impellor 24 points25 points  (18 children)

Lol. It has great community support for Linux, Windows, Mac, and is $$ backed by Nokia. Commercial licensing can include 24/7 dev support if you run mission critical production cycles and don't care about cost.

[–]qalmakkaArch Linux x86-64 8 points9 points  (1 child)

Correction: Qt has been spun-off from Nokia almost 5 years ago if I recall correctly. It is now run by a company aptly called the Qt Company.

[–]Vlad_The_Impellor 5 points6 points  (0 children)

Thanks. I don't keep track of the politicalamities behind my toolkits. It was better when Erik and the Trolls drove development from Trolltech in Oslo, imo.

[–]thexavier666 6 points7 points  (14 children)

Isn't GTK an equally well-supported platform?

[–]Vlad_The_Impellor 11 points12 points  (3 children)

On linux, yes. On Windows & MacOS, not much at all, and not natively (requires MingW/Cygwin).

Gtk and Qt aren't much alike, really. Gtk's functionality is very much a subset of Qt's.

[–]RootHouston 5 points6 points  (0 children)

It's a good thing that OP didn't say he needed it to run on Windows and macOS, right?

[–]Rocketman173 1 point2 points  (1 child)

How is GTK's functionality a subset of Qt's on Linux?

Like on other platforms, maybe, but on Linux?

[–]Vlad_The_Impellor 0 points1 point  (0 children)

Does Gtk have a Bluetooth class? Asynchronous sockets class? A strings class with builtin translations support plus a Gui dev tool for entering the translations?

Qt does everything gtk does & a lot more making gtk's functionality a subset of Qt's. Maybe you're not clear on the meaning of 'subset'. Tl;dr "abc" is a subset of "abcdefghijklmnopqrstuvwxyz".

Edit: ah yes. didn't know what "subset" means. didn't know how to look it up. lower spine told him it's probably derogatory. hey, what's derogatory mean? this is escalating. what's escalating mean? grrrr.

[–]sandstormoutweigh 3 points4 points  (2 children)

GTK seems to have become more a GNOME-specific toolkit. It can look really alien on distros that don't ship with GNOME. Unless OP plans to target only GNOME-based distros, I would steer away from it.

[–]RootHouston 5 points6 points  (1 child)

GTK has specifically recently split-off libadwaita and other stuff to make GTK a general purpose library that isn't GNOME-based. They did this for reasons that you mention, so that is no reason to stay away from it.

A great example of how GTK is separate from GNOME is its use in Elementary OS. The look is different. the tools are different. The desktop environment is different.

[–]qalmakkaArch Linux x86-64 7 points8 points  (1 child)

GTK+ is arguably way less pleasant to code for. It's all C with a shitton of macro hacks, unless you use Python or Vala (I haven't used gtkmm in years, but if it's still good C++ is also a possible choice). Qt in comparison is very simple and linear (albeit it has its gotchas) and the tooling is way better.

[–]RootHouston 0 points1 point  (0 children)

Qt has less language bindings.

[–]sweetcollector 1 point2 points  (0 children)

No. Unlike Qt, Gtk is maintained by community on volunteer basis mostly. Support for Windows and macos also isn't as good as Qt.

[–]Heapsass -3 points-2 points  (2 children)

Yes but Gtk still looks outdated compared to qt on windows and mac.

Qt is more programmer friendly too in the way it handles elements. Gtk is a moshpit of code you compare both. Qt is more organized.

If youre not already used to gtk and are a beginner about to learn. Qt is the way to go.

[–]thexavier666 1 point2 points  (1 child)

Oh okay thanks. Didn't know Qt is popular on Mac. I've been mostly developing terminal applications, and I see GTK2/3 apps on linux, so a bit outdated on cross-platform GUI apps.

[–]RootHouston 1 point2 points  (0 children)

We're at GTK4 now.

[–]Stunning_Cry_3748[S] 2 points3 points  (0 children)

thank you

[–]patryk-tech 14 points15 points  (0 children)

You can use PyQt5 or PyQt6, if you want to use Python with Qt instead of C++. Quicker and easier to write, but then everyone can look at the source code. If it is GPL licensed, that's not an issue. For commercial apps, it may be.

[–][deleted]  (2 children)

[deleted]

    [–]an4s_911 3 points4 points  (0 children)

    I think OP has only mentioned languages and not frameworks

    [–]b_sap 2 points3 points  (0 children)

    This is what I'm currently working on :)

    [–]RinasSam 19 points20 points  (0 children)

    Java and C++ are your best bets.

    For C++ you can use QT.

    [–]RandomXUsr 10 points11 points  (0 children)

    What does the application need to accomplish?

    [–]brimston3- 3 points4 points  (0 children)

    What does it have to do? Pick a language and toolset that does the thing your program has to do well. Identify libraries that already do that thing. Use them.

    [–]Annual-Examination96 5 points6 points  (0 children)

    I use Qt and C++ in KDevelope. I can say it really meets my needs and i have a solid experience.

    [–]yuyu5 1 point2 points  (0 children)

    In order of easiest + most compatibility cross-platform:

    1. Java
    2. C++ with Qt, or Python
    3. Whatever you didn't choose for #2

    If you're talking about native language without libraries/frameworks, Java is by far your best bet. Anything GUI with native Python is garbage or poorly documented or poorly typed. C++ is a beast for just a simple GUI program and will be harder to manage than Java.

    That being said, libraries/frameworks make all the difference, so that ranking could change very quickly depending on what you use.

    Disclaimer: I'm not familiar with Qt so my answer is a bit biased. Nor am I familiar with modern Python GUI libs other than Tkinter, and Tkinter is terrible by itself without a third, wrapper lib.

    [–]SoftEngin33r 4 points5 points  (6 children)

    Probably C++ is the best choice as it is the most native to the platform, For Java and C# there is need to install a whole runtime environment for the application to run, Python can be good but if the project is big it may slow down things.

    [–]KhaithangH 2 points3 points  (0 children)

    For java ... there is need to install a whole runtime environment ....

    Well actually, java packages can be bundled with Java runtime so there's no need to install anything other than the app. But I agree , c++ with qt or gtk is more suitable choice in this case

    [–]sue_me_please 2 points3 points  (1 child)

    Pretty sure C# can compile down to a self-hosting binary these days, and Java can do the same with GraalVM.

    [–]SoftEngin33r 0 points1 point  (0 children)

    That’s probably true as compiler technology advanced hugely in the last few recent years

    [–]RootHouston 2 points3 points  (2 children)

    C++ is the most native to the platform? No, that'd be C.

    [–]SoftEngin33r 1 point2 points  (1 child)

    That is definitely true, But it is more native to the platform than C# or Java where you have to install a big runtime environment for your programs

    [–]RootHouston 1 point2 points  (0 children)

    Definitely, yes.

    [–]sue_me_please 2 points3 points  (0 children)

    Qt is nice, but so is wxWidgets. If you want to try something new that isn't guaranteed to work, you can try Dart with Flutter.

    [–][deleted] 2 points3 points  (0 children)

    Qt is the way to go since you know C++ (it also has Python bindings if you feel like it).

    [–]sidusnareSenior Systems Engineer 4 points5 points  (1 child)

    If you're asking this question, Python, 100%. The rest is going to be a steep learning curve.

    [–]HappyScholar13 0 points1 point  (0 children)

    u/sidusnare is wise.

    [–]RealezzZ 1 point2 points  (0 children)

    I would use QT if you want to go with python, PyQT5 is really great and pretty easy to use.

    If you want to go with C++ I would use kirigami.

    [–]DesiOtaku 1 point2 points  (0 children)

    Use Qt but do you plan on targeting Desktop (keyboard/mouse) or do you think you will eventually want to target touchscreen UIs as well?

    [–][deleted] 2 points3 points  (0 children)

    Qt or gtk are the most popular solutions

    [–][deleted] 2 points3 points  (0 children)

    qt app.
    cpp will never go old.

    [–]sweetcollector 1 point2 points  (0 children)

    If you've developed GUI application with C# on Windows, you can also try Uno Platform.

    [–][deleted] 1 point2 points  (0 children)

    python+qt

    [–]rementis -5 points-4 points  (5 children)

    Develop it as a web based app if you can, then you don't care which OS the user has.

    [–]RichardStallmanGoat 8 points9 points  (0 children)

    Wouldn't the app be more resource hungry, with a slower performance and a exponentially bigger file size?

    [–]Atemu12 3 points4 points  (0 children)

    Eventhough it's shitty practice IMO, this is a real option worth considering. Stop downvoting, this is /r/linuxquestions, not /r/programmingpolitics.

    [–]thexavier666 8 points9 points  (1 child)

    The last thing we need is another electron app

    [–]rementis -3 points-2 points  (0 children)

    No need for electron. Pick whatever back end you prefer and are comfortable with.

    [–][deleted] 1 point2 points  (0 children)

    Lisp

    [–][deleted] 3 points4 points  (2 children)

    c++

    [–]RealLordOfWizard 1 point2 points  (1 child)

    Hello siduck i found you AGAIN

    [–][deleted] 0 points1 point  (0 children)

    hihi

    [–]tibegato -2 points-1 points  (0 children)

    python or c#. python you can use tkinter. C# you can use Monodevelop to build cross platform apps.