def toQPixmap(data):
    if (data is None):
        return QPixmap()
    elif isinstance(data, QPixmap):
        return data
    elif isinstance(data, QImage):
        QPixmap.fromImage(data)
    elif hasattr(data, 'pixmap'):
        return data.pixmap()
    else:
        return QPixmap.fromImage(toQImage(data))
def toQPixmap(data):
    if (data is None):
        return QPixmap()
    elif isinstance(data, QPixmap):
        return data
    elif isinstance(data, QImage):
        QPixmap.fromImage(data)
    elif hasattr(data, 'pixmap'):
        return data.pixmap()
    else:
        return QPixmap.fromImage(toQImage(data))