QFile* pfIco = new QFile( "MyFile.png");if( !pfIco->open( QIODevice::WriteOnly ) ) {...}const int iFileSize = SysStringLen( pngDATA );QDataStream out(pfIco);out << QString::fromWCharArray(pngDATA, icoFileSize).toUtf8();pfIco->close();delete pfIco; pfIco = nullptr;
QByteArray ba = QByteArray((char*)pngDATA, icoFileSize);out << ba;
C++ (Qt)QFile* pfIco = new QFile( "MyFile.png");if( !pfIco->open( QIODevice::WriteOnly ) ) {...}const int iFileSize = SysStringLen( pngDATA );pfIco->writeData( pngDATA, iFileSize );pfIco->close();delete pfIco; pfIco = nullptr;
C++ (Qt)const wchar_t *data = ...;const size_t *dataSize = ...; // in bytes QFile f;QDataStream out(&f, QIODevice::WriteOnly);out.writeRawData(reinterpret_cast<const char *>(data), dataSize);
pfIco->write( (char*)pngDATA, iFileSize );
pfIco->write( QString::fromWCharArray(pngDATA, iFileSize).toLocal8Bit(), iFileSize );
const int iSize = SysStringLen( pngDATA );pfIco->write( QString::fromWCharArray(pngDATA, iSize).toLocal8Bit(),iSize );
const int iFileSize = SysStringLen( pngDATA );
C++ (Qt)while(!asleep()) sheep++;