def RecentPath_asqstandarditem(pathitem): icon_provider = QFileIconProvider() # basename of a normalized name (strip right path component separators) basename = os.path.basename(os.path.normpath(pathitem.abspath)) item = QStandardItem(icon_provider.icon(QFileInfo(pathitem.abspath)), basename) item.setToolTip(pathitem.abspath) item.setData(pathitem, Qt.UserRole) return item
def RecentPath_asqstandarditem(pathitem): icon_provider = QFileIconProvider() # basename of a normalized name (strip right path component separators) basename = os.path.basename(os.path.normpath(pathitem.abspath)) item = QStandardItem( icon_provider.icon(QFileInfo(pathitem.abspath)), basename ) item.setToolTip(pathitem.abspath) item.setData(pathitem, Qt.UserRole) return item
def icon(self): provider = QFileIconProvider() return provider.icon(QFileInfo(self.abspath))