Hacker News new | ask | show | jobs
by amelius 2967 days ago
I used Qt in the early days, and always found the signal/slot model to handle events quite cumbersome. Handling events through closures (like typically done in JavaScript) is, imho, much nicer.
3 comments

> I used Qt in the early days, and always found the signal/slot model to handle events quite cumbersome. Handling events through closures (like typically done in JavaScript) is, imho, much nicer.

You have been able to bind closures to events in Qt for... dunnno... 6 years maybe ?

Perhaps ironically, Javascript is a first class qt/qml citizen these days. You’ve been able to use QML with javascript—including/mainly via closures—for a while now.
I'm only an occasional Qt user but I believe since c++11 they've gained much better support for anonymous functions.