cant passing 'QList<QSqlRecord>&'
-
Hi,
I found the error at my debug logQObject::connect: Cannot queue arguments of type 'QList<QSqlRecord>&' (Make sure 'QList<QSqlRecord>&' is registered using qRegisterMetaType().)
how can i pass the QList<QSqlRecord>& with signal slot ?
@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.
-
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.
-
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.
-
Hi,
I found the error at my debug logQObject::connect: Cannot queue arguments of type 'QList<QSqlRecord>&' (Make sure 'QList<QSqlRecord>&' is registered using qRegisterMetaType().)
how can i pass the QList<QSqlRecord>& with signal slot ?
@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()
-
is it like this ?
void executeOneTime2(const QString &queryId, const QString &sql,const QList<QSqlRecord> recs, int &last_insert_id, bool &returnUD);
@rifky said in cant passing 'QList<QSqlRecord>&':
const QList<QSqlRecord> recs
Const reference is
const QList<QSqlRecord> &recs