Originally Posted by
rajeshs
Hi all,
Now i am using QT 4.2 , I want to disable mouse action when mouse pointer moves to particular Widget, and when it moves to another widget it should be enabled,
If anybody knows please help me.
Thanks
Rajesh.S
I guess there are no direct method to do. Probably you create your own cursor which is blank and set for the widget. This sounds crude but anyway try this. You might need to ignore all the mouse events if you dont want the widget to be disabled.
#include <QtGui>
{
public:
{
bitmap.fill(Qt::color0);//initialize every thing to 0 bit
QCursor cursor
(bitmap,bitmap
);
//blank cursor setCursor(cursor);
}
bool event
};
int main(int argc, char *argv[])
{
Widget w;
w.show();
return app.exec();
}
#include <QtGui>
class Widget : public QWidget
{
public:
Widget(QWidget *par=0) : QWidget(par)
{
QBitmap bitmap(32,32);
bitmap.fill(Qt::color0);//initialize every thing to 0 bit
QCursor cursor(bitmap,bitmap);//blank cursor
setCursor(cursor);
}
bool event
};
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Widget w;
w.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks