cant passing 'QList<QSqlRecord>&'
-
@rifky
You cannot haveQList<QObject-type>
,QObject
s are not copyable. I'm guessing you might meanQList<QSqlRecord &>
orQList<QSqlRecord *>
?Furthermore, the fact that you only find this in some runtime log rather than at compile-time indicates to me that you are using the old-style
SIGNAL
/SLOT()
macros. You would get this right at compile-time if you changed over to https://wiki.qt.io/New_Signal_Slot_Syntax, which is highly recommended. -
Hi,
@rifky The error message already tels you what to do, however using a reference in a signal is pretty unusual. When passing containers around, it's more common to use const references to avoid unnecessary duplication.
@JonB QSqlRecord is not QObject based. It can be copied without problem.
-
@rifky said in cant passing 'QList<QSqlRecord>&':
how can i pass the QList<QSqlRecord>& with signal slot ?
The error messsage tells you exactly what you have to do:
Make sure 'QList<QSqlRecord>&' is registered using qRegisterMetaType()
-
@rifky said in cant passing 'QList<QSqlRecord>&':
const QList<QSqlRecord> recs
Const reference is
const QList<QSqlRecord> &recs