저는 제본 용 응용 프로그램에서 (여전히) 작업하고 있으며 그것을 예술적으로 즐겁게 만들기 위해 드래그 한 모든 페이지에 미리보기 이미지를 추가했습니다. 문제는 없지만 드래그 할 때 유일한 문제는 전체 책 (예 : 400 이미지)은 완료 될 때까지 을 완전히 동결합니다. 당신이 코드에서 볼 수 있듯이 f = str(file[-1])
, 그냥 측면 질문으로, 또한PyQT4를 사용하여 300 개의 이미지를 (빨리) 미리보기 할 수 있습니까?
def fileDropped(self, file):
f = str(file[-1])
if os.path.splitext(f)[1][1:] != 'tif':
reply = QtGui.QMessageBox.question(self, 'Message', 'All files must be TIF images. Would you like me to convert a copy of your file to the TIF format?', QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.No)
if reply == QtGui.QMessageBox.Yes:
if not os.path.exists('./djvu_backup/'): os.mkdir('./djvu_backup/')
if f not in self.getChildren(self.ui.pageList): # It's a custom method. It does what it looks like it does.
icon = QtGui.QIcon(f)
pixmap = icon.pixmap(72, 72)
icon = QtGui.QIcon(pixmap)
item = QtGui.QListWidgetItem(f, self.ui.pageList)
item.setIcon(icon)
item.setStatusTip(f)
return True
:
은 여기 내 간단한 드롭 코드입니다. 메소드를 호출 할 때마다 드롭 된 파일 배열의 마지막 요소를 선택해야합니다. 드롭 된 모든 파일은 한 번에 삭제 된 경우에도 호출됩니다. 이 이유/해결 방법이 있습니까?
감사합니다.
스레딩이 필요합니다 - http://stackoverflow.com/questions/1595649/threading-in-a-pyqt-application-use-qt-threads-or-python-threads –
Python 질문에 감사드립니다. 나는 그것을 탐색 할 것이다. – Blender