[QGIS-Developer] [Qgis-developer] Min Qt version
Radim Blazek
radim.blazek at gmail.com
Tue May 30 07:58:32 PDT 2017
On Tue, May 30, 2017 at 11:39 AM, Martin Dobias <wonder.sk at gmail.com> wrote:
>> Just for curiosity, question for C++ experts, how this can compile/work:
>> QStringList lineParts = part.split( linePartRx, QString::SkipEmptyParts );
>> label = lineParts.mid( 5 ).join( ' ' );
>> if mid() returns QList<QString> which has no join()?
>
> QStringList has a constructor taking const QList<QString> & as an
> argument - that is an implicit conversion constructor (it has one
> argument and it is not declared as "explicit"), so it allows C++ to
> silently convert QList<QString> to QStringList and call
> QStringList::join().
Thanks for explanation. I should open my C++ book sometimes.
It is strange that compilation was failing with the same clang++
-std=c++11 with Qt 5.3 which has the same
inline QStringList(const QList<QString> &l) : QList<QString>(l) { }
Radim
More information about the QGIS-Developer
mailing list