Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Except for the fact that Qt is not as cross-platform as the standard C++ library. Qt also uses non-C++ features such as signals/slots which require usage of their own Meta Object Compiler.


Qt's moc is a preprocessor/code-generator which compiles to standard C++.

Do you also tell people that they shouldn't use flex/lex/bison/yacc/antlr/etc.? Why are those code generators/DSLs acceptable but the moc is not? It's not as if the Qt authors added it because they don't understand C++, they added it because it solves a vexing problem in C++ GUI design.


I would have agreed with you if Qt used something like the #pragma directive. Alas, they decided to inject keywords inside of the standard language which breaks every C++ compiler.


then... turn off the keywords?

Every Qt "keyword" you talk about can be disabled with a fallback to namespaced macros.

foreach -> Q_FOREACH slots: -> Q_SLOTS

etc.


You can do stock C++ work in the Qt IDE, it's perfectly happy doing it.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: