Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <typename T>
- qint64 write_helper(QFile *file, const QScriptValue &value, T *dummy = 0)
- {
- Q_UNUSED(dummy)
- int count = value.property("length").toInt32();
- QByteArray ba(count * sizeof(T), '\0');
- QDataStream s(&ba, QIODevice::WriteOnly);
- for (int i = 0; i < count; ++i)
- s << value.property(i).toVariant().value<T>();
- return file->write(ba);
- }
Advertisement
Add Comment
Please, Sign In to add comment