From: Russell S. <hp...@hp...> - 2015-07-22 05:03:32
|
Hey - it looks like SourceForge is back up! Don't worry, I have solved the problem. The solution is to use the PyName class annotation: class ScidavisQwtSymbol /PyName=QwtSymbol/ declares the C++ class ScidavisQwtSymbol to be exposed as a python class QwtSymbol. Cheers On Mon, Jul 20, 2015 at 10:28:26AM +1000, Russell Standish wrote: > Hi - I'm posting in the vain hope that SourceForge's mailing list > servers are still running. > > I'm taking a look at the Qwt6 port job again, and have run into a > problem. > > In Qwt6, the class QwtSymbol has now been declared non-copiable, which > causes a problem with SIP when wrapping it to expose that class to Python. I > personally think this is due to lazy programming - no matter what > implementation details prevent a class from being copiable, there are > straight forward techniques for converting them into copiable classes, > and for APIs, it is simply rude to provide non-copiable classes > (internal classes are of the variety "don't care", so are another matter). > > Nevertheless, the API is what I've got to work with. It is relatively > easy to declare my own class (eg ScidavisQwtSymbol) that is copiable > (eg by deriving from shared_ptr<QwtSymbol>, delegating all the methods > and calling it a day), but the problem is I now need to wrap > ScidavisQwtSymbol and get it exposed to Python as QwtSymbol to > maintain backward compatibility in the Python scripts. > > I'm having trouble finding how to do this by Googling the SIP > documentation. Does anyone know how to do this? > > Cheers > > -- > > ---------------------------------------------------------------------------- > Prof Russell Standish Phone 0425 253119 (mobile) > Principal, High Performance Coders > Visiting Professor of Mathematics hp...@hp... > University of New South Wales http://www.hpcoders.com.au > ---------------------------------------------------------------------------- > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > _______________________________________________ > Scidavis-contributors mailing list > Sci...@li... > https://lists.sourceforge.net/lists/listinfo/scidavis-contributors -- ---------------------------------------------------------------------------- Prof Russell Standish Phone 0425 253119 (mobile) Principal, High Performance Coders Visiting Professor of Mathematics hp...@hp... University of New South Wales http://www.hpcoders.com.au ---------------------------------------------------------------------------- |