Reputation: 1691
Keep getting warnings on lines like these
qDebug("An error occured while trying to create folder " + workdir.toAscii());
workdir being QString()
warning: format not a string literal and no format arguments
Upvotes: 7
Views: 4217
Reputation: 131
I managed to get it to work fine without warning like this :
qDebug("An error occurred while trying to create folder %s", qUtf8Printable(workdir));
Upvotes: 2
Reputation: 27027
When debbuging with qDebug
, I find the following syntax much easier :
qDebug() << "An error occured while trying to create folder" << workdir;
To do this, you'll need to include the <QtDebug>
header.
More info : Qt docs regarding qDebug().
Upvotes: 2
Reputation: 84189
That should probably be:
qDebug("An error occured while trying to create folder %s", workdir.constData());
since qDebug
takes const char*
as first argument.
Upvotes: 5