我们从Python开源项目中,提取了以下14个代码示例,用于说明如何使用PyQt5.QtWidgets.QFileDialog.DontUseNativeDialog()。
def getLogoFilePath(self, lblwidget): self.ui.lbl_browse.clear() filename, _ = QFileDialog.getOpenFileName( self, 'Open File', " ../../", 'Images (*.png *.svg*.jpg)', None, QFileDialog.DontUseNativeDialog) flag = True if filename == '': flag = False return flag else: base = os.path.basename(str(filename)) lblwidget.setText(base) self.desired_location(filename) return str(filename)
def openFileNameDialog(self): options = QFileDialog.Options() options |= QFileDialog.DontUseNativeDialog fileName, _ = QFileDialog.getOpenFileName(self,"QFileDialog.getOpenFileName()", "","All Files (*);;Python Files (*.py)", options=options) if fileName: print(fileName)
def openFileNamesDialog(self): options = QFileDialog.Options() options |= QFileDialog.DontUseNativeDialog files, _ = QFileDialog.getOpenFileNames(self,"QFileDialog.getOpenFileNames()", "","All Files (*);;Python Files (*.py)", options=options) if files: print(files)
def saveFileDialog(self): options = QFileDialog.Options() options |= QFileDialog.DontUseNativeDialog fileName, _ = QFileDialog.getSaveFileName(self,"QFileDialog.getSaveFileName()","","All Files (*);;Text Files (*.txt)", options=options) if fileName: print(fileName)
def openFileNameDialog(self): print("set icon clicked") options = QFileDialog.Options() options |= QFileDialog.DontUseNativeDialog fileName, _ = QFileDialog.getOpenFileName(self, "Choose Contact Icon", "", "Image Files (*.jpg *.png)", options=options) if fileName: print(fileName) pixmap = QtGui.QPixmap(fileName) self.contact_icon.setPixmap(pixmap) self.contact_icon.setScaledContents(True) # pixmap2 = self.contact_icon.pixmap() # print(pixmap2)
def openFileNameDialog(self): options = QFileDialog.Options() options |= QFileDialog.DontUseNativeDialog fileName, _ = QFileDialog.getOpenFileName(self,"QFileDialog.getOpenFileName()", "","All Files (*);;Python Files (*.py)", options=options) if fileName: return str(fileName) else: return 'Path to the file used to start miner'
def getLogoFilePath(self, lblwidget): self.ui.lbl_browse.clear() filename, _ = QFileDialog.getOpenFileName(self, 'Open File', "../../ ", 'Images (*.png *.svg *.jpg)', None, QFileDialog.DontUseNativeDialog) flag = True if filename == '': flag = False return flag else: base = os.path.basename(str(filename)) lblwidget.setText(base) self.desired_location(filename) return str(filename)
def get_logo_file_path(self, lblwidget): self.ui.lbl_browse.clear() filename, _ = QFileDialog.getOpenFileName(self, 'Open File', " ", 'Images (*.png *.svg *.jpg)', None, QFileDialog.DontUseNativeDialog) flag = True if filename == '': flag = False return flag else: base = os.path.basename(str(filename)) lblwidget.setText(base) self.desired_location(filename) return str(filename)
def get_logo_file_path(self, lblwidget): self.ui.lbl_browse.clear() filename, _ = QFileDialog.getOpenFileName(self, 'Open File', "../../ ", 'Images (*.png *.svg *.jpg)', None, QFileDialog.DontUseNativeDialog) flag = True if filename == '': flag = False return flag else: base = os.path.basename(str(filename)) lblwidget.setText(base) self.desired_location(filename)
def openFileNameDialog(self): options = QFileDialog.Options() options |= QFileDialog.DontUseNativeDialog fileName, _ = QFileDialog.getOpenFileName(self, "QFileDialog.getOpenFileName()", "", "All Files (*);;Python Files (*.py)", options=options) return fileName