[PyQt] Syntax error with SIP 4.19.13 and struct

Phil Thompson phil at riverbankcomputing.com
Thu Mar 21 10:11:38 GMT 2019


On 21 Mar 2019, at 10:05 am, Alessandro Pasotti <apasotti at gmail.com> wrote:
> 
> Hi,
> 
> I'm building the bindings for a class that looks like this (snippet):
> 
> class CORE_EXPORT QgsDataProvider : public QObject
> {
>     Q_OBJECT
>   public:
>     struct ProviderOptions
>     {
>       QgsCoordinateTransformContext coordinateTransformContext;
>     };
>     QgsDataProvider( const QString &uri = QString(), const QgsDataProvider::ProviderOptions &options = QgsDataProvider::ProviderOptions() ):
>       mDataSourceURI( uri ),
>       mOptions( options )
>     {
>     }
> }
> 
> SIP code is (snippe)t:
> 
> class QgsDataProvider : QObject
> {
> %TypeHeaderCode
> #include "qgsdataprovider.h"
> %End
>   public:
>    struct ProviderOptions
>     {
>       QgsCoordinateTransformContext coordinateTransformContext;
>     };
> 
>     QgsDataProvider( const QString &uri = QString(), const QgsDataProvider::ProviderOptions &options = QgsDataProvider::ProviderOptions() ):
> ...
> 
> 
> The error message is 
> qgsdataprovider.sip:76: syntax error
> line 76 is the last line of the above snippet.
> 
> 
> Any idea what's going on here?

You have a syntax error. There seems to be a colon when a semi-colon is expected.

Phil


More information about the PyQt mailing list