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