You seem to be asking question that, most likely, you shouldn't be asking.
If you're writing a plugin then you should only care about the plugin itself. The only reason I can think of why you would need the abosolute path to the webroot is that you want to get into the core, other plugins or other themes. Assuming you aren't in a need of this then you shouldn't care about it at all. Understanding this specific need will lead to a better approach to solve your issue.
Assuming the plugin directory would be enough for you (in 99.99% cases it should), then it is not the same if you're in the context of the qa-plugin.php file, a layer or a module. The first ones are part of the global context, so you shouldn't add code to the qa-plugin.php other than the module registrations and some class loading logic. If you still want to add code in there then you should use the global variables $qa_plugin_directory (absolute path to the plugin directory) and $qa_plugin_urltoroot (relative path to the plugin directory from the requested page).
In the case of layer the same approach is followed but, as you can see here, some pieces of text (yes, you're reading it properly) are replaced during runtime into the appropriate directory path and urltoroot. These are QA_HTML_THEME_LAYER_DIRECTORY and QA_HTML_THEME_LAYER_URLTOROOT.
Modules are handled differently and in a better way. When they're registered they pass those parameters through the load_module($directory, $urltoroot, $type, $name) function. So just implement that function and it will work. You don't have to inherit anything as the function is called after checking it with a method_exists.
In the unlikely case in which these approaches are not enough, check the QA_BASE_DIR constant and the qa_path_to_root() function. Other functions in qa-base.php might be helpful too.