[PyQt] SIP multiple inheritance with template base class

Giuseppe Corbelli corbelligiuseppe at mesdan.it
Thu Apr 5 11:27:21 BST 2018


On 04/03/2018 04:35 PM, Phil Thompson wrote:
> Sorry, still not clear. When you "provide the typedefs" do you mean in the .sip file or as a C++ typedef (possibly as handwritten code in the .sip file)?

In the .sip file, see below how to reproduce.
Let's say I will not pursue a career in teaching since it seems my 
explanations are not the best you can find around.

>> The generated code for the explicit template specialization does not include the relevant typedef.
>> This is the compiler error:
>>
>> sipQCustomPlotQCPAbstractPlottable1D_QCPBarsData.cpp:121:18: error: ‘QCPAbstractPlottable1D_QCPBarsData’ in namespace ‘::’ does not name a type
>>          const  ::QCPAbstractPlottable1D_QCPBarsData *sipCpp;
>>
>> Again, the error can be reproduced by checking out branch  v2.0.0 of https://github.com/cowo78/QCustomPlot-PyQt5.git and commenting out the #include "helper.h" directive in plottable1d.sip.
> 
> Please provide a short, complete example that demonstrates the problem.

git clone https://github.com/cowo78/QCustomPlot-PyQt5
cd QCustomPlot-PyQt5/
git checkout v2.0.0
git submodule update --init QCustomPlot
echo "" > helper.h
python3 setup.py build


Compilation will fail because of a missing typedef.
The relevant pieces are:
* template class QCPAbstractPlottable1D in plottable1d.sip
* typedef QCPAbstractPlottable1D<QCPBarsData> in plottable-bars.sip

-- 
Giuseppe Corbelli


More information about the PyQt mailing list