Skip to content

Bug report: 8.0.0 pyqt6 test_add_to_menu fails #1250

Open

Description

@opoplawski

Environment

OS: Linux
Python version: 3.11
Toolkit: Qt
Qt API: PyQt6

Description

ERROR: test_add_to_menu (pyface.action.tests.test_action_item.TestActionItem.test_add_to_menu)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/orion/BUILDROOT/python-pyface-8.0.0-1.fc39.x86_64/usr/lib/python3.11/site-packages/pyface/action/tests/test_action_item.py", line 100, in test_add_to_menu
    action_item.add_to_menu(window.control, menu, None)
  File "/home/orion/BUILDROOT/python-pyface-8.0.0-1.fc39.x86_64/usr/lib/python3.11/site-packages/pyface/action/action_item.py", line 100, in add_to_menu
    wrapper = _MenuItem(parent, menu, self, controller)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/orion/BUILDROOT/python-pyface-8.0.0-1.fc39.x86_64/usr/lib/python3.11/site-packages/pyface/ui/qt/action/action_item.py", line 82, in __init__
    self.control = menu.addAction(
                   ^^^^^^^^^^^^^^^
TypeError: arguments did not match any overloaded call:
  addAction(self, icon: QIcon, text: str): argument 1 has unexpected type 'str'
  addAction(self, icon: QIcon, text: str, slot: PYQT_SLOT, type: Qt.ConnectionType = Qt.AutoConnection): argument 1 has unexpected type 'str'
  addAction(self, icon: QIcon, text: str, shortcut: Union[QKeySequence, QKeySequence.StandardKey, str, int]): argument 1 has unexpected type 'str'
  addAction(self, icon: QIcon, text: str, shortcut: Union[QKeySequence, QKeySequence.StandardKey, str, int], slot: PYQT_SLOT, type: Qt.ConnectionType = Qt.AutoConnection): argument 1 has unexpected type 'str'
  addAction(self, text: str): too many arguments
  addAction(self, text: str, shortcut: Union[QKeySequence, QKeySequence.StandardKey, str, int]): argument 2 has unexpected type 'method'
  addAction(self, text: str, slot: PYQT_SLOT, type: Qt.ConnectionType = Qt.AutoConnection): argument 3 has unexpected type 'str'
  addAction(self, text: str, shortcut: Union[QKeySequence, QKeySequence.StandardKey, str, int], slot: PYQT_SLOT, type: Qt.ConnectionType = Qt.AutoConnection): argument 2 has unexpected type 'method'
  addAction(self, action: QAction): argument 1 has unexpected type 'str'

Steps to Reproduce

+ QT_API=pyqt6
+ case $toolkit in
+ export ETS_TOOLKIT=qt
+ ETS_TOOLKIT=qt
+ export EXCLUDE_TESTS=wx
+ EXCLUDE_TESTS=wx
+ fail=0
+ xvfb-run /usr/bin/python3 -Xfaulthandler -s -m unittest discover -v -f pyface

Activity

  1. corranwebster commented on Jun 12, 2023

    @corranwebster
    Contributor

    Thanks for the report - PyQt6 is not yet supported, although this issue is one I haven't seen before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions