當前位置: 首頁>>代碼示例>>Python>>正文


Python QFileDialog.Options方法代碼示例

本文整理匯總了Python中PyQt5.QtWidgets.QFileDialog.Options方法的典型用法代碼示例。如果您正苦於以下問題:Python QFileDialog.Options方法的具體用法?Python QFileDialog.Options怎麽用?Python QFileDialog.Options使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyQt5.QtWidgets.QFileDialog的用法示例。


在下文中一共展示了QFileDialog.Options方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: open_exe_name_dialog

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import Options [as 別名]
def open_exe_name_dialog(parent, appname):
    options = QFileDialog.Options()
    options |= QFileDialog.DontUseNativeDialog
    file_name, _ = \
        QFileDialog.getOpenFileName(
            parent,
            "{} could not be found. Please locate it manually".format(appname),
            "",
            "Valid {} executable (*);;".format(appname),
            options=options
        )
    if file_name:
        print(file_name)
        return file_name
    else:
        print("No file is selected. guiscrcpy is likely to fail") 
開發者ID:srevinsaju,項目名稱:guiscrcpy,代碼行數:18,代碼來源:finder.py

示例2: loadEquations

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import Options [as 別名]
def loadEquations(self):
        options = QFileDialog.Options()
        options |= QFileDialog.DontUseNativeDialog
        fileName, _ = QFileDialog.getOpenFileName(self, "Add Custom Equations", "", "All Files (*);;Visma Files (*.vis)", options=options)
        if os.path.isfile(fileName):
            if os.path.getsize(fileName) == 0:
                return self.workSpace.warning("Input equations file is empty!")
            if self.workSpace.equations[0][0] == "No equations stored":
                self.workSpace.equations.pop(0)
            with open(fileName) as fileobj:
                for line in fileobj:
                    line = line.replace(' ', '').replace('\n', '')
                    if not any(line in item for item in self.workSpace.equations) and not (line.isspace() or line == ''):
                        self.workSpace.equations.insert(0, ('Equation No.' + str(len(self.workSpace.equations) + 1), line))
                self.workSpace.addEquation() 
開發者ID:aerospaceresearch,項目名稱:visma,代碼行數:17,代碼來源:window.py

示例3: choose_folder_dialog

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import Options [as 別名]
def choose_folder_dialog(parent, title):
    options = QFileDialog.Options()
    options |= QFileDialog.ShowDirsOnly
    dialog = QFileDialog(parent, title, os.path.expanduser("~"), options=options)
    dialog.setFileMode(QFileDialog.Directory)
    dialog.setParent(parent, QtCore.Qt.Sheet)
    return dialog 
開發者ID:Mebus,項目名稱:restatic,代碼行數:9,代碼來源:utils.py

示例4: AgentIco

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import Options [as 別名]
def AgentIco(self):

        try:

            options = QFileDialog.Options()
            options |= QFileDialog.DontUseNativeDialog
            fileName, _ = QFileDialog.getOpenFileName(self, options=options)

            icodir = fileName.replace('/',"\\\\")

            self.fileico.setText(icodir)
        except Exception as f:

            t, o, tb = sys.exc_info()
            print(f, tb.tb_lineno) 
開發者ID:azizaltuntas,項目名稱:Camelishing,代碼行數:17,代碼來源:start.py

示例5: selectPrivate

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import Options [as 別名]
def selectPrivate(self):

        try:

            options = QFileDialog.Options()
            options |= QFileDialog.DontUseNativeDialog
            fileName, _ = QFileDialog.getOpenFileName(self, options=options)

            icodir = fileName.replace('/',"\\\\")

            self.privatekey.setText(icodir)
        except Exception as f:

            t, o, tb = sys.exc_info()
            print(f, tb.tb_lineno) 
開發者ID:azizaltuntas,項目名稱:Camelishing,代碼行數:17,代碼來源:start.py

示例6: attach

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import Options [as 別名]
def attach(self):

        try:

            options = QFileDialog.Options()
            options |= QFileDialog.DontUseNativeDialog
            fileName, _ = QFileDialog.getOpenFileName(self, options=options)
            osrep = fileName.replace("/","\\\\")
            self.attachment.setText(osrep)
        except Exception as f:
            t, o, tb = sys.exc_info()
            print(f,tb.tb_lineno) 
開發者ID:azizaltuntas,項目名稱:Camelishing,代碼行數:14,代碼來源:start.py

示例7: choose_file_dialog

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import Options [as 別名]
def choose_file_dialog(parent, title, want_folder=True):
    options = QFileDialog.Options()
    if want_folder:
        options |= QFileDialog.ShowDirsOnly
    dialog = QFileDialog(parent, title, os.path.expanduser('~'), options=options)
    dialog.setFileMode(QFileDialog.Directory if want_folder else QFileDialog.AnyFile)
    dialog.setParent(parent, QtCore.Qt.Sheet)
    return dialog 
