I'm a newcomer to C++ and Qt. I've been messing around with Qt Creator for a few days, and what really struck me was how the GUI components only accepted a const QString&
rather than a string
or an std::wstring
. To stay consistent with this, I've been trying to accept and return QString
from most of my function calls, however I find myself converting to and from std::string
a lot to use most of the standard library facilities.
My question here is, what's the purpose of QString
if std::string
is part of the standard library? I guess this would be beneficial to someone who was already using Qt and didn't want another dependency on #include <string>
, but to be honest you'll need std::string
if you want to do anything useful with your application. (This especially goes for QChar
, since char
is a builtin.)
Can someone explain to me why this is not reinventing the wheel and how this helps being cross-platform?