Building PyQt against Qt with OpenGL disabled

Phil Thompson phil at riverbankcomputing.com
Sun Oct 4 14:47:15 BST 2020


On 02/10/2020 20:17, John Ehresman wrote:
> I ran in a compile time error when building PyQt with sip-build
> against a custom built Qt with OpenGL disabled.  The error is in a
> generated QtWidgets file.
> 
> I think the issue is that the test for the disabled feature is in
> QtGui but it also applies to QtWidgets.  Adding the following method
> to the QtWidgets class in the project.py file seems to work around the
> problem:
> 
>     def generate(self, *args, **kw):
> 
>         qtgui = self.project.bindings.get('QtGui')
>         if qtgui is not None:
>             for feature in ['PyQt_OpenGL', 'PyQt_Desktop_OpenGL']:
>                 if feature in qtgui.disabled_features:
>                     self.disabled_features.append(feature)
> 
>         return super().generate(*args, **kw)
> 
> My Qt build only has a subset of modules so there may be similar
> problems elsewhere that I didn’t run into.

It's actually a SIP bug - fixed in tonight's snapshots. The above is a 
good workaround.

Thanks,
Phil


More information about the PyQt mailing list