eric6/WebBrowser/Download/DownloadModel.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
39 @rtype any 39 @rtype any
40 """ 40 """
41 if index.row() < 0 or index.row() >= self.rowCount(index.parent()): 41 if index.row() < 0 or index.row() >= self.rowCount(index.parent()):
42 return None 42 return None
43 43
44 if role == Qt.ToolTipRole: 44 if role == Qt.ItemDataRole.ToolTipRole:
45 if ( 45 if (
46 self.__manager.downloads()[index.row()] 46 self.__manager.downloads()[index.row()]
47 .downloadedSuccessfully() 47 .downloadedSuccessfully()
48 ): 48 ):
49 return self.__manager.downloads()[index.row()].getInfoData() 49 return self.__manager.downloads()[index.row()].getInfoData()
106 @type QModelIndex 106 @type QModelIndex
107 @return flags 107 @return flags
108 @rtype Qt.ItemFlags 108 @rtype Qt.ItemFlags
109 """ 109 """
110 if index.row() < 0 or index.row() >= self.rowCount(index.parent()): 110 if index.row() < 0 or index.row() >= self.rowCount(index.parent()):
111 return Qt.NoItemFlags 111 return Qt.ItemFlag.NoItemFlags
112 112
113 defaultFlags = QAbstractListModel.flags(self, index) 113 defaultFlags = QAbstractListModel.flags(self, index)
114 114
115 itm = self.__manager.downloads()[index.row()] 115 itm = self.__manager.downloads()[index.row()]
116 if itm.downloadedSuccessfully(): 116 if itm.downloadedSuccessfully():
117 return defaultFlags | Qt.ItemIsDragEnabled 117 return defaultFlags | Qt.ItemFlag.ItemIsDragEnabled
118 118
119 return defaultFlags 119 return defaultFlags
120 120
121 def mimeData(self, indexes): 121 def mimeData(self, indexes):
122 """ 122 """

eric ide

mercurial