0

Widget toolkits like qt/gtk+ have multiple language bindings. Suppose I want to develop an application in c++ but want to use gtk+ C language bindings for my gui. Is it possible to write the source code for the application in one language and use a different language binding for gui? Will the ide interfere too?

jdmuroe
  • 29
  • 2

2 Answers2

1

There are a number of language bindings for Qt. Also those blog entries:

http://www.ics.com/blog/using-qt-alternative-programming-languages-part-1

http://www.ics.com/blog/using-qt-alternative-programming-languages-part-2

Also, you could say that Qt is a "two languages" framework at its core, as it has the QML language for UI. QML is a declarative language that integrates JavaScript for scripting, it is very easy and fast to develop in.

Qt Creator (the IDE) supports natively C, C++, JavaScript, QML and Python code, maybe even more languages.

As for GTK+, I don't really have any production experience with it, but it does have different language bindings too.

dtech
  • 47,916
  • 17
  • 112
  • 190
0

It's possible to link your C++ app directly to any C library, including GTK+. But why do you want to use the GTK+ C API in C++, when gtkmm gives you a nice C++ interface to GTK+? You can also mix C and C++ APIs in gtkmm.

It's also possible to link C++ compiled code to C, as long as it has the appropriate externs, but it doesn't seem like QT has C bindings.

Community
  • 1
  • 1
user1431317
  • 2,674
  • 1
  • 21
  • 18