qa_register_plugin_module(...) is called by plug-ins as they are registered. This happens in qa-base.php, as part of a loop which sets some global variables. My best guess is that the problem is caused because you're include/require-ing qa-base.php within a function, so even though it assigns some variables in what it thinks is the global scope, it's actually doing so in a local scope. I will aim to fix this issue in the next release. In the meantime, try adding the following line before you require qa-base.php:
global $qa_plugin_directory, $qa_plugin_urltoroot;