コード例 #1
0
    def __init__(self, item_list=None):
        """ Initialise the instance.
        """
        QMimeData.__init__(self)
        # print('init PyMimeData')

        # Keep a local reference to be returned if possible.
        self._local_instance = item_list

        if item_list is not None:
            # We may not be able to pickle the data.
            try:
                pdata = dumps(item_list)
            except Exception as ex:
                print("dumps not successfull", ex.__str__())
                return

            # This format (as opposed to using a single sequence) allows the
            # type to be extracted without unpickling the data itself.
            # self.setData(self.MIME_TYPE, dumps(item_list.__class__) + pdata)

            self.setData(self.MIME_TYPE, pdata)
コード例 #2
0
 def __init__(self):
     QMimeData.__init__(self)
     self.width = 0
     self.height = 0
     self.source_list = None