Does Qt have a C interface?

后端 未结 7 723
孤街浪徒
孤街浪徒 2020-12-04 19:03

I\'ve found conflicting answers on the web - some say it does, some say it doesn\'t. I was unable to find any details in the official Qt documentation either. So does Qt hav

7条回答
  •  無奈伤痛
    2020-12-04 19:32

    Short answer: no.

    If you need a comprehensive GUI toolkit for C, you can use GTK+.

    To use Qt, you must have a C++ compiler. But it doesn't mean that your "application logic" can't be written in C, compiled with a C compiler and carefully linked to the C++ part (the GUI with Qt). This application logic can be generic, linkable into other executables (pure-C, mixed C/C++, etc.) It all depends on what you need.

    Qt is great for C++, though, and it's a good reason to decide using C++ for a particular project, even if you still want to keep parts in C.

提交回复
热议问题