Error message explains everything, you can't use operator ! on QSqlRecord objects.
This operator is used in Q_ASSERT macro:
#define Q_ASSERT(cond) ((!(cond)) ? qt_assert(#cond,__FILE__,__LINE__) : qt_noop())
#define Q_ASSERT(cond) ((!(cond)) ? qt_assert(#cond,__FILE__,__LINE__) : qt_noop())
To copy to clipboard, switch view to plain text mode
So in your case this expands to:
...!(record)...
...!(record)...
To copy to clipboard, switch view to plain text mode
I think you mean something like:
Q_ASSERT( ! record.isEmpty() )
Q_ASSERT( ! record.isEmpty() )
To copy to clipboard, switch view to plain text mode
Bookmarks