PyQt6: QtCore binding fails to build because of QTimer::timerEvent

Phil Thompson phil at riverbankcomputing.com
Wed Dec 14 14:55:30 GMT 2022


On 14/12/2022 12:38, Pierre Bourgin wrote:
> hello,
> 
> I'm trying to package pyQt6 6.4.0 for Qt6 6.4.1.
> Environment: linux x86_64, using clang 15.0.6 and musl libc.
> 
> 
> PyQt6 QtCore's binding build fails because 'timerEvent' is a protected
> member of 'QTimer' (see below).
> 
> I'm surprised to be the first one to face this problem ..
> Does anyone already tried building pyQt6 6.4.0 with Qt6 6.4.1 ?
> 
> Thanks - Pierre
> 
> build output:
> ==================================
> 
> => python-pyqt6-6.4.0-r0: running do_configure...
> Querying qmake about your Qt installation...
> /usr/lib/qt6/bin/qmake -query
> This is the GPL version of PyQt 6.4.0 (licensed under the GNU General
> Public License) for Python 3.11.0 on linux.
> Found the license file 'pyqt-gpl.sip'.
> Checking to see if the QtCore bindings can be built...
> /usr/lib/qt6/bin/qmake QtCore.pro
> ...
> Generating the pylupdate6 script...
> Generating the pyuic6 script...
> Generating the .pro file for the QtCore module...
> Generating the .pro file for the QtNetwork module...
> ...
> Generating the Makefiles...
> /usr/lib/qt6/bin/qmake -recursive PyQt6.pro
> Info: creating stash file 
> /builddir/python-pyqt6-6.4.0/build/.qmake.stash
> Reading /builddir/python-pyqt6-6.4.0/build/QtCore/QtCore.pro
> ...
> The project has been built.
> 
> => python-pyqt6-6.4.0-r0: running do_build...
> cd QtCore/ && ( test -e Makefile || /usr/lib/qt6/bin/qmake -o Makefile
> /builddir/python-pyqt6-6.4.0/build/QtCore/QtCore.pro ) && bmake -f
> Makefile
> ...
> clang++ -c -fstack-protector-strong -fstack-clash-protection -O2
> -ffile-prefix-map=/builddir/python-pyqt6-6.4.0=. -flto=thin -std=c++17
> -g2 -I. -I. -I.. -I../../qpy/QtCore -I/usr/include/python3.11
> -I/usr/include/qt6 -I/usr/include/qt6/QtCore -I.
> -I/usr/lib/qt6/mkspecs/linux-clang -o sipQtCoreQTimeZone.o
> sipQtCoreQTimeZone.cpp
> 
> clang++ -c -fstack-protector-strong -fstack-clash-protection -O2
> -ffile-prefix-map=/builddir/python-pyqt6-6.4.0=. -flto=thin -std=c++17
> -g2 -I. -I. -I.. -I../../qpy/QtCore -I/usr/include/python3.11
> -I/usr/include/qt6 -I/usr/include/qt6/QtCore -I.
> -I/usr/lib/qt6/mkspecs/linux-clang -o sipQtCoreQTimer.o
> sipQtCoreQTimer.cpp
> 
> /builddir/python-pyqt6-6.4.0/build/QtCore/sipQtCoreQTimer.cpp:607:49:
> error: 'timerEvent' is a protected member of 'QTimer'
>             (sipSelfWasArg ? sipCpp-> ::QTimer::timerEvent(a0) :
> sipCpp->timerEvent(a0));
>                                                 ^
> /usr/include/qt6/QtCore/qtimer.h:177:10: note: declared protected here
>     void timerEvent(QTimerEvent *) override;
> ==================================

You are probably the only person using that combination of compiler and 
library. Try using '--no-protected-is-public'.

Phil


More information about the PyQt mailing list