ComboBox activated(int) does not get the index argument with PyQt5
See original GitHub issueI have a python script doig the following:
class MainWindow(QQuickView):
def __init__(self):
...
self.screen1usageCombo = self.findChild(QtCore.QObject, "combo_screen1_usage")
self.screen1usageCombo.activated.connect(self.change_screen1_mode)
...
@asyncSlot()
async def change_screen1_mode(self, index):
...
It works perfectly with Pyside2, but with PyQt5 (both 5.13.2 and 5.14.1) the result is:
Traceback (most recent call last):
File "/home/yann/.local/lib/python3.7/site-packages/asyncqt/__init__.py", line 644, in wrapper
asyncio.ensure_future(fn(*args, **kwargs))
TypeError: change_screen1_mode() missing 1 required positional argument: 'index'
Aborted
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
PyQt5 - Setting current index in ComboBox - GeeksforGeeks
Syntax : combo_box.setCurrentIndex(index) ; Argument : It takes integer as argument ; Action performed : It will set item of given index.
Read more >How to get current value from PyQt comboBox - Stack Overflow
Returns the data for the given role in the given index in the combobox, or QVariant.Invalid if there is no data for this...
Read more >QComboBox — Qt for Python - Qt Documentation
This property holds the index of the current item in the combobox.. The current index can change when inserting or removing items. By...
Read more >PyQt Layouts: Create Professional-Looking GUI Applications
In this step-by-step tutorial, you'll learn how to use PyQt layouts to arrange and manage the graphical components on your GUI applications.
Read more >QComboBox Class Reference
The QComboBox widget is a combined button and popup list. More. ... The parent argument, if not None, causes self to be owned...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Confirmed on my side as well!
I think you have to pass the type to the slot decorator, try this: @asyncSlot(object).