
Qt 5.10 released - pyprism
http://blog.qt.io/blog/2017/12/07/qt-5-10-released/
======
hannofcart
Glad to see the update. Most people associate Qt with GUIs which is
unfortunate.

I see that when people think of Qt, they think of WxWidgets, Cocoa or MFC as
alternatives. No, I submit to you that Qt framework is a more elegant, easier
to use alternative to Boost as well.

This is not to say that QtQuick or QtWidgets aren't solid. However, the
success of these two modules ends up occluding the others which to me are the
real gems from the QtFramework: QtCore and QtNetwork.

QtCore provides a solid event loop, the most easy to use implementation of the
observer pattern via its signal-slot mechanism, robust threading utilities and
a bunch of other utilities that make writing apps in C++ an absolute breeze.

QtNetwork for a series of networking utilities that are elegantly simple.

If I were to write a command line app or a database or server, I'd reach for
Qt in a jiffy.

Qt is not just for GUIs!

~~~
Jasper_
I really wish QtNetwork was better. I recently went and had to replace
QtNetwork with our own event loop because it is extremely unreliable on
Windows. The only mention of this is a footnote in the API docs:

[http://doc.qt.io/qt-5/qabstractsocket.html#waitForBytesWritt...](http://doc.qt.io/qt-5/qabstractsocket.html#waitForBytesWritten)

~~~
justinclift
Yeah. It also turns out that _just having_ a Qt application running on a
computer can tank network latency for _all_ applications on the computer:

[https://bugreports.qt.io/browse/QTBUG-40332](https://bugreports.qt.io/browse/QTBUG-40332)

There is a workaround, but developers have to know about it first. And it's
such an unexpected and weird behaviour that 99% of developers don't.

This was our fix (1 line of code), in case that helps anyone:

[https://github.com/sqlitebrowser/sqlitebrowser/commit/739464...](https://github.com/sqlitebrowser/sqlitebrowser/commit/73946400c32d1f7cfcd4672ab0ab3f563eb84f4e)

~~~
nly
Yup, i work on software with a Qt GUI and it took us ages to figure out why
our daemon (no Qt dependencies) would experience latency when the GUI was
open.

For Windows users we now put this var in to global environment via our
installer, and probably break other software in the process.

~~~
justinclift
> ... and probably break other software in the process.

You might also be fixing it for some too, if they're running other Qt
applications. :)

------
dazzawazza
I've coded desktop apps (mostly editors and tools for games) for 25 years
across X (Motif toolkit), Amiga, TOS, DOS, MFC, Cocoa, Win32, WxWidgets, Fox
Toolkit and Qt. Qt has by far been the best, most rewarding, most empowering
experience. It's a great library.

Now Cocoa would win but I prefer C/C++ to Objective-C, it's close though.

Good work people.

~~~
arca_vorago
I'm very interested to hear your opinion on WxWidgets, as I have heard more
desktop app devs endorse it over the years. What features makes QT win out
over it?

Also, I know this might sound crazy, but what about (f/m)asm?

~~~
72deluxe
Not sure on Qt's features as I last used it in the KDE 3.5 days for basic
basic apps, but I have used wxWidgets extensively. The Mac port has improved
significantly recently, although there are still bugs.

It uses the native UI so fits in better with OSes, whereas Qt ones stand out
to me (you can see the buttons aren't native). I did a lot of stuff that was
"owner drawn" so reimplemented OnPaint to draw things myself for custom-look
controls.

wxWidgets dropped its ODBC support a few years back so talking to databases
likely needs another library. Also the ports/HTTP section of it isn't
massively useful so I use libCurl instead.

Despite the bugs, it is quick to build and I found working with it enjoyable.
Some controls (like the wxDataViewCtrl I think) were really slow so I wrote my
own; the OpenGL wrapper works alright but I had to put some work into forcing
it to resize; basically be prepared to put some work in - but it is rewarding.
I like the layout mechanism - makes other systems like MFC look poor!

You can build wxWidgets and force it to use the STL for its container classes
etc; Qt appears to implement everything again instead of just using the
existing STL I think.

The developers are helpful and the forum is useful, at least for basic
problems. I enjoy(ed) using it anyway.

------
mherrmann
I'm an indie dev and have been developing a cross-platform (Py)Qt app for the
past 1.5 years (~2100 dev hrs) [0]. Given that Qt is cross-platform desktop
development, it's very solid. But there are a lot of things one has to do that
are not required for (say) web apps:

* Creating standalone executables / installers for the app itself is already not so easy (I use - and recommend - PyInstaller [1]).

* Code signing the executables so users don't get an ugly "this app is untrusted" warning is tedious for the three different platforms

* Auto-updating is a pain to implement as well. I'm using Google Omaha (same as Chrome) on Windows [2], Sparkle on Mac [3] and Debian packages / fpm on Linux [4]. In total, I probably spent two to three months just on auto-update functionality.

* You really can tell that Qt is "drawing pixels on screen". Sometimes you have to draw pixels / perform pixel calculations yourself. The built-in "CSS" engine QSS works to some extent, but often has unpredictable results and weird edge cases.

I considered Electron as well. But its startup performance is just
prohibitive. I blogged about this (and which other technologies I considered)
[5].

I've been wondering for a while whether I should not open source my solutions
to all of the above problems, to save other people the months required getting
everything to work. Would anybody be interested in that? It would be something
like a PyQt alternative for Electron.

[edit] People are very interested so I'm starting a MailChimp list. If you
want to know if/when I open source a solution then please subscribe at
[http://eepurl.com/ddgpnf](http://eepurl.com/ddgpnf).

[0]: [https://fman.io](https://fman.io)

[1]: [http://www.pyinstaller.org](http://www.pyinstaller.org)

[2]: [https://fman.io/blog/google-omaha-
tutorial/](https://fman.io/blog/google-omaha-tutorial/)

[3]: [https://sparkle-project.org/](https://sparkle-project.org/)

[4]:
[https://github.com/jordansissel/fpm](https://github.com/jordansissel/fpm)

[5]: [https://fman.io/blog/picking-technologies-for-a-desktop-
app-...](https://fman.io/blog/picking-technologies-for-a-desktop-app-in-2016/)

~~~
baldfat
> Creating standalone executables / installers

Python's Achilles heel, this is what caused me to walk away from Python. I
usually make short very specific programs and I work on multiple of sites.
Python was a pain to make executables. I now try to use Racket for everything
and it makes executableson Windows, Linux and Mac.

Has things really improved the last 2 years?

~~~
zbentley
I've seen people use Docker for this purpose, even on Mac/Windows. Personally,
that seems a bit like using a howitzer where a flyswatter will do, especially
since a lot of performance gains are going to be negated by Docker's
virtualization on Mac and Windows.

------
Koshkin
As good as QT and KDE are, I cannot really explain the fact that the most
popular Linux distributions seem to show preference for Gnome; is Gnome more
stable? is the user experience provided by Gnome more "polished"? or, is it
the K-isms that push them away? is Gnome less resource-hungry?

~~~
octorian
While the official story is that it was a political issue (or "licensing
hissy-fit" depending on your point of view), I often can't help but wonder if
that was really somewhat of a cover for a bunch of stuck up C developers who
simply hated C++.

Of course the one time I attempted to write something with Gtk+, it very much
felt like a "We hate C++, so we're going to implement everything C++ does as
conventions and macros on top of C" project.

In the early days, Linux/gcc also had some dynamic linking performance issues
with complex C++ libraries. As a result, KDE apps actually did take a lot
longer to start up than Gnome apps. However, once launched, the KDE stuff
always felt like it actually ran faster. Thankfully those issues are long
since fixed.

~~~
blattimwind
KDE is mostly developed by Europeans (Qt as well), Gnome (and GTK) mostly by
Americans, though this has somewhat diminished over the years. The Gnome
Foundation is registered in California, while KDE e.V. is a German non-profit.

KDE, in a sense, was the original free desktop.

> K Desktop Environment (KDE) was founded in 1996 by Matthias Ettrich, who was
> then a student at the Eberhard Karls University of Tübingen. At the time, he
> was troubled by certain aspects of the Unix desktop. Among his concerns was
> that none of the applications looked, felt, or worked alike. He proposed the
> creation of not merely a set of applications but a desktop environment in
> which users could expect things to look, feel, and work consistently. He
> also wanted to make this desktop easy to use; one of his complaints about
> desktop applications of the time was that it is too complicated for end
> user.

Gnome could be considered an American "but-its-not-all-under-my-gpl" response.

Personally I always found glib and friends always quite ugly from a technical
standpoint, and the poor documentation and support for platforms other than
Linux made me move to Qt quite early on when I started.

~~~
digi_owl
Dunno about KDE, as i can't say i have followed it much since the whole KDE4
mess. But Gnome/GTK is looking more and more Anglo-germanic, and not in a good
way...

~~~
flukus
> But Gnome/GTK is looking more and more Anglo-germanic, and not in a good way

That's weird, AFAIK KDE development is predominately German, Scandinavian and
Anglo and I was under the impression that many key gnome developers were South
American.

------
vram22
Andy Brice has two successful desktop app products, Perfect Table Plan and
HyperPlan [1], and both are written using C++ and Qt, IIRC; I read that on his
blog [2], which I have been following for some time now. Lots of good info
about product development and marketing there.

[1] At least, Perfect Table Plan is quite successful, he has been selling it
for a long time now. HyperPlan is newer, but IIRC he had some sales for it
too.

[2] [https://successfulsoftware.net/](https://successfulsoftware.net/)

~~~
vram22
And seeing a few comments about toolkits being cross-platform, reminded me:
his apps work on at least both Windows and Mac (not sure about Linux, but I do
remember the Qt version I tried earlier works on Linux too).

------
b1gtuna
Is Qt a good, modern framework for desktop application development for a
beginner? If not, can someone recommend something else?

~~~
the_common_man
Electron seems to be the preferred approach these days (much disliked by
people who appreciate native apps). That said most Qt apps don't look native
all the time either (it comes close enough)

~~~
k__
Guess Qt gets more performance?

But more often than not Electron is good enough and there are even approaches
to get JS on the desktop with less memory consumption than Electron.

[https://github.com/pojala/electrino](https://github.com/pojala/electrino)

[https://www.nidium.com/](https://www.nidium.com/)

~~~
seba_dos1
Why would you even want to use JS on desktop if you have other options
available? JS is the choice on the Web, because it's the only choice. It's the
choice on Electron, because you can share the code base with Web version or
make stuff like editors targeted to JS developers, so they can hack them while
using them. But otherwise, it seems like the only worse option you could use
for desktop apps is PHP. Why are people doing it to themselves?

Since we're in a submission about Qt: if you really don't want to touch C++
(which is kinda understandable, although C++ with Qt actually isn't that bad),
Qt is very well supported in Python. Using them together is a breeze, and if
you really do miss the craziness of JavaScript, you can still use it in QML :P

And if QML is what you only care about, you can even wrap it with Rust.

~~~
seanwilson
C++ is packed with undefined behaviour, complexity and cruft. I find
JavaScript and extensions like TypeScript much more pleasant to work with.

~~~
geezerjay
> C++ is packed with undefined behaviour

This alone clearly states that you known nothing abou C++ beyond tired old,
meaningless clichés about irrelevant stuff you've heard somewhere and are
complaining about something you know nothing about.

~~~
seanwilson
How? Has C++ eliminated undefined behaviour recently? Yes, you can avoid it
but it requires years of experience, a significant cognitive load as you work,
linting/testing tools and you have to hope all the libraries you're using plus
your team members have the same high standard that you're trying to follow
yourself. I used C++ for years and knowing there are other languages out there
I have no interest in making life hard for myself.

~~~
geezerjay
> How?

Because you're repeatedly showing profound ignorance on very basic aspects of
using a programming language.

> Has C++ eliminated undefined behaviour recently?

You are aware that you're parroting on and on about an entirely irrelevant
issue, don't you? I mean, any behaviour which has been left undefined in the
international standard only means that there is a chance that two
implementations may not implement the same obscure aspect exactly alike. And
that's perfectly fine because these obscure corner cases shouldn't be used to
begin with. That's what undefined behaviour does mean in practice.

But even if you for some obscure and irrational reason care enough to rely on
behaviour left undefined then you also go another standard approach: adopt a
specific implementation and check how the behavior was implemented.

Additionally, rust and go and python and other programming languages are not
defined at all and somehow programmers don't get bothered by the fact that
these programming languages are entirely undefined. But somehow you feel
differently about a language you clearly know nothing about.

~~~
seanwilson
> But even if you for some obscure and irrational reason care enough to rely
> on behaviour left undefined then you also go another standard approach:
> adopt a specific implementation and check how the behavior was implemented.

By undefined behaviour, I mean things like null dereferences, buffer
overflows, memory leaks etc. that are done by accident and result in serious
issues at runtime. I'd rather use a safer language where I can be more
productive where possible.

Sounds like you're talking about implementation defined behaviour or
unspecified behaviour which are different from undefined behaviour (these
three terms are defined in the C++ standard document).

> But somehow you feel differently about a language you clearly know nothing
> about.

You're not even trying to understand the point you're leaping to attack. You
clearly have a chip on your shoulder about something.

------
royjacobs
This is awesome. I can't wait for the KDE binding generator to mature so we
can finally start using it more properly from Rust.

------
dndneux
I enjoy using QML together with Python 3 for the logic, with the PyOtherSide
plugin: [https://thp.io/2011/pyotherside/](https://thp.io/2011/pyotherside/)

------
inetknght
Is Qt 5.10 still stuck in the time prior to C++11? Does it have clear pointer
ownership and move semantics?

~~~
gusmd
Qt has moved into C++11+ world for quite some time. IIRC 5.7 was an important
step in that direction, and they keep moving that way.

Move semantics are much better. Not sure what you mean by clear pointer
ownership, though.

~~~
inetknght
`unique_ptr` and `shared_ptr` semantics

~~~
gusmd
Qt does have QSharedPointer and QWeakPointer. Also, you can use QScopedPointer
for things like implementing RAII with custom deleters, etc.

------
nikanj
Qt used to be an absolutely awesome C++ framework. Then Nokia happened, and it
turned into a weird Rapid Development Environment™ for Symbian®©.

Does anyone have up-to-date experience with Qt? It's quite clear Symbian is no
longer the main target, but did they ever get back to treating C++ as a first-
class citizen, or is it still all about QML?

~~~
majewsky
Not sure what you're talking about. Qt 5 didn't remove anything that was there
in Qt 4 [1], and added quite a few nice things like native Wayland support and
more OpenGL integration.

Sure, the main development focus is on QML etc., but that's mostly because
desktop is a more mature platform than mobile.

[1] Except for the QtWebkit to QtWebengine transition perhaps. I haven't
followed that very closely.

~~~
nikanj
The main development focus is the very thing I was curious about. I remember
Qt being slow to support new things eg. high dpi, unless you were using QML.

Getting the "feel" of a company's priorities can be hard, if you're not
actively using their platform. I was hoping someone on HN had a somewhat
realistic picture of where Qt is going these days.

~~~
casione
It looks to me like they're very underfunded and have completely lost focus.
The high DPI "debacle" is a good proof of it.

~~~
shaan7
Sure /s. We have a Qt app with GUI completely written in Qt. Scales pixel
perfect on HiDPI out of the box as long as you make sure to not hardcode pixel
values.

------
j_s
November 2017:
[https://news.ycombinator.com/item?id=15617359](https://news.ycombinator.com/item?id=15617359)

>pknopf: _This reminds me of the project I am currently working on.

.NET/QML [https://github.com/pauldotknopf/net-core-
qml](https://github.com/pauldotknopf/net-core-qml)

Not quite production yet, but it will be soon. I'd love to he[ar] some input.
You can check the unit tests for how things are working currently._

------
billfruit
Haven't used QT in a long time.Have they done away the with ’moc' and code
generation? I found it extremely annoying that while we were using QT we
weren't actually using c++, but a strange, language that looked like c++, but
was actually further processed by qt to generate the c++ code. Are they done
with that shebang?

~~~
iKlsR
Without moc their is no signal slots and the handy stuff you get from plopping
Q_OBJECT in your derived classes. So it's not going anywhere.

~~~
billfruit
Can't they figure out a way to do that in pure c++ yet? In other words why
does C++ lack reflection, and only seems to have a half baked RTTI? Perhaps
the QT guys and other c++ application programmers didn't lobby C++ standards
committee strongly enough for that?

~~~
dkersten
Sure, but there's 1) a performance hit because things that can be done at
compile-time currently, have to be done at runtime, and 2) syntactically
verbose/cumbersome. They've decided that these things are not worth it to most
people.

Besides, it still is C++: you can totally compile everything without the moc
(although its probably not very useful to do so), since the extra keywords are
just #defines.

I've personally never had any issues with the moc (but I did only ever use
QtCreator/qmake, so...)

------
shmerl
This is also an interesting project, if you want to use Qt with Rust:

[https://phabricator.kde.org/source/rust-qt-binding-
generator...](https://phabricator.kde.org/source/rust-qt-binding-generator/)

------
eql5
BTW, if you like both QML and Common Lisp, and want to reach for android,
there's news: EQL5-Android
[https://gitlab.com/eql/EQL5-Android](https://gitlab.com/eql/EQL5-Android)

------
DonHopkins
What JavaScript engine is Qt 5.10 using, and have there been any recent
changes to that engine, or the way it's integrated with Qt?

------
billfruit
Annoying thing with QT, the official pronunciation sounds like ’cute’, and
some interviewers insist on calling it that.

~~~
manyoso
Lots of people in the company call it 'Q' 'T' and lots call it 'Cute' and
there is no "official" way it is called.

~~~
billfruit
See Wikipedia:
[https://en.m.wikipedia.org/wiki/Qt_(software)](https://en.m.wikipedia.org/wiki/Qt_\(software\)),
it says pronunciation is 'cute'.

------
stratigos
R.I.P. QtWebkit

------
liquidnitro02
Awesome cant wait to check out the new features!

