Qt: Qt classes versus standard C ++

A large number of functions are duplicated between standard C ++ and Qt. At some point, this seems logical, but many times it looks silly. As if I feel like I'm doing a new programming language, learning things that I already know. for example using QFile.

Also, if I do all this with the Qt method and assume that now I want to get out of the Qt framework, it will be too tedious to rewrite this code. OTOH I like Qt because it provides me with libraries that otherwise I would have to catch myself as webkit, database connection, dbus, etc.

What do you suggest for standard C ++ or make it a pure Qt way?

+6
c ++ qt c ++ - standard-library
source share
2 answers

Since there is no GUI in C ++, you must abstract the GUI code from the rest of the real code.

Then in your implementation of QT abstraction of your GUI, you can use the QT code.
Then you can write an abstraction of the Wx / Quartz GUI without affecting the actual code.

In real code (work has been done) stick to standard materials (or cross platforms that are almost standard (boost)). It can be argued that QT is a cross-platform. Just remember that using lib here will closely bind your code with lib, so fetching its latest date will not matter. (see previous question about removing Rouge Wave from an outdated application)

+5
source share

I make all collection classes in std :: it clearer for developers without Qt and more portable.

Strings and String Lists I use Qt inside a pure Qt function that does something GUI-ish but otherwise uses std :: String. Although formatting Qt.arg () is much nicer than stringstream

+3
source share

All Articles