So I solved my problem.

It turns out QImage needs the image to be a flat numpy array.

Here is how it's done:

qrgb_dict = {'r': lambda x: QtGui.qRgb(x, 0, 0),
'g': lambda x: QtGui.qRgb(0, x, 0),
'b': lambda x: QtGui.qRgb(0, 0, x)}
colortable = [qrgb_dict[color](i) for i in range(256)]
img = QtGui.QImage(arr, w, h, w, QtGui.QImage.Format_Indexed8)
img.setColorTable(colortable)

Where arr is an array of shape (h,w) and with uint8 values in 0-255