JokerMartini
JokerMartini

Reputation: 6147

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?

Python

doors = QtGui.QStandardItem("Doors")

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

Upvotes: 0

Views: 612

Answers (1)

ekhumoro
ekhumoro

Reputation: 120618

  1. The Qt Documentation lists the item data roles.

  2. The font can be changed like this:

    font = item.font()
    font.setBold(True)
    item.setFont(font)
    

Upvotes: 1

Related Questions