Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

addAction(self, action: typing.Optional[QAction]): argument 1 has unexpected type 'str' #8

Open
Open
addAction(self, action: typing.Optional[QAction]): argument 1 has unexpected type 'str' #8

Description

I install PyQt6 and use this code:

from objbrowser import browse
a = 16; b = 'hello'
browse(locals())

It gives this error:

Traceback (most recent call last):
File "D:\QC supplements\Code\Apps\Tran Ky\test.py", line 3, in
browse(locals())
File "C:\Users\ganuo\AppData\Local\Programs\Python\Python311\Lib\ site-packages\objbrowser\__init__.py", line 45, in browse
ObjectBrowser.browse(*args, **kwargs)
File "C:\Users\ganuo\AppData\Local\Programs\Python\Python311\Lib\ site-packages\objbrowser\objectbrowser.py", line 627, in browse
cls.create_browser(*args, **kwargs)
File "C:\Users\ganuo\AppData\Local\Programs\Python\Python311\Lib\ site-packages\objbrowser\objectbrowser.py", line 598, in create_browser
object_browser = cls(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ganuo\AppData\Local\Programs\Python\Python311\Lib\ site-packages\objbrowser\objectbrowser.py", line 99, in __init__
self._setup_menu()
File "C:\Users\ganuo\AppData\Local\Programs\Python\Python311\Lib\ site-packages\objbrowser\objectbrowser.py", line 202, in _setup_menu
file_menu.addAction("C&lose", self.close, "Ctrl+W")
TypeError: arguments did not match any overloaded call:
addAction(self, icon: QIcon, text: Optional[str]): argument 1 has unexpected type 'str'
addAction(self, icon: QIcon, text: Optional[str], slot: PYQT_SLOT, type: Qt.ConnectionType = Qt.AutoConnection): argument 1 has unexpected type 'str'
addAction(self, icon: QIcon, text: Optional[str], shortcut: Union[QKeySequence, QKeySequence.StandardKey, Optional[str], int]): argument 1 has unexpected type 'str'
addAction(self, icon: QIcon, text: Optional[str], shortcut: Union[QKeySequence, QKeySequence.StandardKey, Optional[str], int], slot: PYQT_SLOT, type: Qt.ConnectionType = Qt.AutoConnection): argument 1 has unexpected type 'str'
addAction(self, text: Optional[str]): too many arguments
addAction(self, text: Optional[str], shortcut: Union[QKeySequence, QKeySequence.StandardKey, Optional[str], int]): argument 2 has unexpected type 'builtin_function_or_method'
addAction(self, text: Optional[str], slot: PYQT_SLOT, type: Qt.ConnectionType = Qt.AutoConnection): argument 3 has unexpected type 'str' addAction(self, text: Optional[str], shortcut: Union[QKeySequence, QKeySequence.StandardKey, Optional[str], int], slot: PYQT_SLOT, type: Qt.ConnectionType = Qt.AutoConnection): argument 2 has unexpected type 'builtin_function_or_method'
addAction(self, action: typing.Optional[QAction]): argument 1 has unexpected type 'str'

Why is that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions