-2

I want to print the value in QSting inside Quots

QString data = "Hello";
QMessageBox::warning(NULL, "Job", "Already data" + data+ " exist");

I want the message to be :- Already data "Hello" exist

Sijith
  • 3,740
  • 17
  • 61
  • 101
  • Maybe `QMessageBox::warning(NULL, "Job", "Already data\"" + data+ "\" exist");`? – vahancho Nov 02 '17 at 12:42
  • Use: `QString data = "Hello"; QMessageBox::warning(NULL, "Job", QString("Already data \"%1\" exist").arg(data));` – eyllanesc Nov 02 '17 at 12:43
  • 1
    Possible duplicate of [How to get double quotes into a string literal?](https://stackoverflow.com/questions/12338818/how-to-get-double-quotes-into-a-string-literal) – eyllanesc Nov 02 '17 at 12:51

1 Answers1

-2

you most use backslash before quots

Here's an example of how you'd use this feature:

QMessageBox::warning(NULL, "Job", "Already data\"" + data+ "\" exist");