For multiple items, insertItems() can be used instead. The number of items in the list is found with the count() function. To remove items from the list, use takeItem().
查了一下,得到上面的内容,我觉得可以在绘图事件里根据count()的值来绘制QListWidget的大小。
当要增加或减少ListWidget时,发一个自定义的信号,该信号连接到update()上。