News for hackers. Stuff that matters.
Re:A Book about Qt5 by trishume on Thursday January 21, 2016 @11:33AM (#10946319)
I read this book a while ago and it was pretty good.

Qt5 is really underused for how good it is. It's a really good platform for making native apps and it even has bindings for many different languages.

And since it can be used for IOS&Android apps it's a great competitor to React Native. It is reactive and declarative like React but with way less boilerplate and everything is so much easier to do, and it supports more platforms. The only thing React Native has on it is native looking widgets for IOS, but if you plan on using your own design anyway, that's not a problem.

You get the productivity of a modern reactive framework with the completeness of Qt. It has things like a GUI builder that modifies and generates code for you, and the code it outputs is close to what a human would write, so you aren't locked into it.

Re:A Book about Qt5 by PeCaN on Thursday January 21, 2016 @11:45AM (#10946400)
I really want to like Qt5, but it's just so... big, and using it from C++ is so cumbersome. I don't suppose you're familiar with any quality Rust or Nim or D or some other compiled-language-that-sucks-less bindings? There's https://github.com/cyndis/qmlrs, but that seems very incomplete/sketchily maintained so far (which is the problem with most bindings that I know of).
Re:A Book about Qt5 by trishume on Thursday January 21, 2016 @01:05PM (#10947019)
The trick is that Qt5 != Qt Quick. There aren't many bindings to Qt5 since the binding surface is enormous and very C++-like.

The QML bindings for other languages don't have to cover much surface area though. They look minimal but most of them are eminently usable because all the UI logic is in the QML+JS, all you need in a binding is a way to pass data in and out.

D, Rust, Go, Ruby, Python, etc... all have good enough bindings, that work for now and even if they do need some patching, aren't that big or hard to patch yourself. I've never used them myself (I just use C++, but I plan on using D for a QML app someday), but I know some other projects that do like https://github.com/limetext/lime

Re:A Book about Qt5 by baldfat on Thursday January 21, 2016 @02:51PM (#10947808)
I now want to see if I can pull off the bindings for Racket using FFI Library. http://docs.racket-lang.org/foreign/

Something to do while snowed in.

Re:A Book about Qt5 by fineIllregister on Friday January 22, 2016 @04:59AM (#10951828)
Something I've thought about, too. Dr Racket especially would benefit from a Qt version.
Re:A Book about Qt5 by rhodysurf on Thursday January 21, 2016 @11:53AM (#10946477)
Ive been contributing to this when I have free time https://github.com/salviati/go-qt5 . I am a C++ Qt 5 dev by day so its been a fun little project. Far from complete though.

The only really complete bindings for Qt 5 are PyQt5 but its not compiled so its out for me. There are solid qml bindings for go and the rust ones worked fine last time I tested. Im not really a big fan of QML though. Its really much different than using widgets and Im not a Javascript dev by any means.

Re:A Book about Qt5 by digikata on Thursday January 21, 2016 @12:50PM (#10946901)
Qt5 is big in its entirety, but I've found when I've sat down to do a quick gui app in C++ that the development goes reasonably quickly. It's been nice for me in desktop and embedded environments.

The QML side of things I've never tried, and the QML based bindings to other languages in general seem less mature than the C/C++ bindings. I'm keeping an eye on go-qml though.

Re:A Book about Qt5 by oblio on Thursday January 21, 2016 @11:55AM (#10946494)
The best bindings are the ones for Python" PyQt (I know it's not compiled, but it's definitely a nicer language than C++). Unfortunately, it's an absolute pain the butt to try to use those on mobile, especially since Python does not build out of the box on any mobile platform (!).
Re:A Book about Qt5 by PeCaN on Thursday January 21, 2016 @12:04PM (#10946559)
I like PyQt except that it's a pain to deploy anything written in it on Windows—though to be fair, I haven't tried for a couple years!

I wonder if PyQt works with Cython. That could be interesting.

Re:A Book about Qt5 by vetinari on Thursday January 21, 2016 @02:18PM (#10947557)
I used to have a good experience with py2exe in the past. We used it in production, to deliver exes to end users.

Because it looks abandoned nowadays, I've tried pyinstaller recently. It worked OK, too; the only thing that was slightly annoying was pulling in the Windows 8/2012 (api-ms-win-*) style system dlls.

Re:A Book about Qt5 by mfgs on Thursday January 21, 2016 @04:31PM (#10948546)
Lately I've been using Python/PyQt with Nuitka, which transpiles the Python to C++ and then compiles it into a standalone exe + dlls. It (more or less) just works too, very cool indeed!
Re:A Book about Qt5 by kyzyl on Thursday January 21, 2016 @05:12PM (#10948861)
Hey -- I've got a question about that use case. So I'm familiar with Nuitka (and all the rest... ugh) but in my brief tests using it I couldn't really get it to work with any of my python code that did anything real.

For example, if I had anything that used numpy (which is most of my code) or Qt, or a lib that uses opengl, it would either fail outright saying "can't find blarg" or it would spin forever. Now I understand that the process of transpiling something huge like numpy and then compiling it will be fairly demanding, but I've literally left this stuff running in a tmux session for a day or two and it showed now sign of ever finishing.

I'm not asking you to debug my stuff or anything, but have you had a different experience? Is there a trick to getting Nuitka to build code that leverages the python ecosystem? I would really like to figure this out, because the alternatives are really quite terrible, IMO. If Nuitka can be made to work with build times less that a week, I think he's really on to something.

Re:A Book about Qt5 by mfgs on Thursday January 21, 2016 @09:57PM (#10950471)
Huh, strange. My standalone build sucked in numpy and PyQt4 (but not PySide) no troubles at all. I did have a minor problem with ctypes (explicitly importing _ctypes was required), but apart from that surprisingly smooth sailing. I have tried Cython briefly but Nuitka seemed a lot easier; just point and go. No modification to the source code needed and I ended up with a nice .exe and a bunch of .dll and .pyd files (including those for numpy and PyQt4). Build time was 30 minutes for a small-medium size application (25000 lines) in Python 2.7.
Re:A Book about Qt5 by janimo on Thursday January 21, 2016 @12:01PM (#10946535)
go-qml is good enough for small apps, but it's QML only and not very actively maintained unfortunately.
Re:A Book about Qt5 by rhodysurf on Thursday January 21, 2016 @11:57AM (#10946503)
I love Qt for cross platform desktop apps (everything looks quite native) but to be honest the mobile apps look like crap compared to native mobile toolkits.
Re:A Book about Qt5 by pjmlp on Thursday January 21, 2016 @02:46PM (#10947756)
Yeah, as I answered on another thread, they don't focus that much on mobile support, other that it compiles with the OS SDK.
Re:A Book about Qt5 by hellofunk on Thursday January 21, 2016 @11:58AM (#10946512)
I have used QML and JS React in different work projects, and I fail to see how QML is reactive. It is declarative but React is a different paradigm and incredibly useful, while QML is more traditional UI development dressed up in simpler syntax.
Re:A Book about Qt5 by trishume on Thursday January 21, 2016 @01:00PM (#10946980)
You're right in that it isn't the exact same paradigm as React, but it ends up working out the same way.

You write a declarative description of how you want your app to look given a source of data, and then the UI updates when the data changes and you can bind UI elements to change the data. When the data changes, the UI automatically updates.

React does this by generating the whole UI in a tree from a bunch of data and then diffing. QML does this by binding signals that trigger the UI to change whenever the data does.

Yes they fundamentally work a different way, but the way you write applications and think about them is the same.

Re:A Book about Qt5 by pjmlp on Thursday January 21, 2016 @02:42PM (#10947728)
I tried to use it for targeting Android and Windows Phone around 4.3 time, and was put off for how little support it provides for mobile platforms.

It was less work to use Java, C++/CX and plain C++ than having to mimic native widgets with QML and having do my own OS wrappers. Plus the additional 30 MB.

Also the C++ widgets either didn't work on mobile or were 1:1 like the desktop version, e.g. file selector.

From the documentation, it doesn't seem it has improved much.

Re:A Book about Qt5 by dharma1 on Thursday January 21, 2016 @05:53PM (#10949181)
Re:A Book about Qt5 by pjmlp on Friday January 22, 2016 @01:21AM (#10951105)
What do you mean by posting that link?

"It’s important to note that these styles are not claiming to be native, but instead a 100% cross-platform implementation of the Material and Universal design guidelines. For example, the Material style does not adapt to any Sony or Samsung theme on Android. You can run these styles on any platform and they will look more or less identical."

I still have to do style all the standard widgets myself or build them from scratch. I don't want them to be more or less identical, they should be what the user has on their handset.

For example where is the toast, FAB, file picker, recycler view, notification..?

iOS support is still not a thing, apparently from the comments.

Also where are the OS bindings for resources, background services, IPC between apps, OS state notifications?

Currently on the mobile space, Qt adds little value over using C++ with boost and similar libraries for the portable business logic and using the platform's main language for the UI.

At least with Xamarin I have a very good coverage for the wrapped APIs and mobile widgets per platform, updated quickly after each new OS release.

Re:A Book about Qt5 by dharma1 on Friday January 22, 2016 @09:57AM (#10953010)
Just wanted to link to where Qt are currently with cross platform QML UIs. They are making progress, but the UI is still emulated, and I don't think they have a huge team working on this.

And I agree with your comments btw. React native is another good candidate for native controls, for some types of applications

Re:A Book about Qt5 by pjmlp on Friday January 22, 2016 @12:47PM (#10954317)
Fair enough.
Re:A Book about Qt5 by adrianlmm on Thursday January 21, 2016 @12:38PM (#10946817)
Qt5 has been always over hyped IMHO.