eric6/Plugins/PluginWizardQFileDialog.py

changeset 7635
0cdead130a81
parent 7360
9190402e4505
child 7759
51aa6c6b66f7
equal deleted inserted replaced
7634:8c3d033e5044 7635:0cdead130a81
46 @param ui reference to the user interface object (UI.UserInterface) 46 @param ui reference to the user interface object (UI.UserInterface)
47 """ 47 """
48 super(FileDialogWizard, self).__init__(ui) 48 super(FileDialogWizard, self).__init__(ui)
49 self.__ui = ui 49 self.__ui = ui
50 50
51 # PyQt4 or PyQt5 51 # PyQt5
52 self.__pyqtRe = re.compile(r"(?:import|from)\s+PyQt([45])") 52 self.__pyqtRe = re.compile(r"(?:import|from)\s+PyQt([5])")
53 53
54 def activate(self): 54 def activate(self):
55 """ 55 """
56 Public method to activate this plugin. 56 Public method to activate this plugin.
57 57
122 Private method to display a dialog and get the code. 122 Private method to display a dialog and get the code.
123 123
124 @param editor reference to the current editor 124 @param editor reference to the current editor
125 @type Editor 125 @type Editor
126 @param variant variant of code to be generated 126 @param variant variant of code to be generated
127 (-1 = E5FileDialog, 0 = unknown, 4 = PyQt4, 5 = PyQt5) 127 (-1 = E5FileDialog, 0 = unknown, 5 = PyQt5)
128 @type int 128 @type int
129 @return the generated code (string) 129 @return the generated code (string)
130 """ 130 """
131 from WizardPlugins.FileDialogWizard.FileDialogWizardDialog import ( 131 from WizardPlugins.FileDialogWizard.FileDialogWizardDialog import (
132 FileDialogWizardDialog 132 FileDialogWizardDialog
164 match = self.__pyqtRe.search(editor.text()) 164 match = self.__pyqtRe.search(editor.text())
165 if match is None: 165 if match is None:
166 # unknown 166 # unknown
167 dialogVariant = 0 167 dialogVariant = 0
168 else: 168 else:
169 # PyQt4 or PyQt5 169 # PyQt5
170 dialogVariant = int(match.group(1)) 170 dialogVariant = int(match.group(1))
171 elif variant == "E5FileDialog": 171 elif variant == "E5FileDialog":
172 # E5FileDialog 172 # E5FileDialog
173 dialogVariant = -1 173 dialogVariant = -1
174 else: 174 else:

eric ide

mercurial