Closed kiwifb closed 6 years ago
This should be fixed by c183d5c85c132f535e6fca9ec08de9a012e3862e.
AString wasn't really a wrapper, it was a typedef, which can't have conversions added to it (implicit conversions must be members). After running into a few surprises, I managed to use a tricky constructor template to get AString working as a class inheriting from QString without manually copying a bunch of QString constructor signatures. It will be missing the explicit constructors, and any multi-argument constructors, but those probably aren't needed by most code (and when it goes into QT code, like its XML library, it will get cast to a QString and everything will work).
While working on packaging fsl I noticed some differences when I used CiftiLib compiled with QT compared to libxml++. QT is my preferred option as it produce almost compiler warnings, however it was not compatible with the code from fsl using it.
After some analysis the code uses calls of the form
inputCifti.openFile(some_standard_C++_string)
. Glib ustring automatically converts standard C++ strings to ustring but QString doesn't do automatic conversion - you have to explicitly call the methodfromStdString
(http://doc.qt.io/qt-5/qstring.html#fromStdString).Since CiftiLib doesn't use either directly but wrap them in
AString
would it be possible to get the QT implementation of AString to provide automatic conversion from C++ standard string?