JokerMartini JokerMartini - 5 months ago 74
Python Question

Pyside setData flags on QStandardItem

I have two questions here.

  1. Where can I find a list of all the available flags/properties I can set using the setData method of a QstandardItem? I only know of the one below because i came across it online.

  2. How do I set the Font of my QStandardItem to be bold?


doors = QtGui.QStandardItem("Doors")

doors.setData(QtGui.QBrush(QtGui.QColor(200, 10, 255, 255)), role=QtCore.Qt.ForegroundRole)

  1. The Qt Documentation lists the item data roles.

  2. The font can be changed like this:

    font = item.font()