pyqt6DBusHelper: No insertMulti in Qt6 QMultiHash

Phil Thompson phil at riverbankcomputing.com
Sun Feb 21 15:55:11 GMT 2021


On 21/02/2021 15:34, Ben Greiner wrote:
> Hello,
> 
> I am taking the first steps in order to get a python-PyQt6 rpm package
> into the openSUSE Tumbleweed distribution. Currently, I get this error
> while trying to build:
> 
> [   12s] [269/385] cumulate libQt6Core6-6.0.0-2.3
> ...
> [   12s] [280/385] cumulate libQt6DBus6-6.0.0-2.3
> ...
> [   12s] [288/385] cumulate dbus-1-1.12.20-3.2
> ...
> [   12s] [294/385] cumulate dbus-1-devel-1.12.20-3.2
> ...
> [   29s] + sip-build-3.6 --verbose --api-dir
> /usr/share/qt6/qsci/api/python_3.6/ --no-make
> --qmake=/usr/lib64/qt6/bin/qmake --qmake-setting 'QMAKE_CFLAGS += -O2
> -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables
> -fasynchronous-unwind-tables -fstack-clash-protection
> -Werror=return-type -flto=auto -g ' --qmake-setting 'QMAKE_CXXFLAGS +=
> -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables
> -fasynchronous-unwind-tables -fstack-clash-protection
> -Werror=return-type -flto=auto -g ' --pep484-pyi --confirm-license
> --qt-shared
> [   30s] Querying qmake about your Qt installation...
> [   30s] /usr/lib64/qt6/bin/qmake -query
> [   30s] This is the GPL version of PyQt 6.0.1 (licensed under the GNU
> General Public License) for Python 3.6.12 on linux.
> ...
> [  123s] g++ -c -pipe -O2 -Wall -D_FORTIFY_SOURCE=2
> -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables
> -fstack-clash-protection -Werror=return-type -flto=auto -g -O2
> -std=gnu++1z -fno-exceptions -Wall -Wextra -D_REENTRANT -fPIC
> -DPy_LIMITED_API=0x03040000 -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG
> -DQT_PLUGIN -DQT_CORE_LIB -I. -I/usr/include/dbus-1.0
> -I/usr/lib64/dbus-1.0/include -I/usr/include/python3.6m
> -I/usr/include/qt6 -I/usr/include/qt6/QtCore -I.
> -I/usr/lib64/qt6/mkspecs/linux-g++ -o moc_helper.o moc_helper.cpp
> [  124s] ../../dbus/dbus.cpp: In function 'dbus_bool_t
> add_watch(DBusWatch*, void*)':
> [  124s] ../../dbus/dbus.cpp:43:37: warning: 'int
> dbus_watch_get_fd(DBusWatch*)' is deprecated
> [-Wdeprecated-declarations]
> [  124s]    43 |     int fd = dbus_watch_get_fd(watch);
> [  124s]       |                                     ^
> [  124s] In file included from 
> /usr/include/dbus-1.0/dbus/dbus-bus.h:30,
> [  124s]                  from /usr/include/dbus-1.0/dbus/dbus.h:31,
> [  124s]                  from 
> /usr/include/dbus-1.0/dbus/dbus-python.h:35,
> [  124s]                  from ../../dbus/dbus.cpp:27:
> [  124s] /usr/include/dbus-1.0/dbus/dbus-connection.h:481:21: note:
> declared here
> [  124s]   481 | DBUS_DEPRECATED int dbus_watch_get_fd      (DBusWatch
>        *watch);
> [  124s]       |                     ^~~~~~~~~~~~~~~~~
> [ 124s] ../../dbus/dbus.cpp:64:19: error: 'pyqt6DBusHelper::Watchers'
> {aka 'class QMultiHash<int, pyqt6DBusHelper::Watcher>'} has no member
> named 'insertMulti' [ 124s] 64 | hlp->watchers.insertMulti(fd,
> watcher);
> [  124s]       |                   ^~~~~~~~~~~
> [  124s] ../../dbus/dbus.cpp: In function 'void
> remove_watch(DBusWatch*, void*)':
> [  124s] ../../dbus/dbus.cpp:76:37: warning: 'int
> dbus_watch_get_fd(DBusWatch*)' is deprecated
> [-Wdeprecated-declarations]
> [  124s]    76 |     int fd = dbus_watch_get_fd(watch);
> [  124s]       |                                     ^
> [  124s] In file included from 
> /usr/include/dbus-1.0/dbus/dbus-bus.h:30,
> [  124s]                  from /usr/include/dbus-1.0/dbus/dbus.h:31,
> [  124s]                  from 
> /usr/include/dbus-1.0/dbus/dbus-python.h:35,
> [  124s]                  from ../../dbus/dbus.cpp:27:
> [  124s] /usr/include/dbus-1.0/dbus/dbus-connection.h:481:21: note:
> declared here
> [  124s]   481 | DBUS_DEPRECATED int dbus_watch_get_fd      (DBusWatch
>        *watch);
> [  124s]       |                     ^~~~~~~~~~~~~~~~~
> [  124s] ../../dbus/dbus.cpp: In function 'void
> toggle_watch(DBusWatch*, void*)':
> [  124s] ../../dbus/dbus.cpp:108:37: warning: 'int
> dbus_watch_get_fd(DBusWatch*)' is deprecated
> [-Wdeprecated-declarations]
> [  124s]   108 |     int fd = dbus_watch_get_fd(watch);
> [  124s]       |                                     ^
> [  124s] In file included from 
> /usr/include/dbus-1.0/dbus/dbus-bus.h:30,
> [  124s]                  from /usr/include/dbus-1.0/dbus/dbus.h:31,
> [  124s]                  from 
> /usr/include/dbus-1.0/dbus/dbus-python.h:35,
> [  124s]                  from ../../dbus/dbus.cpp:27:
> [  124s] /usr/include/dbus-1.0/dbus/dbus-connection.h:481:21: note:
> declared here
> [  124s]   481 | DBUS_DEPRECATED int dbus_watch_get_fd      (DBusWatch
>        *watch);
> [  124s]       |                     ^~~~~~~~~~~~~~~~~
> [  124s] ../../dbus/dbus.cpp: In function 'PyObject*
> DBusQtMainLoop(PyObject*, PyObject*, PyObject*)':
> [  124s] ../../dbus/dbus.cpp:356:32: warning: ISO C++ forbids
> converting a string constant to 'char*' [-Wwrite-strings]
> [  124s]   356 |     static char *argnames[] = {"set_as_default", 0};
> [  124s]       |                                ^~~~~~~~~~~~~~~~
> [  124s] ../../dbus/dbus.cpp: At global scope:
> [  124s] ../../dbus/dbus.cpp:400:24: warning: cast between
> incompatible function types from 'PyObject* (*)(PyObject*, PyObject*,
> PyObject*)' {aka '_object* (*)(_object*, _object*, _object*)'} to
> 'PyCFunction' {aka '_object* (*)(_object*, _object*)'}
> [-Wcast-function-type]
> [  124s]   400 |     {"DBusQtMainLoop", (PyCFunction)DBusQtMainLoop,
> METH_VARARGS|METH_KEYWORDS,
> [  124s]       |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> [  124s] ../../dbus/dbus.cpp: In function 'PyObject* 
> PyInit_dbus_mainloop()':
> [  124s] ../../dbus/dbus.cpp:415:5: warning: missing initializer for
> member 'PyModuleDef::m_slots' [-Wmissing-field-initializers]
> [  124s]   415 |     };
> [  124s]       |     ^
> [  124s] ../../dbus/dbus.cpp:415:5: warning: missing initializer for
> member 'PyModuleDef::m_traverse' [-Wmissing-field-initializers]
> [  124s] ../../dbus/dbus.cpp:415:5: warning: missing initializer for
> member 'PyModuleDef::m_clear' [-Wmissing-field-initializers]
> [  124s] ../../dbus/dbus.cpp:415:5: warning: missing initializer for
> member 'PyModuleDef::m_free' [-Wmissing-field-initializers]
> [  124s] make[1]: *** [Makefile:316: dbus.o] Error 1
> 
> Replacing `.insertMulti` with `.insert` in dbus/dbus.cpp seems to help.

I think that's the correct fix.

Thanks,
Phil


More information about the PyQt mailing list