For flights operated by a QF partner airline (such as the BA example here), QF uses the mileage distance that the partner airline defines. QF does not do the calculation themselves. So when BA sends the flight details to QF, they include the BA definition of the route distance. This is because that is the number of miles that BA is willing to "purchase" from QF for the flight.
The best way to know beforehand just how many miles will end up being used by QF for the FF benefits (SCs and points), is to find out from the operating airline just how many miles they believe the flight to be. Some airlines show the route distance in their booking engine flight details. Unfortunately BA is not one of those who provide the flight distance but they only provide the flight time. AA is very good at providing the flight distance for AA flights.