Home > Back-end >  Is possible create QString at compile time?
Is possible create QString at compile time?

Time:02-16

Consider below code:

static constexpr QString FOO = QStringLiteral("foo");

but can not compile this line because QString has not default destructor. How I can do something like this?

CodePudding user response:

In Qt 6.2 you can use the new u"my string"_qs syntax. https://doc.qt.io/qt-6/qstring.html#operator-22-22_qs

  • Related