On Friday 31 August 2007, Brant Sears wrote:
> Or you can use the qPrintable macro:
> qDebug("%s", qPrintable(myQString));
> On Aug 31, 2007, at 7:48 AM, Till Oliver Knoll
> <oliver.knoll@xxxxxxxxxxx> wrote:
> > Vahe Avedissian schrieb:
> >> Hi,
> >> I seem to be having problems printing the data contents of QString
> >> objects.
> >> I've tried the qDebug, and printf using the dat, toAscii, to
> >> unicode, etc... methods.
> >> It compiles, but at runtime I either see the first character only,
> >> or get a crash with
> >> "Illegal instruction" message.
> >> This seemed to work with QT3.x and I cannot find any documentation
> >> or examples of
> >> how to do this correctly.
> >> What am I missing?
> > The last method call to data():
> > qDebug ("The string is: %s", theQString.toLatin1().data());
> > Note that toLatin1(), toAscii() etc. return a QCString only - from
> > this you still need to pass along the actual char * to qDebug, with
> > the data() method.
> > Cheers, Oliver
Or you can use the friendly sintax described here:
qDebug() << myString << myOtherObject ;
this may also help:
(spamassassin & pf & spamd all said it's OK to make it public ;-) )
Key ID: 0x03176E5CEDEFF7AB
I prefer plain text email