63 |
63 |
64 def __init__(self, formName, project, parent=None): |
64 def __init__(self, formName, project, parent=None): |
65 """ |
65 """ |
66 Constructor |
66 Constructor |
67 |
67 |
68 @param formName name of the file containing the form (string) |
68 @param formName name of the file containing the form |
|
69 @type str |
69 @param project reference to the project object |
70 @param project reference to the project object |
70 @param parent parent widget if the dialog (QWidget) |
71 @type Project |
|
72 @param parent parent widget if the dialog |
|
73 @type QWidget |
71 """ |
74 """ |
72 super().__init__(parent) |
75 super().__init__(parent) |
73 self.setupUi(self) |
76 self.setupUi(self) |
74 |
77 |
75 self.okButton = self.buttonBox.button(QDialogButtonBox.StandardButton.Ok) |
78 self.okButton = self.buttonBox.button(QDialogButtonBox.StandardButton.Ok) |
156 |
159 |
157 def initError(self): |
160 def initError(self): |
158 """ |
161 """ |
159 Public method to determine, if there was an initialzation error. |
162 Public method to determine, if there was an initialzation error. |
160 |
163 |
161 @return flag indicating an initialzation error (boolean) |
164 @return flag indicating an initialzation error |
|
165 @rtype bool |
162 """ |
166 """ |
163 return self.__initError |
167 return self.__initError |
164 |
168 |
165 def __runUicLoadUi(self, command): |
169 def __runUicLoadUi(self, command): |
166 """ |
170 """ |
315 def __mapType(self, type_): |
320 def __mapType(self, type_): |
316 """ |
321 """ |
317 Private method to map a type as reported by Qt's meta object to the |
322 Private method to map a type as reported by Qt's meta object to the |
318 correct Python type. |
323 correct Python type. |
319 |
324 |
320 @param type_ type as reported by Qt (QByteArray) |
325 @param type_ type as reported by Qt |
321 @return mapped Python type (string) |
326 @type QByteArray |
|
327 @return mapped Python type |
|
328 @rtype str |
322 """ |
329 """ |
323 mapped = bytes(type_).decode() |
330 mapped = bytes(type_).decode() |
324 |
331 |
325 # I. always check for * |
332 # I. always check for * |
326 mapped = mapped.replace("*", "") |
333 mapped = mapped.replace("*", "") |
611 @pyqtSlot(int) |
618 @pyqtSlot(int) |
612 def on_classNameCombo_activated(self, index): |
619 def on_classNameCombo_activated(self, index): |
613 """ |
620 """ |
614 Private slot to handle the activated signal of the classname combo. |
621 Private slot to handle the activated signal of the classname combo. |
615 |
622 |
616 @param index index of the activated item (integer) |
623 @param index index of the activated item |
|
624 @type int |
617 """ |
625 """ |
618 self.okButton.setEnabled(True) |
626 self.okButton.setEnabled(True) |
619 self.__updateSlotsModel() |
627 self.__updateSlotsModel() |
620 |
628 |
621 def on_filterEdit_textChanged(self, text): |
629 def on_filterEdit_textChanged(self, text): |
622 """ |
630 """ |
623 Private slot called, when thext of the filter edit has changed. |
631 Private slot called, when thext of the filter edit has changed. |
624 |
632 |
625 @param text changed text (string) |
633 @param text changed text |
|
634 @type str |
626 """ |
635 """ |
627 rx = QRegularExpression( |
636 rx = QRegularExpression( |
628 text, QRegularExpression.PatternOption.CaseInsensitiveOption |
637 text, QRegularExpression.PatternOption.CaseInsensitiveOption |
629 ) |
638 ) |
630 self.proxyModel.setFilterRegularExpression(rx) |
639 self.proxyModel.setFilterRegularExpression(rx) |
652 def on_buttonBox_clicked(self, button): |
661 def on_buttonBox_clicked(self, button): |
653 """ |
662 """ |
654 Private slot to handle the buttonBox clicked signal. |
663 Private slot to handle the buttonBox clicked signal. |
655 |
664 |
656 @param button reference to the button that was clicked |
665 @param button reference to the button that was clicked |
657 (QAbstractButton) |
666 @type QAbstractButton |
658 """ |
667 """ |
659 if button == self.okButton: |
668 if button == self.okButton: |
660 self.__generateCode() |
669 self.__generateCode() |
661 self.accept() |
670 self.accept() |