View Full Version : setCursor & a disabled Widget

FoX_*D i E*
15th September 2008, 11:38
Hello !
I'ld like to set a cursor when a widget is disabled :

QPushButton *mywidget= new QPushButton();
mywidget -> setEnabled(false);
mywidget -> setCursor(Qt::ForbiddenCursor);

It doesn't work. Qt permit that or not ?

15th September 2008, 11:41
Have you tried to set the cursor first then disable the push button?

FoX_*D i E*
15th September 2008, 11:43
yes i tried.
But it cant be the problem, we should set a property whenever we want for a simple case like that.

FoX_*D i E*
16th September 2008, 11:27
ok i've got it, we can do that :


An enabled widget handles keyboard and mouse events; a disabled widget does not.