Bash:
[user@host ~]$ python3 -c 'from PyQt6 import QtCore; print(QtCore.QItemSelection())'
<PyQt6.QtCore.QItemSelection object at 0x7f57868f5ac0>
[user@host ~]$ python3 -c 'from PySide6 import QtCore; print(QtCore.QItemSelection())'
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: QItemSelection expected at least 1 argument, got 0
Не хочет создаваться пустой QItemSelection. Аргументы ему, видите ли, подавай.
Хотя если верить документации https://doc.qt.io/qtforpython/PySide6/QtCore/QItemSelection.html#detailed-description (и если я ничего не напутал) - то должен создаваться пустой и не жаловаться.
An empty item selection can be constructed, and later populated as required. So, if the model is going to be unavailable when we construct the item selection, we can rewrite the above code in the following way:
Python:
selection = QItemSelection()
...
selection.select(topLeft, bottomRight)
p.s. Версия Qt - 6.1.2
ось - Arch Linux
Python 3.9.6
Bash:
$ pip list | grep -iE 'pyside6|pyqt6'
PyQt6 6.1.1
PyQt6-sip 13.1.0
PySide6 6.1.2