Live data from Hacker News

Show HN: Cross-platform desktop applications with PyQT

github.com

271–280 of 293 posts

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

#271
post #232

Earlier quoted context omitted.

Neither are as good as 99% of the tools available for development with HTML/CSS. Plus, with HTML/CSS, you can work manually on your project, without any special tool besides your browser, and see the effects you have on the layout in real time. Delphi/Qt Designer look way worse than any HTML/CSS/JS GUI builder, too - along with having interfaces equivalent to what GIMP's is to Photoshop.

But what exactly do any HTML/CSS do for me that I could not do with a 17 years old copy of Delphi? And the resulting application will be harder to use, bloated, and much slower than a Delphi one (let alone using something more modern). I can understand the cross-platform angle, but not ease of development (unless you are limiting yourself to the very, well, limiting subset of interactions and controls that are easy t…

It can do a bit less, if you're opting to go with pure HTML/CSS; however, without JS, pure HTML/CSS is quite snappy if done well, and infinitely easier to write, from my experience. It's also easier, in my opinion, to make nice looking interfaces with.

Don't get me wrong, I love native applications—but saying that they're easier to develop than something in HTML/CSS is, generally speaking, not true.

Granted, I'm far worse of a programmer than a designer, so I might be missing out on what's good about Delphi because of it.

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

#272
post #181

Coding is only a part of my job. I am currently building an application for our warehouse, connecting our ERP to some external services. Lots of moving parts across several machines. In the middle is a tiny GUI, which has been more trouble than the rest put together. I used Tkinter to minimise dependencies. I am staggered by how much code it takes to get a GUI working (compared to the rest of the project), and this i…

How would javascript reduce the code necessary for a gui or help you cross platform? UIs are very different between phone / desktop so even if you stayed with javascript you'd be learning different libraries or rewriting everything to conform to the other platform. Personally, I tend to use QtDesigner to layout apps and Qt for implementation (this applies for PyQt/PySide or C++). It tends to reduce the code necessary…

PyQt is really difficult for me to use because of the license, I'm afraid.

In all of the comparisons I found on different frameworks the criticisms of Tk all seem to be about the looks (in that it didn't take on native styles), but that seems to have been resolved. It doesn't affect my in house use case either. The other thing mentioned is that Qt has more widgets. I don;t need those right now. Therefore it would seem that for simple in house software Tkinter was a pretty fair choice.

> I feel like there's a bit of roughness conceptually between Qt and Python that are just fundamental, but I think that's more on Python and asynchronous needs of UIs.

I can't get over this. I am not a good enough scientist to explain what the problem is but there is something that just doesn't feel right with Python GUI programming.

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

#273
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.

The desktop app was using 4GB of ram on my workstation (Centos 7), so I stopped using it.

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

#274
post #181

Earlier quoted context omitted.

How would javascript reduce the code necessary for a gui or help you cross platform? UIs are very different between phone / desktop so even if you stayed with javascript you'd be learning different libraries or rewriting everything to conform to the other platform. Personally, I tend to use QtDesigner to layout apps and Qt for implementation (this applies for PyQt/PySide or C++). It tends to reduce the code necessary…

PyQt is really difficult for me to use because of the license, I'm afraid. In all of the comparisons I found on different frameworks the criticisms of Tk all seem to be about the looks (in that it didn't take on native styles), but that seems to have been resolved. It doesn't affect my in house use case either. The other thing mentioned is that Qt has more widgets. I don;t need those right now. Therefore it would see…

Yeah, Tk just looks and behaves (as a gui) very crudely, but my preference for other gui libraries was always ease of use, organization, and troubleshooting. Verbosity would go under ease of use and organization. I think Gtk and/or Wx had a gui to layout widgets, but it was so far behind Qt. I still don't have a preferred way to organize Qt code, but it offers almost too many options. The main book on PyQt, Rapid GUI Programming with Python and Qt, doesn't use Designer and all the guis are done programatically. It's a great way to learn the library, but horrible for maintenance.

Most of the guis Ive needed just use basic widgets. I've poked at the browser and opengl widget, but never really used them. I have had to add custom behaviors to widgets to match other apps and it seemed pretty well suited. Funny enough, the Qt organization has stopped development on Widgets over 5 years ago (which is all I've ever really used). They consider Widgets feature complete and are focusing on QML.

> there is something that just doesn't feel right with Python GUI programming.

I think it's because GUIs, by their nature, are event driven and require parallel execution. Python doesn't do this very well so there's awkward syntax, a few competing paradigms, and unexpected behaviors (with memory, code flow, etc). I can see an argument for Javascript in this regard.

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

#275

Earlier quoted context omitted.

In my case, it was Electron's startup performance that made me go for PyQt [1]. [1]: https://fman.io/blog/picking-technologies-for-a-desktop-app-...

