The legend items are organized in a QLayout. So its order depends on the order they are inserted. If you want to reorder them you have to remove and reinsert them ( like you have found out yourself ).

But instead of recreating your curves you could also detach/attach them - or best unset/set the QwtPlotItem::Legend flag.

Uwe