from PyQt4 import QtCore from PyQt4 import QtGui # This works i = QtGui.QIcon() qi = QtCore.QVariant(i) # This throws TypeError: argument 1 of QVariant() has invalid type class C: def __init__(self, v): self.value = v x = C(100) qx = QtCore.QVariant(x)