[PyKDE] QComboBox and grabKeyboard problem

Patrick Gaherty pgaherty at chambersharrap.co.uk
Fri Nov 29 10:59:00 GMT 2002


I'm having problems getting the grabKeyboard method to work with
QComboBox.

Below is a small sample program that demonstrates my problem.
If I swap the QComboBox for a QLineEdit grabKeyboard works as expected

I'm using QT 3.0.6 and the latest PyQT snapshot.

Any help on this would be greatly appreciated.

Patrick Gaherty


from qt import *
import sys


class Dialog(QDialog):
	def __init__(self,*args):
		QDialog.__init__(self,*args)
		
		layout = QHBoxLayout(self)

		self.CBox1 = QComboBox(0,self,"CBox1")
		self.CBox1.setEditable(1)
		layout.addWidget(self.CBox1)

		self.CBox1.grabKeyboard()

		print self.keyboardGrabber()


def main():
	app = QApplication(sys.argv)

	win = Dialog()
	win.show()

	app.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()"))
	app.exec_loop()

if __name__ == '__main__':
	main()






More information about the PyQt mailing list