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


Python QFileDialog.DontUseNativeDialog方法代碼示例

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


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

示例1: dialog_save_lattice

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import DontUseNativeDialog [as 別名]
def dialog_save_lattice(self):
        """Save lattice to file"""

        filename = QFileDialog.getSaveFileName(self.mw, 'Save Lattice', '', "Python Files (*.py);;All Files (*)", options=QFileDialog.DontUseNativeDialog)
        if filename[0] == '':
            return 0

        lp = Parser()
        lines = lp.gui_lattice2input(self.mw.lattice, split=True)

        if filename[1] == 'Python Files (*.py)' and filename[0][-3:] != '.py':
            filename = filename[0] + '.py'
        else:
            filename = filename[0]

        with open(filename, 'w') as fp:
            fp.writelines(lines) 
開發者ID:ocelot-collab,項目名稱:ocelot,代碼行數:19,代碼來源:menu_file.py

示例2: open_exe_name_dialog

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import DontUseNativeDialog [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

示例3: loadEquations

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import DontUseNativeDialog [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

示例4: dialog_open_lattice

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import DontUseNativeDialog [as 別名]
def dialog_open_lattice(self):
        """Read lattice from file"""

        filename = QFileDialog.getOpenFileName(self.mw, 'Open Lattice', '', "Python Files (*.py);;All Files (*)", options=QFileDialog.DontUseNativeDialog)[0]
        if filename == '':
            return 0
            
        self.mw.lattice = GUILattice()    
        
        # executing opened file
        loc_dict = {}
        try:
            exec(open(filename).read(), globals(), loc_dict)
        except Exception as err:
            self.mw.error_window('Open Lattice File Error', str(err))
        
        # parsing sequences and create elements list from cell
        if 'cell' in loc_dict:
            self.mw.lattice.cell = deepcopy(loc_dict['cell'])
            lp = Parser()
            self.mw.lattice.elements = lp.get_elements(self.mw.lattice.cell)
        else:
            self.mw.error_window('Open Lattice File Error', 'NO secuence named "cell"')
        
        # parsing method
        if 'method' in loc_dict:
            self.mw.lattice.method = deepcopy(loc_dict['method'])
        
        # parsing beam
        if 'beam' in loc_dict:
            self.mw.lattice.beam = deepcopy(loc_dict['beam'])
        
        # parsing tws0
        if 'tws0' in loc_dict:
            self.mw.lattice.tws0 = deepcopy(loc_dict['tws0'])
        
        self.mw.menu_edit.edit_lattice() 
開發者ID:ocelot-collab,項目名稱:ocelot,代碼行數:39,代碼來源:menu_file.py

示例5: _export2JqkaAct

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import DontUseNativeDialog [as 別名]
def _export2JqkaAct(self):
        data = {}
        if not DyStockTableSelectDlg(data, '{0}導出到同花順'.format(self.getUniqueName())).exec_():
            return

        defaultFileName = '{0}.sel' if data['all'] else '{0}_高亮.sel'
        defaultFileName = defaultFileName.format(self.getUniqueName())

        defaultDir = DyCommon.createPath('Stock/User/Save/Strategy/同花順')
        fileName, _ = QFileDialog.getSaveFileName(None, '導出到同花順', os.path.join(defaultDir, defaultFileName), "同花順files (*.sel);;all files(*.*)", options=QFileDialog.DontUseNativeDialog)
        if fileName:
            self.export2Jqka(fileName) 
開發者ID:moyuanz,項目名稱:DevilYuan,代碼行數:14,代碼來源:DyStockTableWidget.py

示例6: _saveAsAct

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import DontUseNativeDialog [as 別名]
def _saveAsAct(self):
        data = {}
        if not DyStockTableSelectDlg(data, '{0}保存'.format(self.getUniqueName())).exec_():
            return

        defaultFileName = '{0}.json' if data['all'] else '{0}_高亮.json'
        defaultFileName = defaultFileName.format(self.getUniqueName())

        defaultDir = DyCommon.createPath('Stock/User/Save/Strategy')
        fileName, _ = QFileDialog.getSaveFileName(None, '保存股票表', os.path.join(defaultDir, defaultFileName), "JSON files (*.json);;all files(*.*)", options=QFileDialog.DontUseNativeDialog)
        if fileName:
            self._saveAs(fileName, data['all']) 
開發者ID:moyuanz,項目名稱:DevilYuan,代碼行數:14,代碼來源:DyStockTableWidget.py

示例7: AgentIco

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import DontUseNativeDialog [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

示例8: selectPrivate

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import DontUseNativeDialog [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

示例9: attach

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import DontUseNativeDialog [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

示例10: openFileDialog

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import DontUseNativeDialog [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

示例11: saveFileDialog

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import DontUseNativeDialog [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

示例12: _get_save_name

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import DontUseNativeDialog [as 別名]
def _get_save_name(self, ext):
        fullname = '{}_{}{}'.format(self.root_file, self.save_postfix ,ext)

        dialog = QFileDialog()
        
        dialog.selectFile(fullname)
        dialog.setOptions(QFileDialog.DontUseNativeDialog)
        dialog.setFileMode(QFileDialog.AnyFile)
        dialog.setAcceptMode(QFileDialog.AcceptSave)
        dialog.setNameFilters(['*' + ext])
        ret = dialog.exec();
        if (ret == QDialog.Accepted):
            fullname = dialog.selectedFiles()[0]
        return fullname 
開發者ID:ver228,項目名稱:tierpsy-tracker,代碼行數:16,代碼來源:PlotFeatures.py

示例13: UploadImagem

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import DontUseNativeDialog [as 別名]
def UploadImagem(self):
        Dialog = QFileDialog()
        Dialog.setOption(QFileDialog.DontUseNativeDialog, True)

        fname = Dialog.getOpenFileName(
            self, "Selecionar Imagem", "", "Image files (*.jpg *.png)")[0]

        self.lb_FotoProduto.setPixmap(QPixmap(fname).scaledToWidth(
            150, Qt.TransformationMode(Qt.FastTransformation)))
        # self.lb_FotoProduto.setScaledContents(True)
        self.bt_AddImagem.setHidden(True)
        self.bt_DelImagem.setVisible(True) 
開發者ID:andrersp,項目名稱:controleEstoque,代碼行數:14,代碼來源:mainprodutos.py

示例14: UploadLogo

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import DontUseNativeDialog [as 別名]
def UploadLogo(self):
        Dialog = QFileDialog()
        Dialog.setOption(QFileDialog.DontUseNativeDialog, True)

        fname = Dialog.getOpenFileName(
            self, "Selecionar Logo", "", "Image files (*.jpg *.png)")[0]

        self.lb_LogoEmpresa.setPixmap(QPixmap(fname).scaledToWidth(
            300, Qt.TransformationMode(Qt.FastTransformation)))
        # self.lb_LogoEmpresa.setScaledContents(True)
        self.bt_AddLogo.setHidden(True)
        self.bt_DelLogo.setVisible(True) 
開發者ID:andrersp,項目名稱:controleEstoque,代碼行數:14,代碼來源:mainempresa.py

示例15: openmail

# 需要導入模塊: from PyQt5.QtWidgets import QFileDialog [as 別名]
# 或者: from PyQt5.QtWidgets.QFileDialog import DontUseNativeDialog [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.DontUseNativeDialog方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。