Hi,

I personally find that QLiteralString() and QLatin1String()  add significant visual noise when reading QGIS source code. Qt 6.4 adds a Qt::Literals::StringLiterals namespace (https://doc.qt.io/qt-6/qt-literals-stringliterals.html) with operator"" _s(...) and operator""_operator ""_L1(...)

So code like

  wallProperties.insert( QStringLiteral( "geometryModifier" ), WALL_EXPRESSION );   wallProperties.insert( QStringLiteral( "symbolType" ), QStringLiteral( "Fill" ) );
  if ( renderer->type() == QLatin1String( "25dRenderer" ) ) { ... }

can be simplified as

  wallProperties.insert( u"geometryModifier"_s, WALL_EXPRESSION );
  wallProperties.insert( u"symbolType"_s, u"Fill"_s );
  if ( renderer->type() == "25dRenderer"_L1 ) { ... }

For the replacement of QStringLiteral() by ""_s is is a bit unfortunate though that we have to put the 'u' prefix to indicate this is a Unicode string, but u""_s is still shorter than QStringLiteral( "" )

Thoughts on doing a mass replacement to those new ways?

Even

--
http://www.spatialys.com
My software is free, but my time generally not.

_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to