Now I have sorted out my build problems and have a project based on Qt 5.6.0 and QxORM 1.4.2, I am attempting to get to bottom of the last actual issue I had with QxORM generated code (post viewtopic.php?f=2&t=463#p1399), but I have another issue now preventing me from being able to look at that. Or maybe it is the same issue, but because the debug build ASSERT's and release doesn't, they just look like different things. I won't know until I'm passed the problem I will desribe below...
From the front end Qt Quick/QML application we have the code:
C++
- Code: Select all
QQuickView qmlView;
QString sQmlFile = "qrc:/main.qml";
qmlView.rootContext()->setContextProperty("customer_main_record", pModel);
qmlView.setSource(QUrl(sQmlFile));
qmlView.show();
And then when a button is clicked the fetch_all is issued:
QML
- Code: Select all
Button {
text: "Fetch All"
onClicked: customer_main_record.qxFetchAll_()
}
When the button is clicked, the server picks up the request ok, and eventually ends up in:
- Code: Select all
qx_bool QxConvert_FromJson_Helper(const QJsonValue & j, qx::service::QxTransaction & t, const QString & format)
...
qx::service::IxParameter * ptr = qx::create_nude_ptr<qx::service::IxParameter>(sClassName);
if (! ptr) { qAssertMsg(false, "[QxOrm] qx::cvt::detail::QxConvert_FromJson< qx::service::QxTransaction >, loading QJson", "unable to create nude pointer for input parameter"); }
Which then ASSERTS with ptr=NULL because it cannot create the "nude_ptr". sClassName at this point is: "customer_main_record_input".
I have examined the m_mapFactoryX collection inside QxFactoryX::createObjectNudePtr, and it is a populated collection (count=156 items, some "empty" items, and some which correspond to our database schema). Related to the table in question, one of the collection items is "services::customer_main_record_input". (See screenshot of debug output - sorry for the poor resolution i had to resize to fit it into the forum's 256Kb limit).
I can see that this item was added to the collection via the line:
- Code: Select all
QX_REGISTER_COMPLEX_CLASS_NAME_CPP_CRM_SERVICES(services::customer_main_record_input, services_customer_main_record_input)
inside the generated source code file "customer_main_record.services.gen.cpp"
The issue seems to be that sClassName = "customer_main_record_input" but the name of the key in the collection is "services::customer_main_record_input".
I am not sure what to do next?
Thanks,
Steve