Aw: Re: Bugreport: QDBusArgument does not work with PyQt6

Phil Thompson phil at riverbankcomputing.com
Thu Jun 30 18:32:56 BST 2022


Sorry, I need something much, much simpler to work with.

Running your example with dbus-monitor running for both PyQt5 and PyQt6 
shows the same arguments suggesting that the marshalling is working the 
same.

Phil

On 30/06/2022 12:34, JakobDev wrote:
> It's the QDbusArgument Object that causes the problem. i don't now, if
> QBytesArray needs to be implementet too in PyQt6, but would be nice if
> we just could use the normal python bytes.
> 
> I'm trying to use the PrepareInstall Method of the DynamicLauncher
> Portal (Documenation:
> https://flatpak.github.io/xdg-desktop-portal/#gdbus-method-org-freedesktop-portal-DynamicLauncher.PrepareInstall)
> It is pretty new. The doc says, it needs a GIcon, but it needs just
> the text Icon followed by the Bytes of a Image file. As far as I know
> KDE 525 is currently the only majror DE that has it impelemented. I
> have atached a ZIP file which includes all needed files. If you run
> this code on a system that has the Portal implemented, it should work.
> If you use PyQt6 instead of PyQt5, it didn't work.
> 
> KDE has implementet a test of the Portal which uses C++ with Qt5. You
> can find the source here:
> https://invent.kde.org/libraries/xdg-portal-test-kde/-/blob/57ccdb68a24f618dbe1254cb531bc96be34e27e7/src/xdgportaltest.cpp#L807
> 
> 
> The implementation for the GIcon function can be found here:
> https://gitlab.gnome.org/GNOME/glib/-/blob/89b1fe42d761d68735e8755dec8cf62c8dfc5eef/gio/gbytesicon.c#L203-210
> 
> 
> I hope that is all you need to make this work under PyQt6.
> 
> Gesendet: Donnerstag, 30. Juni 2022 um 12:42 Uhr
> Von: "Phil Thompson" <phil at riverbankcomputing.com>
> An: "JakobDev" <jakobdev at gmx.de>
> Cc: pyqt at riverbankcomputing.com
> Betreff: Re: Bugreport: QDBusArgument does not work with PyQt6
> On 29/06/2022 12:48, JakobDev wrote:
>> If you run the attached code with PyQt5 everything works as
> expected.
>> but if you chance the imports from PyQt5 to PyQt6 you get this
> error:
>> QDBusMarshaller: type `PyQt_PyObject' (65729) is not registered with
>> D-BUS. Use qDBusRegisterMetaType to register it. It looks like PyQt6
>> doesn't accept QDBusArgument.
> 
> What is the argument that is causing the problem?
> 
> While it would be easy enough to register PyQt_PyObject there wouldn't
> be much point if the other end doesn't know what to do with it.
> 
> Phil


More information about the PyQt mailing list