To start with, QF code or AA code. I am assuming that it is an AA code (a codeshare) operated by QF.
Without knowing exactly, this makes it an AA flight from the perspective of loyalty.
As far as revenue flows, AA pay QF for the actual ticket - in real cash. Obviously they pay less than what...