Originally Posted by
wysota
In "changeValue" you refer to some object "self.lcdVolts" but where is that object? I don't see you assigning anything to "self.lcdVolts" anywhere. "self.lcdVolts" and "lcdVolts" are two totally different objects.
Well, I added "self" to all places where it seemed appropriate. The program runs fine with, or without, "self", but the value is still not transferred to the LCD.
I'm still missing something, but can't figure out what.
Thanks for your patience,
Don
def createTopRightGroupBox(self):
self.
topRightGroupBox = QtGui.
QGroupBox("Top Right")
self.
labelVolts = QtGui.
QLabel("Volts/Div") self.labelVolts.setAlignment(QtCore.Qt.AlignHCenter)
volts = ['2.5', '5.0', '10.0', '20.0']
self.comboVolts.addItems(volts)
layout.addWidget(self.labelVolts)
layout.addWidget(self.comboVolts)
layout.addWidget(self.lcdVolts)
layout.addStretch(1)
self.topRightGroupBox.setLayout(layout)
# process signal
self.connect(self.comboVolts, QtCore.SIGNAL('valueChanged(double)'), self.changeValue)
def changeValue(self, event):
volts = self.comboVolts.value()
self.lcdVolts.display(volts)
def createTopRightGroupBox(self):
self.topRightGroupBox = QtGui.QGroupBox("Top Right")
self.labelVolts = QtGui.QLabel("Volts/Div")
self.labelVolts.setAlignment(QtCore.Qt.AlignHCenter)
self.comboVolts = QtGui.QComboBox()
volts = ['2.5', '5.0', '10.0', '20.0']
self.comboVolts.addItems(volts)
self.lcdVolts = QtGui.QLCDNumber()
layout = QtGui.QVBoxLayout()
layout.addWidget(self.labelVolts)
layout.addWidget(self.comboVolts)
layout.addWidget(self.lcdVolts)
layout.addStretch(1)
self.topRightGroupBox.setLayout(layout)
# process signal
self.connect(self.comboVolts, QtCore.SIGNAL('valueChanged(double)'), self.changeValue)
def changeValue(self, event):
volts = self.comboVolts.value()
self.lcdVolts.display(volts)
To copy to clipboard, switch view to plain text mode
Bookmarks