gboelter
9th February 2008, 04:47
Sorry, I'm quiet new in Qt and it's possible that somebody will laugh about this question, but I can't found a solution so I would like to ask you guys for al little bit help.
Actually I'm using Qt 4.3 together with Linux and MySQL 5.
From a MySql database I got "Hello\n World" using
QString test1(query.value(1).toString())
In my database "Hello\n World" is stored as varschar(40).
Then for testing I have tried this:
QString test1(query.value(1).toString());
QString test2 = "Hello\n World";
qDebug() << query.value(1); // QVariant(QString, "Hello\World")
qDebug() << test1; // gives me "Hello\n World"
qDebug() << test2; // gives me "Hello
World"
How it comes, that in test1 the newline character is ignored?
Thanks in advance
Guenther
Davao City, Philippines, Planet Earth
Actually I'm using Qt 4.3 together with Linux and MySQL 5.
From a MySql database I got "Hello\n World" using
QString test1(query.value(1).toString())
In my database "Hello\n World" is stored as varschar(40).
Then for testing I have tried this:
QString test1(query.value(1).toString());
QString test2 = "Hello\n World";
qDebug() << query.value(1); // QVariant(QString, "Hello\World")
qDebug() << test1; // gives me "Hello\n World"
qDebug() << test2; // gives me "Hello
World"
How it comes, that in test1 the newline character is ignored?
Thanks in advance
Guenther
Davao City, Philippines, Planet Earth