Live data from Hacker News

Show HN: Cross-platform desktop applications with PyQT

github.com

111–120 of 293 posts

Re: Show HN: Cross-platform desktop applications with PyQT

#111
post #87

Earlier quoted context omitted.

"Any Javascript UI experience that I picked up 5 years ago is obsolete." That is only true in the sense that your Python 2.x experience didn't translate into your Python 3.x experience. That is, I think the overlap is similar on a language level. The difference lies in the libs/frameworks.

No its nothing like a minor language change. This actually happened to me and my Javascript UI experience (Jquery) is obsolete in the world of React and Angular or whatever the flavour of the month is.

If you learned Javascript and not jQuery then your experience is just as relevant today, with the main difference being that Javascript has had a lot of improvements since then (e.g. myArray.includes vs myArray.indexOf(x) != -1).

Even jQuery is still helpful if you think of how it's accessing the DOM rather than just a set of magic functions to make things happen.

If you know Javascript you can learn Angular or React or Vue fairly quickly.

Re: Show HN: Cross-platform desktop applications with PyQT

#112
post #32

Earlier quoted context omitted.

What do you mean? I've uninstalled the Slack desktop app and just use the website because the app is such a terrible experience.

Wow. You realize they share most of the same code, and are essentially feature identical? Seriously, open the desktop app, then open the web app. They're identical. Precisely because they chose to use a toolkit that let them easily handle cross platform issues with UI in a sane and repeatable manner.

If that's the case, then the desktop app buys you absolutely nothing over just using the webapp. In fact, now you have to have multiple instances of your browser running, instead of just one.

Re: Show HN: Cross-platform desktop applications with PyQT

#113
post #110

Serious question: Why do so many people think building desktop application GUIs with web-technologies is a good idea? I'm currently trying to formulate some thoughts on this; While I understand that HTML/CSS generally seems more flexible and may be more easily accessible to more/newer devs, it carries huge, negative implications in the forms of HCI (not having consistent interface elements on the user platform), perf…

It appeals to people who regard desktop resources (memory, CPU cycles, etc.) as functionally unlimited. Thus, there's no reason to worry about low-level efficiency, such as with C or C++. So why not use all the technologies you already know and use everywhere else, like JavaScript?

I don't know if I agree that it's the best tool for the job, but I can see the appeal to someone whose world is JS and Python only. Especially if memory management is a foreign and scary world to them - and having done it, it certainly is scary!

Re: Show HN: Cross-platform desktop applications with PyQT

#114
post #32

Earlier quoted context omitted.

What do you mean? I've uninstalled the Slack desktop app and just use the website because the app is such a terrible experience.

Wow. You realize they share most of the same code, and are essentially feature identical? Seriously, open the desktop app, then open the web app. They're identical. Precisely because they chose to use a toolkit that let them easily handle cross platform issues with UI in a sane and repeatable manner.

> You realize they share most of the same code, and are essentially feature identical?

Yes. So why would I run essentially a second web browser instance to run the same code in a different place?

Beyond that, I had with weird screen refresh issues with the desktop app, where scrolling or even just typing in the text box would cause parts of the main HTML view to just disappear to the point where it'd be unusable. Often images wouldn't load, or would load, but then have the same disappearing issue. Restarting or refreshing the UI wouldn't help. I'd have to restart the app every couple days anyway due to ballooning memory usage. Hell, even the font rendering was weird and didn't match what I'd see by opening a regular Chrome window. I reported the issues to Slack, but never heard back, and after waiting through several releases for a fix, over a period of months, I gave up.

> ... let them use a toolkit that let them easily handle cross platform issues with UI in a sane and repeatable manner.

That's not what I want. I want apps that fit in with my desktop, not apps that look the same across OSes, ignoring platform idioms and style/placement standards.

Re: Show HN: Cross-platform desktop applications with PyQT

#115
If this comes to fruition it would be great. I, wanting to start a new commercial desktop app, recently researched using Python/PyQT. The packaging situation was not good so I decided on another technology but I'd love to be able to use Python and reliably create a desktop app installation. The PyQT license cost doesn't bother me if I could use it. Certainly cheaper than Delphi.

Re: Show HN: Cross-platform desktop applications with PyQT

#116
Every time this argument comes up, I see the same tired comments, and they're typically from people that don't have to build a modern UI. There is an insane amount that you get for free in HTML/CSS/JS, and it's very clear why things like Qt & co don't stack up.

Here's a small list (which could easily be a much bigger list) of things that are much easier in web dev land than their native counterparts.

- Want to chart some data with nice animations? The chart library in Qt is good... until you need to make it look sexy. If you're in HTML/CSS/JS, you can just reach for an unlimited number of alternative libraries to pull from. (No, saying "go without the animations" isn't an answer.)

- Universal stylesheets are a godsend for quickly iterating on UI. Qt's stylesheets do not come close to the abilities that modern CSS provides you (and frameworks beyond Qt often lack something even close to this). Saying "CSS shouldn't be doing this stuff" isn't an answer, because the alternatives are simply less productive. It's absolutely amazing to be able to target an arbitrary node in a nested structure and tell it to behave differently, and have the entire thing render appropriately.

