I always see new GTK apps popup on Flathub. I dont really care and think GTK looks fancy, although CSD suck a bit and they waste space and often functionality.

But they work, are solid, and do what they should.

Qt on the other hand may seem more like a complex job to code with. I dont actually think so, but I heard especially writing rust with GTK is way better than with Qt.

I like KDE a lot, and even though I am excited for Cosmic I think Qt is the better toolkit for many things and a lot of time. But Dolphin seems to suffer from memory safety issues all the time, as well as other projects.

Do you have experience in rust, using GTK or Qt? How do they compare?

  • teolan@lemmy.world
    link
    fedilink
    arrow-up
    23
    ·
    3 years ago

    GTK is in bare C, which is rather easy to interop with Rust. Even if using GLib from Rust is a pain, GTK can and does have decent Rust bindings.

    QT on the other hand is C++ with object oriented stuff, and therefore cannot have easy bindings to Rust.

  • Michael Murphy (S76)@lemmy.world
    link
    fedilink
    English
    arrow-up
    18
    ·
    edit-2
    3 years ago

    GNOME was focusing on building Rust bindings for GTK for many years before Qt development picked up. The GTK bindings were usable within a year or two after Rust’s 1.0 release. Yet even today, those looking to build applications in Rust will find that GTK is the only mature toolkit right now. And if you’re doing that today, I’d recommend starting with Relm4 for the best GTK Rust experience.

    Rust does not support the C++ ABI, and Qt does not provide a C interface, so much work has to be done on building the tooling for binding C++ libraries to Rust. That work is still ongoing, so some have opted to use QML instead of interfacing with Qt C++ libraries. Yet if you’re looking to use Qt or QML, you may as well use Slint instead. It’s developed by former Qt/Trolltech developers and has a similar approach as QML.

  • TeryVeneno@lemmy.ml
    link
    fedilink
    arrow-up
    17
    arrow-down
    1
    ·
    edit-2
    3 years ago

    I think there’s a pretty big thing here that people are kinda missing and it’s the ease of app creation. Recently gnome has done a lot for app developers to make the experience really good. Workbench, gnome builder, biblioteca all combined with the ease of libadwaita and the gnome circle make app development significantly easier for gtk than qt. There’s a big community now with a lot of inertia. I think workbench has around 100 tutorials now or so. Super low barrier to entry. Also libadwaita is pretty.

    I already use gnome now, but even before I had settled on a DE, I took a look at both ecosystems and was heavily leaning towards gtk because of all these factors and against qt because of its reliance on c++. Until all of those factors are replicated well for qt (and by extension kde), I don’t think they’ll see the same level of development.

  • Avid Amoeba@lemmy.ca
    link
    fedilink
    arrow-up
    6
    arrow-down
    4
    ·
    edit-2
    3 years ago

    Qt with C++ is a spectacular environment to develop UI apps in. Coupled with QtQuick it’s even better. It’s perhaps only outclassed by Flutter. As others have mentioned, there’s lots of inertia behind GTK+. There’s also past issues with licensing which made the OSS community prefer GTK+ to Qt.

    I’ve no idea what’s involved in using Qt in Rust but people starting new UI apps in C and GTK+ today are likely doing a disservice to themselves and the larger OSS community that could contribute to development and maintenance.

  • d0ntpan1c@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    3
    arrow-down
    3
    ·
    3 years ago

    No specific rust experience with either, but some thoughts on the popularity reasons outside of the language:

    I suspect a bit part of this difference in framework popularity may be due to GTK being more attached to gnome and friends, and by extension, Ubuntu (for better or worse, the most used desktop distro for quite a while) Most of the time that’ll be mainline Ubuntu which has always been GTK.

    So if a developer or company is going to target something, then it may come down to “what is the ideal platform to build on for Ubuntu as our main target? GTK? Cool, that’s what we will use.” Of course, either framework is just fine, and either framework targets other OSs as well. I don’t have any experience with either, but it wouldn’t surprise me if the choice of GTK more often is akin to Swift + Apple’s toolkits for iphone development being more popular by a large margin than Ionic/Capacitor, React Native, Xamarin, etc, even though the others provide some benefits (and some significant context-dependent downsides, of course)

    If i remember correctly, Qt was not fully FOSS for a while, so GTK was much more widely adopted and recommended early on. But that was pre-2005, I think.