167 venvName = self.project.getDebugProperty("VIRTUALENV") |
167 venvName = self.project.getDebugProperty("VIRTUALENV") |
168 if not venvName: |
168 if not venvName: |
169 # no project specific environment, try a type specific one |
169 # no project specific environment, try a type specific one |
170 if projectType in ("PyQt5", "E6Plugin", "PySide2"): |
170 if projectType in ("PyQt5", "E6Plugin", "PySide2"): |
171 venvName = Preferences.getQt("PyQtVenvName") |
171 venvName = Preferences.getQt("PyQtVenvName") |
172 elif projectType in ("PyQt6", ): |
172 elif projectType in ("PyQt6", "PySide6"): |
173 venvName = Preferences.getQt("PyQt6VenvName") |
173 venvName = Preferences.getQt("PyQt6VenvName") |
174 interpreter = venvManager.getVirtualenvInterpreter(venvName) |
174 interpreter = venvManager.getVirtualenvInterpreter(venvName) |
175 execPath = venvManager.getVirtualenvExecPath(venvName) |
175 execPath = venvManager.getVirtualenvExecPath(venvName) |
176 |
176 |
177 if not interpreter: |
177 if not interpreter: |
186 else: |
186 else: |
187 env.insert("PATH", execPath) |
187 env.insert("PATH", execPath) |
188 |
188 |
189 if projectType in ("PyQt5", "E6Plugin", "PySide2"): |
189 if projectType in ("PyQt5", "E6Plugin", "PySide2"): |
190 loadUi = os.path.join(os.path.dirname(__file__), "UicLoadUi5.py") |
190 loadUi = os.path.join(os.path.dirname(__file__), "UicLoadUi5.py") |
191 elif projectType in ("PyQt6", ): |
191 elif projectType in ("PyQt6", "PySide6"): |
192 loadUi = os.path.join(os.path.dirname(__file__), "UicLoadUi6.py") |
192 loadUi = os.path.join(os.path.dirname(__file__), "UicLoadUi6.py") |
193 args = [ |
193 args = [ |
194 loadUi, |
194 loadUi, |
195 command, |
195 command, |
196 self.formFile, |
196 self.formFile, |
418 try: |
418 try: |
419 if self.project.getProjectType() == "PySide2": |
419 if self.project.getProjectType() == "PySide2": |
420 tmplName = os.path.join( |
420 tmplName = os.path.join( |
421 getConfig('ericCodeTemplatesDir'), |
421 getConfig('ericCodeTemplatesDir'), |
422 "impl_pyside2.py.tmpl") |
422 "impl_pyside2.py.tmpl") |
|
423 elif self.project.getProjectType() == "PySide6": |
|
424 tmplName = os.path.join( |
|
425 getConfig('ericCodeTemplatesDir'), |
|
426 "impl_pyside6.py.tmpl") |
423 elif self.project.getProjectType() in [ |
427 elif self.project.getProjectType() in [ |
424 "PyQt5", "E6Plugin"]: |
428 "PyQt5", "E6Plugin"]: |
425 tmplName = os.path.join( |
429 tmplName = os.path.join( |
426 getConfig('ericCodeTemplatesDir'), |
430 getConfig('ericCodeTemplatesDir'), |
427 "impl_pyqt5.py.tmpl") |
431 "impl_pyqt5.py.tmpl") |
504 if line.lstrip().startswith("def __init__"): |
508 if line.lstrip().startswith("def __init__"): |
505 indentStr = line.replace(line.lstrip(), "") |
509 indentStr = line.replace(line.lstrip(), "") |
506 break |
510 break |
507 |
511 |
508 # do the coding stuff |
512 # do the coding stuff |
509 if self.project.getProjectType() in ("PySide2",): |
513 if self.project.getProjectType() in ("PySide2", "PySide6"): |
510 pyqtSignatureFormat = '@Slot({0})' |
514 pyqtSignatureFormat = '@Slot({0})' |
511 else: |
515 else: |
512 pyqtSignatureFormat = '@pyqtSlot({0})' |
516 pyqtSignatureFormat = '@pyqtSlot({0})' |
513 for row in range(self.slotsModel.rowCount()): |
517 for row in range(self.slotsModel.rowCount()): |
514 topItem = self.slotsModel.item(row) |
518 topItem = self.slotsModel.item(row) |