def attachment_add(self, parent): try: attachments = QtWidgets.QFileDialog.getOpenFileUrls()[0] for url in attachments: attachment = url.url().strip("file:///") self.listWidget.addItem(attachment) except Exception as ex: worQt_logger.log_dump_crash()
def attachment_remove(self, parent): try: list_items = self.widget_list.selectedItems() if not list_items: return for item in list_items: index = self.widget_list.row(item) self.widget_list.takeItem(index) except Exception as ex: worQt_logger.log_dump_crash()
def attachment_clear(self, parent): try: self.listWidget.clear() except Exception as ex: worQt_logger.log_dump_crash()