1

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

How can I add the element " into it ?

rgmt
  • 14,120
  • 12
  • 47
  • 66

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 << '"';
rgmt
  • 14,120
  • 12
  • 47
  • 66