开发者

QVector.push_back error

error in

QVector<LibraryRecord> Library;
Library.push_back(LibraryRecord(DateOfIssue, ReturnDate, FIO,tTekct开发者_开发技巧,FName,TText));

error message:

 no matching function for call to ‘LibraryRecord::LibraryRecord()’

why? Constructor present

//constructor
LibraryRecord::LibraryRecord(QString pDateOfIssue,
                             QString pReturnDate,
                             QString FIO,
                             QString tTekct,
                             QString fName,
                                 QString TTextt)
{..}

Can you tell me how to fix this? Thanks in advance!


Unlike the C++ Standard Library containers (e.g. std::vector), the Qt containers require that the value type be default constructible.

That is, your type LibraryRecord must also have a default constructor (the constructor that you show, which requires arguments, is not a default constructor).


Your class must be assignable. It is probably not.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