I did some troubleshooting, and it looks like getModel() is returning null:
plugin::Model *temp = getModel();
if(temp)
{
std::string slug = temp->slug;
}
else
{
DEBUG("temp is false"); // this is output every time
}
I can work around this by moving the code outside of the classes constructor and into a new function, and calling that function from with the derived classes. No worries.
You can’t get the Model in the constructor, as it has not been assigned yet.
EDIT: The best that can be done is to store a reference to this in the ModuleWidget* and later in rendering code try to ->getModel(). At which point .name might also be valid.
I think it does in the browser at least, because the module isn’t actually initialized yet, so the call should be guarded with a check to see if getModel() returns null. But when placed in a patch it should probably work.