karatchov
karatchov

Reputation: 967

Qt wrapper for C libraries

I'm working on a QT project based mainly on C libraries.

I like the way QT works, and would like to make a C++ wrapper(with similar QT style) for each C library I'm working with.

What are your recommendations and advices. What should I do, and what I shouldn't.

I would like to hear answers based on real life experience.

Thanks

Upvotes: 2

Views: 3229

Answers (2)

rohanpm
rohanpm

Reputation: 4274

There is a classic article on designing Qt-style APIs which might be helpful to you.

In general I'd recommend following the Qt style as much as possible, and hiding the details of the underlying library where you can. You can use the Qt source code as a reference - after all, Qt is a wrapper of C libraries to a large degree, making use of standard C, POSIX and platform-specific libraries.

Upvotes: 3

ewanm89
ewanm89

Reputation: 929

Is there a reason not to just call the c libraries from c++?

I ask because this is the most major divergence of QT and GTK, QT is C++ native GTK is C native. A lot of developers state they don't like GTK mostly down to the way everything has to be handled in C.

Upvotes: 0

Related Questions