開發者ID:borgbase,項目名稱:vorta,代碼行數:10,代碼來源:utils.py

示例8: openFileDialog

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import Options [as 別名]
def openFileDialog(fileSpec="CSV Files (*.csv);;All Files (*)"):    
    options = QFileDialog.Options()
    options |= QFileDialog.DontUseNativeDialog
    fileName, _ = QFileDialog.getOpenFileName(None,"QFileDialog.getOpenFileName()", "",fileSpec, options=options)
    if fileName:
        return fileName
    else:
        return None 
開發者ID:ghostop14,項目名稱:sparrow-wifi,代碼行數:10,代碼來源:sparrowdialogs.py

示例9: saveFileDialog

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import Options [as 別名]
def saveFileDialog(fileSpec="CSV Files (*.csv);;All Files (*)"):    
    options = QFileDialog.Options()
    options |= QFileDialog.DontUseNativeDialog
    fileName, _ = QFileDialog.getSaveFileName(None,"QFileDialog.getSaveFileName()","",fileSpec, options=options)
    if fileName:
        return fileName
    else:
        return None


# ------------------  Global functions for agent HTTP requests ------------------------------ 
開發者ID:ghostop14,項目名稱:sparrow-wifi,代碼行數:13,代碼來源:sparrowdialogs.py

示例10: seleccionarImagen

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import Options [as 別名]
def seleccionarImagen(self):
        imagen, extension = QFileDialog.getOpenFileName(self, "Seleccionar imagen", getcwd(),
                                                        "Archivos de imagen (*.png *.jpg)",
                                                        options=QFileDialog.Options())
          
        if imagen:
            # Adaptar imagen
            pixmapImagen = QPixmap(imagen).scaled(112, 128, Qt.KeepAspectRatio,
                                                  Qt.SmoothTransformation)

            # Mostrar imagen
            self.labelImagen.setPixmap(pixmapImagen)


# ================================================================ 
開發者ID:andresnino,項目名稱:PyQt5,代碼行數:17,代碼來源:mostrarImagen.py

示例11: setSaveFileName

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import Options [as 別名]
def setSaveFileName(self, obj):
		options = QFileDialog.Options()
		fileName, _ = QFileDialog.getOpenFileName(self,
				"Select File",
				obj.text(),
				"All Files (*)", options=options)
		if fileName:
			obj.setText(fileName) 
開發者ID:xqemu,項目名稱:xqemu-manager,代碼行數:10,代碼來源:main.py

示例12: loadMNConf

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import Options [as 別名]
def loadMNConf(self):
        options = QFileDialog.Options()
        fileName, _ = QFileDialog.getOpenFileName(self, 'Open masternode.conf', 'masternode.conf', 'Text Files (*.conf)', options=options)

        if fileName:
            self.mainWindow.loadMNConf(fileName) 
開發者ID:PIVX-Project,項目名稱:PIVX-SPMT,代碼行數:8,代碼來源:spmtApp.py

示例13: openmail

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import Options [as 別名]
def openmail(self):

        try:

            self.mail = list()

            options = QFileDialog.Options()
            options |= QFileDialog.DontUseNativeDialog
            fileName, _ = QFileDialog.getOpenFileName(self, options=options)

            say = 0
            nagato = ""
            notlist = list()
            yeslist = list()

            with open(fileName, 'r') as g:

                for k999 in g:
                    notlist.append(k999)

            with open(fileName, 'r') as f:

                if not fileName.endswith(".txt"):
                    self.ThreadMessage("Mail List Error", "Please Select '.txt' File" , "Info")

                else:
                    self.maillist.setText(fileName)
                    for _ in f:
                        mailReg = re.search(r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)", _)


                        if mailReg:

                            yeslist.append(_)
                            itemsTextList = [str(self.maillistWidget.item(i).text()) for i in
                                             range(self.maillistWidget.count())]
                            say += 1

                            if _ in itemsTextList:
                                pass
                            else:
                                self.maillistWidget.addItem(_)
                                self.mailliststatus.setText(" " * 21 + str(say) + " Email Added")

                                self.mail.append(_)

                    else:

                        ka = list(set(notlist)-set(yeslist))
                        count = 0

                        for ningendo in ka:
                            count += 1
                            nagato += "{}".format(count)+"- "+ningendo+"\n"

                        self.ThreadMessage("Mail Attach Error", "Not Email Adress;\n\n {}".format(nagato), "Info")
        except:

            pass 
開發者ID:azizaltuntas,項目名稱:Camelishing,代碼行數:61,代碼來源:start.py


注:本文中的PyQt5.QtWidgets.QFileDialog.Options方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。