- You want smooth scrolling (that matches the OS behavior...) at 60fps? There is an untold amount of work that each browser vendor has put in to this effort, and the benefit is greatly undersold. Ever looked into wxWidgets? You have to go out of your way to make a scroll view bounce on macOS. That is utterly insane in 2018 - and no, saying "why does Mac need to be different?" isn't a solution. The entire point of cross platform development is that it should handle this.

- Have you ever tried to optimize scrolling on a TableView in Qt/wxWidgets/Cocoa/etc? Give me HTML/CSS/JS any day of the week.

- This point is slightly separate, but... I've written Python for over 10 years now, and I would not want to write a UI in Python. The language is one of my favorite and works well for most things, but UIs are often just kind of hacky - Python isn't a language that's ideal to write hacky code in. I'd sooner do it in Ruby or something.

Want the tl;dr? There is no other frontend community that even comes close* to the wide range of documentation, available libraries, built-in/free benefits, approachability, and general "it'll just work" feeling across platforms.

I write native UI code daily, and the writing is on the walls for it. Tangentially, this is very much why I suspect Apple is looking to merge Cocoa and UIKit more - it's the only way native Mac apps survive (oh, and even Apple renders significant chunks of some of their apps with Webkit... three finger swipe right on your trackpad if you wanna see some ancient Webkit app history).

* - _maybe_ UIKit for iOS comes close, due to Apple's vendor lock in factor and focus on UI, but that's something that a) rarely extends back to macOS apps and b) usually winds up splintered between Objective-C/Swift implementations.

Re: Show HN: Cross-platform desktop applications with PyQT

#117
post #99

Earlier quoted context omitted.

As a developer, Electron's page shows their prowess in writing good front end code, which is really important. As someone who understands the basic concept of Electron, I want a product that demonstrates those competencies.

I get what you're saying, but "writes good web front end code" isn't on my list when I'm looking for a good Desktop development framework. I think stuff like this is pretty tribal, which is OK, but we should confuse it with decisions made on technical or experience merits.

We shouldn't, but we will.

We're still savanna primates, and silly little things like technical merits aren't going to get in the way of sexy shiny. Projects that understand this fact will attract developers and flourish, and those that don't will languish in forgotten obscurity.

Re: Show HN: Cross-platform desktop applications with PyQT

#118
post #4

The main problem with "other toolkits" vs Electron apps is that they are not as simple to use in order to create a very good looking UIs. Compare how easy it is to use HTML and CSS in order to create a very complex UIs with all sort of effects vs how utterly complicated is to override, let's say, Qt's ::paint() method in order to achieve rich text inside a label. Let me repeat it. Rich text inside a label. Such a sim…

I would disagree with this as I've created many small apps using QT, and getting started is much easier than with Electron (in my opinion). It is as easy as this: import sys from PyQt5.QtWidgets import QApplication, QWidget if __name__ == '__main__': app = QApplication(sys.argv) w = QWidget() w.setWindowTitle('Hello, world!') w.show() Also, styling apps in QT is really easy, in fact you can even use CSS: http://doc.q…

At least in nw.js which is a similar toolkit to Electron:

{ "name": "helloworld", "main": "index.html" }

And index.html is just whatever HTML web page you want, like "Hello WorldHello World". You could also use a javascript file as your "main" file if you want.

Even when you screw up the HTML it will still load, which won't happen if you get your underscores wrong in your example.

Edit: removed erroneous formatting

Re: Show HN: Cross-platform desktop applications with PyQT

#119
post #110

Serious question: Why do so many people think building desktop application GUIs with web-technologies is a good idea? I'm currently trying to formulate some thoughts on this; While I understand that HTML/CSS generally seems more flexible and may be more easily accessible to more/newer devs, it carries huge, negative implications in the forms of HCI (not having consistent interface elements on the user platform), perf…

What has happened is that "we" have divorced software from hardware by adding an increasing number of abstractions.

There is a increasing number of people that never had to deal with boot sectors or config files to get a computer up and running, they just hit a button and a few seconds later it lights up in massive colors and sounds.

And the only languages they know are web related languages, because that was the thing to know when they got interested in computers. And as the saying goes: When all you have is a hammer, all problems looks like nails.

Re: Show HN: Cross-platform desktop applications with PyQT

#120
post #110

Serious question: Why do so many people think building desktop application GUIs with web-technologies is a good idea? I'm currently trying to formulate some thoughts on this; While I understand that HTML/CSS generally seems more flexible and may be more easily accessible to more/newer devs, it carries huge, negative implications in the forms of HCI (not having consistent interface elements on the user platform), perf…

> it carries huge, negative implications in the forms of HCI (not having consistent interface elements on the user platform)

This is a double-edged sword for multi-platform apps, but isn't a drawback for monoculture environments.

> Can someone please give me some arguments as to why this not only seems like a good idea, but also why it's the best tool for the job?

For a certain class of apps (such as IDEs), its a great idea due to the ease of extensibility as well as making multiplatform releases effortless. I doubt VS Code would have been available for Linux had it used a non-web-tech stack, and it has displaced PyCharm for some of my lighter tasks. PyCharm is written in Java, so it's also not native, but it's the best IDE in the world, IMO.

Post reply on HN