1

I am trying to create a QStringList containing all punctuation signs.

How can I add the element " into it ?

rocambille
  • 15,398
  • 12
  • 50
  • 68

1 Answers1

2

You can use \ to escape the character ". The code may look like this:

QStringList foo;
foo << "\"";

An other option would be to construct a QString from a char declared between simple quotes ':

foo << QString('"');

Since the constructor isn't declared as explicit in documentation, this should also work with implicit conversion:

foo << '"';
rocambille
  • 15,398
  • 12
  • 50
  • 68