class class BuddyList
(QtGui.
QWidget): def __init__(self,parent=None):
QtGui.
QWidget.__init__
(self, parent
) #some initialization...#
#username
self.username = LineDisplay(self,self)
self.
username.
setGeometry(QtCore.
QRect(120,
10,
121,
20))
class LineDisplay
(QtGui.
QLabel): def __init__(self,buddyList,parent=None):
QtGui.
QLabel.__init__
(self, parent
) self.buddyList = buddyList
def mousePressEvent(self, event):
self.buddyList.username = None
self.
buddyList.
usernameInput = QtGui.
QLineEdit(self
) self.
buddyList.
usernameInput.
setGeometry(QtCore.
QRect(120,
10,
121,
20))
class class BuddyList(QtGui.QWidget):
def __init__(self,parent=None):
QtGui.QWidget.__init__(self, parent)
#some initialization...#
#username
self.username = LineDisplay(self,self)
self.username.setGeometry(QtCore.QRect(120, 10, 121, 20))
class LineDisplay(QtGui.QLabel):
def __init__(self,buddyList,parent=None):
QtGui.QLabel.__init__(self, parent)
self.buddyList = buddyList
def mousePressEvent(self, event):
self.buddyList.username = None
self.buddyList.usernameInput = QtGui.QLineEdit(self)
self.buddyList.usernameInput.setGeometry(QtCore.QRect(120, 10, 121, 20))
To copy to clipboard, switch view to plain text mode
Bookmarks