Hacker News new | ask | show | jobs
by wb14123 2753 days ago
I'm wondering why people don't write cross platform applications with Qt.
9 comments

I think c++ (and qml to some extent) scares people vs. JavaScript, where you have thousands of libs for every situation to back you up
You can write it in Python is you're scared of C++. QML let's you inline JavaScript, or call it from a file.

Qt comes with 5, 000 classes for every situation to back you up, before you need to go to the community.

I think that a lot of developers are simply scared of it, without just cause. They believe rumours, without ever actually trying to use the thing. They don't evaluate first.

pyside and pyqt4 both take away a lot from the power of qt. Not worth it if you ask me.
Because most Electron apps are JS devs working around browser issues by packaging a single browser with the application.

I look forward for the Electron wave to fade away just as MSHTML and XUL waves died before it.

Only there never where any big MSHTML and XUL waves.
I surely remeber quite a few on the enterprise space and plenty of XUL based installers.
Does Qt have the same features as Flutter? I'm thinking about an excellent IDE, hot reloading, ability to target mobile and desktop etc.
* Excellent IDE

Yes. It's well-written C++. Any IDE can handle it, but the also have their own which gives you a few more things, like drag'n'drop design.

* Hot reloading

Depends.

Old-school Qt? No. It's more powerful, but can't hot reload.

New-school QML? Yes. But you are limited to QtQuick, which is only on-par with Electron's features.

* Ability to target mobile and desktop, etc.

Yes. Supported targets include: Windows, UWP, Linux, macOS, Andorid, iOS, watchOS, tvOS, QNX, and other embedded platforms.

C++ is harder to use, so developers are more expensive to hire.

QT is either GPL which is viral i.e. you have to open source your software under the same license, or quite expensive. Even if you’re working on open source GPL software, free QT edition has less features, esp. on embedded.

> QT is either GPL which is viral i.e. you have to open source your software under the same license,

it is not.

Technically, LGPL option allows using in proprietary software. Practically, static linking is often better e.g. makes executable much smaller. And even with dynamic linking, see this note from https://blog.qt.io/blog/2009/11/30/qt-making-the-right-licen...

> If you are shipping an executable, you must include any data and utility programs needed for reproducing the executable (i.e. must provide components needed to recompile with a new version of the library) unless such data and utility programs are normally distributed with the major components of the operating system on which the executable runs

For developers of proprietary software, flutter’s BSD 3 clause license is way easier to comply.

Because, unless you want to build your applications statically (which I've done), it requires a large client runtime installation?
Are there any good examples of a cross platform application written in Qt that is available on iOS, Android, Mac, and Windows?
Well, you still have a pretty large run-time with Qt. If you want something slim, you can use neither Electron nor Qt.
Because qt UI is in all ways worse than what browsers can already do. All qt does for displaying web pages is it embeds chromium, same as electron does. Trying to tie c++ to that is shooting yourself in the foot if you can just use node, which electron does.
> All qt does for displaying web pages is it embeds chromium, same as electron does.

It doesn't:

> WebView is a component for displaying web content which is implemented using native APIs on the platforms where this is available, thus it does not necessarily require including a full web browser stack as part of the application. [0]

[0] http://doc.qt.io/qt-5/qml-qtwebview-webview.html

It does. https://wiki.qt.io/QtWebEngine

Webview is unreliable and not used by electron apps for a reason, you cannot control anything about it. You're stuck with whatever native browser the system has. That's alright for basic things, but hardely what you'd sanely deploy tech that relies upon modern js.

Not sure what's meant by 'native browser.'. My last gui app used qt-webkit and webviews. It's not chromium and very controllable...
Native browser meaning the systems browser, like safari, or edge.
Because Qt is bad. Do you think after nearly a quarter of a century that its problem is that it's just like, not well-known enough?
Correlation != causation.

And even if that was the reason, your response didn't make anyone any smarter. How is it bad? Which you can't answer, because your only line of reasoning is that it has to be bad, because it's not as popular.

The UI is bad imitations of native widgets and has been forever. Always in the uncanny valley, except if you're running only KDE.

The setup of IDE/building/ etc is harder than it should be.

PyQT has mostly been the unloved stepchild, with third rate support.

Compile times with C++ are awful.

Major breaks between versions (QT4 vs 5 etc).

bad how?