I am happy you found something that worked for you. But to me, I'm just very frustrated. People consistently suggest Qt is a net good because Electron uses more RAM and just totally abandon accessibility. The proliferation of Electron is one of the single most progressive things to happen on the front of general desktop application accessibility for folks with special visual or motor control needs since OS's started…

Thank you for caring about accessibility. However, I don't think the pros and cons between Qt and Electron are as straightforward as you may think.

First, Qt accessibility on Windows is improving:

https://blind.guru/qtwin.html

This blogger specifically mentions the JAWS screen reader, but this should also help users of the Narrator screen reader built into Windows.

Speaking of which, Electron is not very accessible with Narrator. The reason is that Chromium implements IAccessible2, a non-Microsoft extension of the old Microsoft Accessibility API. Since IA2 is not a Microsoft API, Narrator doesn't support it.

Also, one of my blind friends told me a few months ago that Electron apps are inaccessible on Linux. I haven't yet verified this myself. Qt is accessible on Linux, though I don't know how it compares with GTK.

I don't know what the situation is on Mac.

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

#276
post #232

Earlier quoted context omitted.

But what exactly do any HTML/CSS do for me that I could not do with a 17 years old copy of Delphi? And the resulting application will be harder to use, bloated, and much slower than a Delphi one (let alone using something more modern). I can understand the cross-platform angle, but not ease of development (unless you are limiting yourself to the very, well, limiting subset of interactions and controls that are easy t…

It can do a bit less, if you're opting to go with pure HTML/CSS; however, without JS, pure HTML/CSS is quite snappy if done well, and infinitely easier to write, from my experience. It's also easier, in my opinion, to make nice looking interfaces with. Don't get me wrong, I love native applications—but saying that they're easier to develop than something in HTML/CSS is, generally speaking, not true. Granted, I'm far…

Well, it had always taken me far less time and effort to do a nice, interactive app in Delphi than it would in HTML/JS.

For a designer, yes, I can see your point -- it's easy to use markup to make something that looks good (or at least this month's fashion for web pages good) quickly. It's when you want to add any kind of sophisticated behavior and non-standard UI (i.e. exactly why you would want to have a desktop app instead of just using a browser in the first place) where even old Delphi would be far superior. And the result would actually look like a native app, too.

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

#277

Earlier quoted context omitted.

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 World Hello 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 formattin…

Please tell me you're trolling... you actually want your software to run when there're errors and not have it blow up in your face? I don't even... ah screw it.

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

#278
post #213
post #167

Earlier quoted context omitted.

Why are JavaScript programmers even relevant? Do they, as a group, have some desirable skill other than "will code for food"? At least successful C++ programmers HAVE to be decent-ish. The language is unforgiving.

You're of course welcome to your opinions, but I strongly suspect that you need more experience as a developer to understand the answer to your question, if you don't have a sense of what things are demanding in JS and if you think that being able to write C++ is clearing some sort of high bar.

I write code using JavaScript and C++ on a daily basis. I would hire a successful C++ dev over a successful JavaScript dev for cross-platform work. There are too many issues.

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

#279

Earlier quoted context omitted.

PyQt is just the Python binding for Qt, so don't expect a fully polished website there. If you really want to compare Electron with QT, I suggest looking at the main QT website: https://www.qt.io/ Also, having developed apps in both frameworks I would say that it's easier to get started with Electron if you come from a HTML/CSS/JS background, but apps written in QT look more native and like "real" desktop apps to me.…

It's not crazy to expect a UI toolkit website (even if it's just the bindings...) to have a better presence/pitch to make the sell. UI toolkits are built on how good they look and what they enable you to do, and the last thing PyQt should be doing is forcing people to check out a very marketing-heavy Qt main page.

That's not true, Qt itself doesn't look like anything. It's the style engine that matters in this case. The framework itself is interesring from the API viewpoint.

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

#280
post #276

Earlier quoted context omitted.

It can do a bit less, if you're opting to go with pure HTML/CSS; however, without JS, pure HTML/CSS is quite snappy if done well, and infinitely easier to write, from my experience. It's also easier, in my opinion, to make nice looking interfaces with. Don't get me wrong, I love native applications—but saying that they're easier to develop than something in HTML/CSS is, generally speaking, not true. Granted, I'm far…

Well, it had always taken me far less time and effort to do a nice, interactive app in Delphi than it would in HTML/JS. For a designer, yes, I can see your point -- it's easy to use markup to make something that looks good (or at least this month's fashion for web pages good) quickly. It's when you want to add any kind of sophisticated behavior and non-standard UI (i.e. exactly why you would want to have a desktop ap…

Native applications vary too wildly, in my opinion. HTML/CSS/JS make it easy to get a consistent UI, which is incredibly valuable if you're making software for less technically advanced people than your average HN poster.

Discord's a highly admirable, semi-complicated web application, that extremely benefits by not looking native, in my opinion. The interface of it is miles ahead of any native desktop VOIP/Text client I know of, and I don't think it'd have been done without Electron.

Of course, I'll agree that generally nothing more complicated than that should be anything but native.

Post reply on HN