T
Terry Reedy
| self.setFixedSize(200, 120)
| self.quit = QtGui.QPushButton("Quit", self)
| self.quit.setGeometry(62, 40, 75, 30)
| self.quit.setFont(QtGui.QFont("Times", 18, QtGui.QFont.Bold))
| self.connect(self.quit, QtCore.SIGNAL("clicked()"), QtGui.qApp,
| QtCore.SLOT("quit()"))
|
| to be rewritten as:
|
| using self:
| __setFixedSize(200,120)
| __quit = QtGui.QPushButton("Quit", self)
| __using quit:
| ____setGeometry(62, 40, 75, 30)
| ____setFont(QtGui.QFont("Times", 18, QtGui.QFont.Bold))
| __connect(self.quit, QtCore.SIGNAL("clicked()"), QtGui.qApp,
| QtCore.SLOT("quit()"))
If you want to save typing, you are free to use 's' instead of 'self' as
the parameter name. No need to make a fairly major language change.
I do things like 'import math as m' to save repetition.
tjr
| self.quit = QtGui.QPushButton("Quit", self)
| self.quit.setGeometry(62, 40, 75, 30)
| self.quit.setFont(QtGui.QFont("Times", 18, QtGui.QFont.Bold))
| self.connect(self.quit, QtCore.SIGNAL("clicked()"), QtGui.qApp,
| QtCore.SLOT("quit()"))
|
| to be rewritten as:
|
| using self:
| __setFixedSize(200,120)
| __quit = QtGui.QPushButton("Quit", self)
| __using quit:
| ____setGeometry(62, 40, 75, 30)
| ____setFont(QtGui.QFont("Times", 18, QtGui.QFont.Bold))
| __connect(self.quit, QtCore.SIGNAL("clicked()"), QtGui.qApp,
| QtCore.SLOT("quit()"))
If you want to save typing, you are free to use 's' instead of 'self' as
the parameter name. No need to make a fairly major language change.
I do things like 'import math as m' to save repetition.
tjr