if myVariant.type() == QVariant.Int: value = myVariant.toInt() elif myVariant.type() == QVariant.QString: value = myVariant.toString()