[Qt-creator] Info request for DEFINES in QtCreator
André Pönitz
apoenitz at t-online.de
Thu Aug 6 13:58:43 CEST 2020
On Thu, Aug 06, 2020 at 01:25:30PM +0200, Francesc Martinez wrote:
> Hi,
> I'm having some troubles with implicit conversions every time I have to
> build my plugin ([1]https://github.com/francescmm/GitQlientPlugin) but
> until now I didn't bother to see why. I've been just fixing the issues
> (mainly casts to QString).
> Looking for the reasons I've noticed that there are some defines in
> the qtcreator.pri.
> I'm pretty sure that there is a reason and I don't mind at all if I
> have to fix my issues. What I wonder is if you could explain to me or
> document somewhere why they are there so I can check if I need them as
> well in my app.
> I guess that the following two are present to avoid encoding problems:
These prevent some otherwise (too) easy convesions, right.
> * QT_NO_CAST_TO_ASCII
> * QT_RESTRICTED_CAST_FROM_ASCII
QT_RESTRICTED_CAST_FROM_ASCII is a weaker form of QT_NO_CAST_FROM_ASCII,
effectively allowing arrays of chars (but not pointers) to be converted
to QString.
> But I really don't know the reason for the following ones:
>
>
> * QT_NO_JAVA_STYLE_ITERATORS
This disables Java-style iterators for Qt containers (.hasNext()/.next())
which are not overly useful nowadays and will be scrapped in Qt 6 anyways.
> * QT_USE_FAST_OPERATOR_PLUS
> * QT_USE_FAST_CONCATENATION
That's a kind of archaic version of QT_USE_QSTRINGBUILDER.
> In addition to those, I wonder why "QT_USE_QSTRINGBUILDER" is not added in that
> group.
Because it's covered by above.
But now that you mention it, maybe changing that to use QT_USE_QSTRINGBUILDER
would be in order...
Andre'
More information about the Qt-creator
mailing list