Live data from Hacker News

Qt 5.7 released

blog.qt.io

41–50 of 108 posts

Re: Qt 5.7 released

#41

Earlier quoted context omitted.

I avoided Qt for a long time due to what I'd heard about moc being required. However recent versions support connecting lambdas to slots which is sufficient for my relatively simple application to avoid using moc to set up signals/slots.

Do you have a link that shows how to compile a Qt app without moc? I looked specifically for this and could only find this, which is unofficial and contains a bunch of ugly macros: https://woboq.com/blog/verdigris-qt-without-moc.html

Just don't use slots.

Re: Qt 5.7 released

#42

I want to like Qt but I hate that it needs moc. Also I don't like that it doesn't use much of the STL - it forces you to use classes like "QVector" and "QList" instead of std::vector and std::list.

Theres a neat project in the works:

https://github.com/woboq/verdigris

Unlike Copperspice, the other MOC-less Qt, this one is API compatible with Qt itself, you just include it and drop the MOC and use its functions instead of the original library ones and it can connect to normal Qt data structures.

And like others have said, you can use as few or as many Qt data structures as you want. The problem is that if you end up using Qt IO, you end up getting QStrings and QVariants, which you usually want to keep that way and end up using containers that recognize those types.

If we had a good C++ var type, and a usable string class, there would be an argument to depreciate whats there, but even Qt cannot do utf-8 right (QString is utf-16).

Re: Qt 5.7 released

#43
post #27
post #12

Earlier quoted context omitted.

While it doesn't have a similar commercial backing, wxWidgets is still going strong and is quite solid.

I always wondered why, after all these years, the only alternatives that remain are wxWidgets and Qt. It's a very common pattern, multiplatform gui programming! and after all this time, we only have 2 choices..

There are a few other choices for multi-platform GUI programming. Just not too many, and the ones other than wxWidgets and Qt are not so well known a.k.a. mentioned so often on the net. But they exist. There's a Wikipedia page with a list of GUI toolkits. I've tried a few of them briefly, earlier. FLTK (Fast Light Tool Kit) and Fox toolkit are two. Some of them are in C/C++ but some of those have bindings for Python, Ruby, etc. IUP is another that seems interesting, saw it recently. Has bindings only for C and Lua, IIRC. It's from the same Brazilian institute where Lua was created.

Also, the reason not too many have become mainstream (like wx and Qt) is probably largely because it's quite a difficult job to create a new one, even on one OS only [1], unless all you are doing is thinly wrapping an existing native toolkit. I read some about this in a book that goes somewhat into the internals of Qt3 or 4.

[1] and cross-platform is harder still.

Re: Qt 5.7 released

#44
post #27

Earlier quoted context omitted.

I always wondered why, after all these years, the only alternatives that remain are wxWidgets and Qt. It's a very common pattern, multiplatform gui programming! and after all this time, we only have 2 choices..

It's an incredibly fast moving target. Just look at the GTK mess, let alone keeping a wrapper toolkit up to date with other vendors' OS updates. Plus for operating systems like Windows it's not really clear which GUI technology to wrap. All the wrappers I've seen so far wrap the old school Win32 API but many modern applications are written in WPF or WinRT. Supporting all three would be difficult. Also OS X is a somew…

>Also OS X is a somewhat different beast in terms of human interface guidelines and form layouts so it's really tough to come up with a unified abstraction layer that both supports new operating system features (and UI paradigms) and still provides a reasonably-sized API.

Good point indeed.

Re: Qt 5.7 released

#45
post #42

I want to like Qt but I hate that it needs moc. Also I don't like that it doesn't use much of the STL - it forces you to use classes like "QVector" and "QList" instead of std::vector and std::list.

Theres a neat project in the works: https://github.com/woboq/verdigris Unlike Copperspice, the other MOC-less Qt, this one is API compatible with Qt itself, you just include it and drop the MOC and use its functions instead of the original library ones and it can connect to normal Qt data structures. And like others have said, you can use as few or as many Qt data structures as you want. The problem is that if you en…

For those interested in such things, verdigris comes from the French "vert de gris", which is the colloquial name for copper oxide (translates to green of grey or grey's green).

Re: Qt 5.7 released

#46

Earlier quoted context omitted.

QML is basically a JavaScript superset ?

Yeah, it's that bad... If all of your code base is C++, what do you think the mindset is of the main developers? The only compromise they were able to allow themselves to think in was... ECMAScript. Sad.

Indeed, what kind of fool picks a UI scripting language most likely to already be used by the vast majority of interface designers.

Re: Qt 5.7 released

#47

I want to like Qt but I hate that it needs moc. Also I don't like that it doesn't use much of the STL - it forces you to use classes like "QVector" and "QList" instead of std::vector and std::list.

>Also I don't like that it doesn't use much of the STL - it forces you to use classes like "QVector" and "QList"

Which are quite better designed, more lightweight and better suited to the GUI tasks -- not to mention take less time to compile when used. Of course if you want you can also use STL.

Re: Qt 5.7 released

#48
post #24

I want to like Qt but I hate that it needs moc. Also I don't like that it doesn't use much of the STL - it forces you to use classes like "QVector" and "QList" instead of std::vector and std::list.

You can use std as much as you want. Qt doesn't force you to use their containers. Moc is not a problem anymore also, it's more an a myth now than anything else.

That may be technically true, but programs using the std containers have to convert at some point if the data has to show up in the GUI. There may be some really clever ways to avoid a bunch of copying and string conversions, but by default there will be a bit of overhead converting back and forth.

I'm not sure what you mean by "Moc is not a problem anymore, ...". AFAICT, Moc is still used by Qt and is at least still in their documentation. http://doc.qt.io/qt-5/why-moc.html I'm personally not too bothered by Moc and see it as a trade off of using Qt. I'd prefer a cleaner "pure" C++ solution, but I don't know of any GUI toolkits as nice as Qt without Moc.

Qt is still my preferred GUI framework, and I use it from C++, Python, and lately Common Lisp. My biggest complaints are the way it's been increasingly tied to Qt Creator and the focus on Qt Quick and QML.

Re: Qt 5.7 released

#49
post #35

Earlier quoted context omitted.

What's wrong with paying for an extremely high quality GUI toolkit? Btw. It's very easy to comply LGPLv3 in proprietary project if you want. 1) If you don't modify the Qt library and link dynamically there is no problem whatsoever. 2) If you modify the Qt library or link statically, it's enough to provide modified version of the Qt library and combined object files that make it possible to relink the application to d…

Many developers feel entitled to get their tools for free, but expect to be able to charge for their stuff, it seems. This is what made RoboVM go comercial AFAIK, as they could hardly make a living from contributions.

That's why we can't have nice things...

Re: Qt 5.7 released

#50

I want to like Qt but I hate that it needs moc. Also I don't like that it doesn't use much of the STL - it forces you to use classes like "QVector" and "QList" instead of std::vector and std::list.

Serious question because I'm curious: what is the problem with the MOC?

Sure, its another build step, but so what? I mean, most large complex software has numerous build steps and MOC is pretty straightforward (and if you use QMake or QtCreator, its pretty much invisible to the programmer). I'm trying to understand why people dislike it so much.

Post reply on HN