cnic
If QF withdrew from the codeshare arrangement apart from saving them the cost of the seats they 'buy' on PX services, QF would loose both the on and in carriage a codeshare arrangement facilitates. It may not be much revenue to QF but the ability to in sell and on sell is just as important as the actual sale.
To pull out of the codeshare arrangement would cost QF in the long run.
However having a QF flight number on those flights operated by a subcontractor to PX is equally fraught with potential danger to both QF and the passengers that mistakenly think they are on a QF flight.