Inside of my QGraphicsRectItem::paint(), I am trying to draw the name of the item within its rect(). However, for each of the different items, they can be of variable width
You could have a QGraphicsTextItem as a child of the rect item, measure the text item's width and then scale the text item (setTransform()) to fit into the rect item's width (and height).