I am not the most well-versed in all these arcane FF rules, and I am sure other, more seasoned FT'oids will chime in, but as I see it:
Although the flights were codeshared with QF, which is a AA partner, the seat that you bought was purchased from AA by TN. So, in effect, you were flying in a 'TN seat' even though it was a 'QF flight'.
And I think the general rule is, in the instance of codeshares, you get the FFM (or lack thereof) according the airline 'seat' that you buy, irrespective of the airline flight you fly.
It seems that yours is an unusual situation, because most codeshares now are between airlines whose FF programs are also linked: US/UA, CO/DL/NW.
My conclusion is: It's a bummer, but I am not sure you can get the miles. But I give way to wiser heads than mine.
P.S. I got burned in a similar fashion going to Europe. 'Once burned, twice learned.' Now, if I see a flight on a 'non-FF' airline, I check to see if perhaps it's a codeshare. And then book through the codeshare to get the miles (provided the $$ difference is not too great, if I'm paying).
------------------
Da DOK