[Qt-interest] How to make a QPushButton inside a QGraphicsView lose focus ?

Aaron Lewis aaron.lewis1989 at gmail.com
Mon May 10 14:39:10 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
	Inside a QGraphicsView , i have a Scene and a Button.

	I first created a QGraphicsScene and use setScene() function in
QGraphicsView , then created QPushButton.


===========================================================
	Sample Code:
	
	scene = new Scene();	// Scene inherits QGraphicsScene
	setScene(scene);

	QPushButton *leaveButton = new QPushButton(this); 	// use QGraphicsView
as parent

	scene->addItem(leaveButton);

============================================================

And now my QPushButton takes focus , how should i make my scene get
focus now ?

- ------------------------
| View		       |
|----------  --------  |
|| Button |  | Scene | |
|----------  --------- |
- ------------------------

Appreciate any of you help ;-)
Thanks.

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvn/m4ACgkQvf41sEptMqAE9wCfRcssMW2sbpBwdsd4AlztJhoz
hBEAoNJkmaPHd31AJnkzPLbMeaufnt5s
=mYjz
-----END PGP SIGNATURE-----



More information about the Qt-interest-old mailing list