- 
    
Bug
 - 
    Resolution: Done
 - 
    
P4: Low
 - 
    None
 - 
    6.3.0
 - 
    None
 
- 
        
 - 
        e4a8e8a139 (pyside/pyside-setup/dev) aeafc8eacd (pyside/pyside-setup/6.3) ef7cb23a10 (pyside/pyside-setup/6.2) ef7cb23a10 (pyside/tqtc-pyside-setup/6.2) aeafc8eacd (pyside/tqtc-pyside-setup/6.3) e4a8e8a139 (pyside/tqtc-pyside-setup/dev)
 
This code:
# from PyQt6.QtCore import QVariant, QMetaType # from PyQt6.QtWidgets import QApplication # from PyQt6.QtDBus import QDBusInterface, QDBusConnection, QDBus, QDBusMessage, QDBusArgument from PySide6.QtWidgets import QApplication from PySide6.QtDBus import QDBusInterface, QDBusConnection, QDBus, QDBusMessage SERVICE = "org.freedesktop.Notifications" PATH = "/org/freedesktop/Notifications" INTERFACE = SERVICE app = QApplication([]) bus = QDBusConnection.sessionBus() iface = QDBusInterface(SERVICE, PATH, INTERFACE, bus) assert iface.isValid(), iface.lastError() iface.call( QDBus.CallMode.Block, "Notify", "test", # app name 0, # replaces_id "", # icon filename "title", "body", [], # actions {}, # hints -1, # timeout )
works fine with PyQt6, but with PySide6, it raises:
Traceback (most recent call last):
  File "/home/florian/proj/qt/dev6/pyside-setup/test.py", line 17, in <module>
    iface.call(
TypeError: call expected at most 6 arguments, got 10
yet the Qt docs have an overload taking an arbitrary number of arguments, noting that:
Note: Before Qt 5.14, this function accepted a maximum of just eight (8) arguments.
As a workaround, using:
iface.callWithArgumentList(
    QDBus.CallMode.Block,
    "Notify",
    [
        "test",  # app name
        0,  # replaces_id
        "",  # icon filename
        "title",
        "body",
        [],  # actions
        {},  # hints
        -1,  # timeout
    ]
)
seems to work fine (other than PYSIDE-1319).
- mentioned in
 - 
                    
Page Loading...
 
| For Gerrit Dashboard: PYSIDE-1905 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V | 
| 408882,2 | PySide6: Add overloads with more parameters to QDBusAbstractInterface::call() | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 | 
| 409028,2 | PySide6: Add overloads with more parameters to QDBusAbstractInterface::call() | 6.3 | pyside/pyside-setup | Status: MERGED | +2 | 0 | 
| 409029,2 | PySide6: Add overloads with more parameters to QDBusAbstractInterface::call() | 6.2 | pyside/pyside-setup | Status: MERGED | +2 | 0 | 
| 411283,16 | shiboken6: Add a way to specify free functions | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 | 
| 411797,2 | shiboken6: Introduce a struct for PyMethodDef | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 | 
| 411931,2 | shiboken6: Introduce a struct for PyMethodDef | 6.3 | pyside/pyside-setup | Status: MERGED | +2 | 0 | 
| 412163,8 | WIP: Reimplement QDBusAbstractInterface::call() with a free function | dev | pyside/pyside-setup | Status: DEFERRED | -2 | 0 | 
| 412514,3 | shiboken6: Add doc field to PyMethodDef | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |