[Qt-interest] can not copy QString and other non understood other c++ error
Nikos Chantziaras
realnc at arcor.de
Sun Feb 28 23:51:13 CET 2010
On 03/01/2010 12:38 AM, Matthias Pospiech wrote:
> This code does not compile:
>
>[...]
> int error = DAQmxCreateTask (taskName.toLatin1(), &taskHandle);
> [...]
If DAQmxCreateTask() takes a const char* as its first argument, then you
can't pass it a QByteArray, which is what QString::toLatin1() returns.
Instead, pass taskName.toLatin1().constData() which returns a const
char* to the contents of the QByteArray.
More information about the Qt-interest-old
mailing list