How usable is Qt without its preprocessing step?

后端 未结 12 812
自闭症患者
自闭症患者 2021-02-02 05:21

I think it\'s unreasonable for a library to require preprocessing of my source code with a special tool. That said, several people have recommended the Qt library to me for cros

12条回答
  •  北荒
    北荒 (楼主)
    2021-02-02 05:42

    Is it possible? As long as you're not doing any gui programming, probably. Personally I mostly run with PyQt these days, so it's not a big concern for me.

    Why you shouldn't care: Given the nature of the "precompilation" if you're using cmake or qmake, it's not really a big deal in terms of inconvenience. If you're doing anything with a GUI these days, you should be using a graphical designer for most of the work anyway, so you're already adding some "pre-compilation" steps.

    Regarding why they did it: You might be interested to read Qt's explanation: http://doc.qt.io/qt-4.8/templates.html

    It boils down to:

    • The template solution lacks properties and overloading
    • The moc solution prevents signals from breaking binary compatability
    • Runtime analysis and modification are possible with the non-templated signals/slots mechanism

    On a side note, multithreading signals/slots are also an advantage of their system.

提交回复
热议问题