2016-10-29 13 views

답변

1

난 내 자신의 문제를 해결 :

def openImage(self): 
    fileName = QFileDialog().getOpenFileName() 
    filePath = str(fileName[0]) 

    image = QImage(filePath) 

    label = QLabel() 
    label.setPixmap(QPixmap().fromImage(image)) 

    self.addWidget(label, 0, 0) 

    fileObject = filePath.split('/') 
    file = fileObject[ len(fileObject) - 1 ] 
    print(file) 
+1

픽스맵을 파일 경로에서 직접 이미지를로드 할 수 있습니다, 그래서 당신이 필요로하는 모든입니다'label.setPixmap (QPixmap (적인 filePath)) '. – ekhumoro