Is it necessary that the call should be in __init__? The widget is very much getting created and I have the line (copied again here) under a method setupUi() under Ui_MainWindow:
class Ui_MainWindow(object): [snip] def setupUi(self, MainWindow): [snip] self.textEdit_fwcmdlineoutput = QtGui.QTextEdit(self.tab_fw) self.textEdit_fwcmdlineoutput.setObjectName(_fromUtf8("textEdit_fwcmdlineoutput")) self.gridLayout.addWidget(self.textEdit_fwcmdlineoutput, 6, 0, 1, 3) Thanks, -SM On Thu, Aug 8, 2013 at 4:41 PM, Prasad, Ramit <ramit.pra...@jpmorgan.com>wrote: > Please post responses in-line or at the bottom for this > mailing list. > > SM wrote: > > > > Ramit: > > Thanks for the quick response. You are right about the error. When I did > the following: > > x = Ui_MainWindow() > > x.setStdoutToTextEditWindowFw() > > I got the following error: > > AttributeError: 'Ui_MainWindow' object has no attribute > 'textEdit_fwcmdlineoutput' > > But I do have code that creates an attribute in Ui_MainWindow() class: > > > > self.textEdit_fwcmdlineoutput = QtGui.QTextEdit(self.tab_fw) > > This is what is making me get confused as to why it complains that there > is no attribute. > > Thanks, > > -SM > > You need to call that line of code to create the widget. Obviously > it is not being created from the class's __init__. > > > ~Ramit > > > > This email is confidential and subject to important disclaimers and > conditions including on offers for the purchase or sale of securities, > accuracy and completeness of information, viruses, confidentiality, legal > privilege, and legal entity disclaimers, available at > http://www.jpmorgan.com/pages/disclosures/email. >
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor