HamedMasafi/Nut

class not registered with qt meta object

yangxingpping opened this issue · 2 comments

when I cop unittest tst_datetime's db and sampletable class to an simple demo, it cause fatal
for sampletable
qFatal("The class %s is not registered with qt meta object", qPrintable(name));

code snippet :
DB db;
db.setDriver("QSQLITE");
db.setDatabaseName("hello.db");
auto bOpen = db.open();

Can add some additional demos for how to use it?

Hi @yangxingpping
You need to register the all classes used in Nut (Database and tables) with qRegisterMetaType function. For more information please take a look at tests.

Thank you!