Answer the question
In order to leave comments, you need to log in
Why is the shift done by 3 elements even though BatchSize = 100?
Explain why when scrolling the wheel in QListWidget, the top item first becomes "item 4", then "item 7", "item 10" and so on, although BatchSize = 100? That is, BatchSize is not the number of elements when scrolling the mouse wheel? Here is the code ready to run:
import sys
from PyQt5 import QtCore, QtWidgets
app = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QWidget()
window.setWindowTitle("Класс QListView")
window.resize(300, 150)
view = QtWidgets.QListView()
view.setLayoutMode(QtWidgets.QListView.Batched)
view.setBatchSize(100)
L = []
for i in range(1, 100000):
L.append("Пункт {0}".format(i))
model = QtCore.QStringListModel(L)
view.setModel(model)
box = QtWidgets.QVBoxLayout()
box.addWidget(view)
window.setLayout(box)
window.show()
sys.exit(app.exec_())
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question