33 |
33 |
34 class CreateDialogCodeDialog(QDialog, Ui_CreateDialogCodeDialog): |
34 class CreateDialogCodeDialog(QDialog, Ui_CreateDialogCodeDialog): |
35 """ |
35 """ |
36 Class implementing a dialog to generate code for a Qt4 dialog. |
36 Class implementing a dialog to generate code for a Qt4 dialog. |
37 """ |
37 """ |
|
38 DialogClasses = {"QDialog", "QWidget", "QMainWindow", "QWizard"} |
|
39 |
38 def __init__(self, formName, project, parent=None): |
40 def __init__(self, formName, project, parent=None): |
39 """ |
41 """ |
40 Constructor |
42 Constructor |
41 |
43 |
42 @param formName name of the file containing the form (string) |
44 @param formName name of the file containing the form (string) |
83 if self.__module is not None: |
85 if self.__module is not None: |
84 self.filenameEdit.setText(self.srcFile) |
86 self.filenameEdit.setText(self.srcFile) |
85 |
87 |
86 classesList = [] |
88 classesList = [] |
87 for cls in list(self.__module.classes.values()): |
89 for cls in list(self.__module.classes.values()): |
88 classesList.append(cls.name) |
90 if not set(cls.super).isdisjoint(CreateDialogCodeDialog.DialogClasses): |
|
91 classesList.append(cls.name) |
89 classesList.sort() |
92 classesList.sort() |
90 self.classNameCombo.addItems(classesList) |
93 self.classNameCombo.addItems(classesList) |
91 |
94 |
92 if os.path.exists(self.srcFile) and \ |
95 if os.path.exists(self.srcFile) and \ |
93 self.__module is not None and \ |
96 self.__module is not None and \ |