support both -Q and -Qi operations