There are two bugs that prevent the use of a custom QwtScaleEngine in the current source of PyQwt. My personal goal is to write a log-2 scale which corresponds to octave ranges between audio frequencies.
The first class of bugs are ownership bugs between python and C++ (first tracked down by Gerard in the above threads). This is fixed by adding additional SIP annotations like /Transfer/ and /Factory/ to appropriate methods.
The second bug is missing SIP annotations on C++ arguments that are passed by reference in QwtScaleEngine::autoScale. These arguments were considered "Out" arguments, whereas two of them are both "In" and "Out" arguments.
I have attached a patch to fix these two issues. With it, I can write a custom QwtScaleEngine and its associate QwtScaleTransformation to implement whatever scale needed. I have also attached a test file for such a log-2 scale engine.
Patch to fix custom QwtScaleEngine issues
Test file with a custom log2 scale engine