2017-11-02 3 views
-2

Ich möchteWie QString in quots drucken

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

Ich möchte die Nachricht den Wert in QSting innerhalb quots drucken sein: - Sie sind bereits „Hallo“ Daten existieren

+0

Vielleicht 'QMessageBox :: Warnung (NULL, "Job", "schon data \"“ + Daten + "\" existieren ");'? – vahancho

+0

Verwendung: 'QString data =" Hallo "; QMessageBox :: warning (NULL, "Auftrag", QString ("Bereits data \"% 1 \ "exist"). Arg (data)); ' – eyllanesc

+1

Mögliches Duplikat von [Wie erhält man doppelte Anführungszeichen in ein String-Literal?] (https://stackoverflow.com/questions/12338818/how-to-get-double-quotes-into-a-string-literal) – eyllanesc

Antwort

-2

Sie am meisten Verwendung Backslash vor quots

Hier ist ein Beispiel dafür, wie Sie diese Funktion verwenden würden:

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