Beispiel #1
0
## ]
## 
## for food in foods:
##     # create an item with a caption
##     item = QStandardItem(food)
## 
##     # add a checkbox to it
##     item.setCheckable(True)
## 
##     # Add the item to the model
##     model.appendRow(item)

for pick in cat[-40].picks:
     # create an item with a caption
     item = QStandardItem(str(pick.resource_id))
 
     # add a checkbox to it
     item.setCheckable(True)
     item.setEditable(False)
     item.setTristate(True)
 
     # Add the item to the model
     model.appendRow(item)

# Apply the model to the list view
list.setModel(model)

# Show the window and run the app
list.show()
app.exec_()
Beispiel #2
0
## ]
##
## for food in foods:
##     # create an item with a caption
##     item = QStandardItem(food)
##
##     # add a checkbox to it
##     item.setCheckable(True)
##
##     # Add the item to the model
##     model.appendRow(item)

for pick in cat[-40].picks:
    # create an item with a caption
    item = QStandardItem(str(pick.resource_id))

    # add a checkbox to it
    item.setCheckable(True)
    item.setEditable(False)
    item.setTristate(True)

    # Add the item to the model
    model.appendRow(item)

# Apply the model to the list view
list.setModel(model)

# Show the window and run the app
list.show()
app.exec_()