Hi,
I want to write my own object to the binary file. But I receive the message:
C:\Qt\Qt5.1.1\5.1.1\mingw48_32\include\QtCore\qdat astream.h:300: error: no match for 'operator<<' (operand types are 'QDataStream' and 'const User')
s << *it;
^Qt Code:
void Dialog::on_btnWrite_clicked() { int age = ui->wspAge->text().toInt(); User user; user.nike = nike; user.password = password; user.firstName = firstName; user.lastName = lastName; user.age = age; QVector<User> users; users.push_back(user); out << users; file.flush(); file.close(); }To copy to clipboard, switch view to plain text mode
Thank you!
Bookmarks