I am a newbie with PySide. I have a QGridlayout with QLabel's and I want to add/remove/update QLabel.
Is it possible to create QList of QLabel with PySide similar to Qt in C++? After I populate the QGridlayout with QLabel and I want to dynamically increase/decrease the number of items in QGridlayout.
Is QListWidget/QListWidgetItem only way to create list in PySide? Can it be used with QLabel/QPixmap?
Sure. The python code will look just like C++ would look, sans syntax adaptations.
No. You can use a QStandardItemModel
, or a custom model. In addition, there's no point to creating QLabel
delegates for model data, since all standard views handle images and pixmaps available from Qt::DecorationRole
. If all you want is a list of images, even a custom model would be trivial.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.