It's pretty easy to do this with a custom theme... for example:
if(qa_opt('permit_post_q') == QA_PERMIT_USERS && !qa_get_logged_in_userid()) {
$userlinks=qa_get_login_links($qa_root_url_relative, isset($topath) ? $topath : qa_path($qa_request, $_GET, ''));
$this->content['navigation']['main']['ask']['url'] = 'javascript:if (confirm(\'Asking questions requires you to login or register. Would you like to register now?\')) document.location.href=\''.qa_html(@$userlinks['register']).'\';';
}
You can replace 'register' with 'login' if you want it to redirect to the login form. You could also create your own hybrid login/register page.
Edit: here's a way to do this with the ask-box widget as well, in qa-ask-box.php:
<FORM METHOD="POST" ACTION="<?php
if(qa_opt('permit_post_q') == QA_PERMIT_USERS && !qa_get_logged_in_userid() && isset($qa_content['navigation']['main']['ask'])) {
$userlinks=qa_get_login_links($qa_root_url_relative, isset($topath) ? $topath : qa_path($qa_request, $_GET, ''));
echo 'javascript:if (confirm(\'Asking questions requires you to login or register. Would you like to register now?\')) document.location.href=\''.qa_html(@$userlinks['register']).'\';';
}
else echo qa_path_html('ask', $params);
?>">